Skip to content

Commit

Permalink
Disable CvodeF checkpointing (#2645)
Browse files Browse the repository at this point in the history
amici wants to avoid sundials' checkpointing, that's we set `steps` (the number of integration steps at which a checkpoint is created) for `CVodeAdjInit` to the maximum number of integration steps (`mxsteps`) for the forward problem.

However, the checkpoint is created at step `steps`, not at step `steps + 1`.

Therefore, if the forward integration takes exactly `mxsteps`, a checkpoint is still created.

This is not a problem per se, but it may trigger segfaults under circumstances not fully understood (-> LLNL/sundials#49).
Although unlikely, it still occasionally crashes long running optimizations.

This change should make sure that checkpointing never occurs.
  • Loading branch information
dweindl authored Feb 17, 2025
1 parent 66552d7 commit 624e9ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/solver_cvodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ void CVodeSolver::adjInit() const {
status = CVodeAdjReInit(solver_memory_.get());
} else {
status = CVodeAdjInit(
solver_memory_.get(), static_cast<int>(maxsteps_),
solver_memory_.get(), static_cast<int>(maxsteps_ + 1),
static_cast<int>(interp_type_)
);
setAdjInitDone();
Expand Down

0 comments on commit 624e9ad

Please sign in to comment.