-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempt to precompile linsolve (#698)
* attempt to precompile linsolve ```julia using OrdinaryDiffEq, SnoopCompile function lorenz(du,u,p,t) du[1] = 10.0(u[2]-u[1]) du[2] = u[1]*(28.0-u[3]) - u[2] du[3] = u[1]*u[2] - (8/3)*u[3] end u0 = [1.0;0.0;0.0] tspan = (0.0,100.0) prob = ODEProblem(lorenz,u0,tspan) alg = Rodas5() tinf = @snoopi_deep solve(prob,alg) ``` * Update src/DiffEqBase.jl Co-authored-by: Tim Holy <tim.holy@gmail.com> * make precompilation a bit safer * copyto * fix precompile * fix current state * remove invalidation of mapreduce_empty * Force Matrix{Float64} * hoist chunk size choice earlier via `prepare_alg` * bring invalidation back so tests don't fail * fix copyto! -> fill! Co-authored-by: Tim Holy <tim.holy@gmail.com>
- Loading branch information
1 parent
9d3aa5b
commit 0227b8d
Showing
4 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let | ||
while true | ||
_testf(du,u,p,t) = copyto!(du,u) | ||
b = rand(1); x = rand(1) | ||
_linsolve = DEFAULT_LINSOLVE(Val{:init},ODEFunction(_testf),b) | ||
A = rand(1,1) | ||
_linsolve(x,A,b,true) | ||
_linsolve(x,A,b,false) | ||
_linsolve = LUFactorize()(Val{:init},ODEFunction(_testf),b) | ||
_linsolve(x,A,b,true) | ||
_linsolve(x,A,b,false) | ||
Pl = ScaleVector([1.0],true) | ||
Pr = ScaleVector([1.0],false) | ||
reltol = 1.0 | ||
_linsolve(x,A,b,true;reltol=reltol,Pl=Pl,Pr=Pr) | ||
_linsolve(x,A,b,false;reltol=reltol,Pl=Pl,Pr=Pr) | ||
break | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters