Skip to content

Commit

Permalink
Add type stability tests and precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Mar 24, 2024
1 parent 1c1eef5 commit 094e02e
Show file tree
Hide file tree
Showing 7 changed files with 302 additions and 312 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
version:
- '1'
steps:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ For the list of available solvers, please refer to the [DifferentialEquations.jl
Precompilation can be controlled via `Preferences.jl`

- `PrecompileMIRK` -- Precompile the MIRK2 - MIRK6 algorithms (default: `true`).
- `PrecompileShooting` -- Precompile the single shooting algorithms (default: `false`). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileMultipleShooting` -- Precompile the multiple shooting algorithms (default: `false`). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileMIRKNLLS` -- Precompile the MIRK2 - MIRK6 algorithms for under-determined and over-determined BVPs (default: `false`).
- `PrecompileShootingNLLS` -- Precompile the single shooting algorithms for under-determined and over-determined BVPs (default: `false`). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileMultipleShootingNLLS` -- Precompile the multiple shooting algorithms for under-determined and over-determined BVPs (default: `false` ). This is triggered when `OrdinaryDiffEq` is loaded.
- `PrecompileShooting` -- Precompile the single shooting algorithms (default: `true`).
- `PrecompileMultipleShooting` -- Precompile the multiple shooting algorithms (default: `true`).
- `PrecompileMIRKNLLS` -- Precompile the MIRK2 - MIRK6 algorithms for under-determined and over-determined BVPs (default: `true`).
- `PrecompileShootingNLLS` -- Precompile the single shooting algorithms for under-determined and over-determined BVPs (default: `true`).
- `PrecompileMultipleShootingNLLS` -- Precompile the multiple shooting algorithms for under-determined and over-determined BVPs (default: `true` ).

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):

Expand Down
5 changes: 3 additions & 2 deletions ext/BoundaryValueDiffEqODEInterfaceExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function SciMLBase.__solve(prob::BVProblem, alg::BVPM2; dt = 0.0, reltol = 1e-3,
evalsol = evalSolution(sol, x_mesh)
ivpsol = SciMLBase.build_solution(prob, alg, x_mesh,
map(x -> reshape(convert(Vector{eltype(evalsol)}, x), u0_size), eachcol(evalsol));
retcode, stats = destats)
retcode, stats = destats, original = (sol, retcode, stats))

bvpm2_destroy(obj)
bvpm2_destroy(sol)
Expand Down Expand Up @@ -187,7 +187,8 @@ function SciMLBase.__solve(prob::BVProblem, alg::BVPSOL; maxiters = 1000,

ivpsol = SciMLBase.build_solution(prob, alg, sol_t,
map(x -> reshape(convert(Vector{eltype(u0_)}, x), u0_size), eachcol(sol_x));
retcode = retcode 0 ? ReturnCode.Success : ReturnCode.Failure, stats)
retcode = retcode 0 ? ReturnCode.Success : ReturnCode.Failure, stats,
original = (sol_t, sol_x, retcode, stats))

return SciMLBase.build_solution(prob, ivpsol, nothing)
end
Expand Down
Loading

0 comments on commit 094e02e

Please sign in to comment.