Skip to content

The precompilation of this package is likely excessive and not very useful #417

Open
SciML/DiffEqBase.jl
#1101
@KristofferC

Description

@KristofferC

This package does a more or less exhaustive combination of problems, algorithms and element types

for T in (Float32, Float64), (fn, u0) in nlfuncs
push!(probs_nls, NonlinearProblem(fn, T.(u0), T(2)))
end

@compile_workload begin
for prob in probs_nls, alg in nls_algs
solve(prob, alg; abstol = 1e-2, verbose = false)
end
for prob in probs_nlls, alg in nlls_algs
solve(prob, alg; abstol = 1e-2, verbose = false)
end
end

A total of 104 combinations of problems and algorithms are compiled in total.

At the same time, the problem specializes on the input function:

julia> typeof(prob)
NonlinearProblem{Float64, false, Float64, NonlinearFunction{false, SciMLBase.FullSpecialize, var"#1#2",

(the var"#1#2" is an anonymous function defined locally). so the compiled code is unlikely to be valid for users (which have their own functions that they solve).

It is not clear to me that there is any point at all to the precompilation of solve(prob, alg) after the very first call has been compiled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions