Skip to content

Commit 55f4cc9

Browse files
committed
Note on how to set preferences without loading the pacakge
1 parent 24fb3ce commit 55f4cc9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ Precompilation can be controlled via `Preferences.jl`
4848
- `PrecompileMIRK` -- Precompile the MIRK2 - MIRK6 algorithms (default: `true`).
4949
- `PrecompileShooting` -- Precompile the single shooting algorithms (default: `true`). This is triggered when `OrdinaryDiffEq` is loaded.
5050
- `PrecompileMultipleShooting` -- Precompile the multiple shooting algorithms (default: `true`). This is triggered when `OrdinaryDiffEq` is loaded.
51+
52+
To set these preferences before loading the package, do the following (replacing `PrecompileShooting` with the preference you want to set, or pass in multiple pairs to set them together):
53+
54+
```julia
55+
using Preferences, UUIDs
56+
Preferences.set_preferences!(UUID("764a87c0-6b3e-53db-9096-fe964310641d"),
57+
"PrecompileShooting" => false)
58+
```

src/BoundaryValueDiffEq.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ end
7676

7777
algs = []
7878

79+
jac_alg = BVPJacobianAlgorithm(AutoForwardDiff(; chunksize = 2))
80+
7981
if Preferences.@load_preference("PrecompileMIRK", true)
8082
append!(algs,
8183
[MIRK2(; jac_alg), MIRK3(; jac_alg), MIRK4(; jac_alg),
8284
MIRK5(; jac_alg), MIRK6(; jac_alg)])
8385
end
8486

85-
jac_alg = BVPJacobianAlgorithm(AutoForwardDiff(; chunksize = 2))
86-
8787
@compile_workload begin
8888
for prob in probs, alg in algs
8989
solve(prob, alg; dt = 0.2)

0 commit comments

Comments
 (0)