Skip to content

Commit 1e8f185

Browse files
Merge pull request #197 from SciML/snoop
Snoop the precompilation
2 parents 9ccde57 + a0cd9d0 commit 1e8f185

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4"
1717
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1818
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1919
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
20+
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
2021
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2122
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
2223
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
@@ -34,6 +35,7 @@ RecursiveFactorization = "0.2.8"
3435
Reexport = "1"
3536
SciMLBase = "1.32"
3637
Setfield = "0.7, 0.8, 1"
38+
SnoopPrecompile = "1"
3739
UnPack = "1"
3840
julia = "1.6"
3941

docs/src/tutorials/linear.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Note that `solve(prob)` is equivalent to `solve(prob,nothing)` where `nothing`
2222
denotes the choice of the default linear solver. This is equivalent to the
2323
Julia built-in `A\b`, where the solution is recovered via `sol.u`. The power
2424
of this package comes into play when changing the algorithms. For example,
25-
[IterativeSolvers.jl](https://github.com/JuliaLinearAlgebra/IterativeSolvers.jl)
25+
[Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl)
2626
has some nice methods like GMRES which can be faster in some cases. With
2727
LinearSolve.jl, there is one interface and changing linear solvers is simply
2828
the switch of the algorithm choice:
2929

3030
```@example linsys1
31-
sol = solve(prob,IterativeSolversJL_GMRES())
31+
sol = solve(prob,KrylovJL_GMRES())
3232
sol.u
3333
```
3434

src/LinearSolve.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ include("init.jl")
4949
const IS_OPENBLAS = Ref(true)
5050
isopenblas() = IS_OPENBLAS[]
5151

52+
import SnoopPrecompile
53+
54+
SnoopPrecompile.@precompile_all_calls begin
55+
A = rand(4, 4)
56+
b = rand(4)
57+
prob = LinearProblem(A, b)
58+
sol = solve(prob)
59+
sol = solve(prob, LUFactorization())
60+
sol = solve(prob, RFLUFactorization())
61+
sol = solve(prob, KrylovJL_GMRES())
62+
63+
A = sprand(4, 4, 0.9)
64+
prob = LinearProblem(A, b)
65+
sol = solve(prob)
66+
sol = solve(prob, KLUFactorization())
67+
sol = solve(prob, UMFPACKFactorization())
68+
end
69+
5270
export LUFactorization, SVDFactorization, QRFactorization, GenericFactorization,
5371
GenericLUFactorization, SimpleLUFactorization, RFLUFactorization,
5472
UMFPACKFactorization, KLUFactorization, FastLUFactorization, FastQRFactorization

0 commit comments

Comments
 (0)