Skip to content

Commit db1032c

Browse files
Merge pull request #418 from oscardssmith/os/parallel-precompile
run precompile workload in parallel
2 parents 71b3f87 + c834033 commit db1032c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/NonlinearSolve.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,19 @@ include("default.jl")
135135
TrustRegion(; linsolve = LUFactorization()), nothing)
136136

137137
@compile_workload begin
138+
@sync begin
139+
for T in (Float32, Float64), (fn, u0) in nlfuncs
140+
Threads.@spawn NonlinearProblem(fn, T.(u0), T(2))
141+
end
142+
for (fn, u0) in nlfuncs
143+
Threads.@spawn NonlinearLeastSquaresProblem(fn, u0, 2.0)
144+
end
138145
for prob in probs_nls, alg in nls_algs
139-
solve(prob, alg; abstol = 1e-2, verbose = false)
146+
Threads.@spawn solve(prob, alg; abstol = 1e-2, verbose = false)
140147
end
141148
for prob in probs_nlls, alg in nlls_algs
142-
solve(prob, alg; abstol = 1e-2, verbose = false)
149+
Threads.@spawn solve(prob, alg; abstol = 1e-2, verbose = false)
150+
end
143151
end
144152
end
145153
end

0 commit comments

Comments
 (0)