Class StallDetector#
Defined in File StallDetector.h
Nested Relationships#
Nested Types#
Class Documentation#
-
class StallDetector#
Find unusually slow CVODE calls and save a small amount of surrounding information.
The integrator supplies CVODE’s running totals immediately before and after a successful call. This class owns everything needed to judge and record a slowdown.
Public Functions
-
StallDetector()#
Construct a disabled detector with no output session.
-
~StallDetector()#
Flush and close the output session without throwing.
-
StallDetector(const StallDetector&) = delete#
-
StallDetector &operator=(const StallDetector&) = delete#
-
void enable()#
Start monitoring and immediately create a new HDF5 file.
-
void disable()#
Stop monitoring, finish the current record, and close the file.
-
bool enabled() const noexcept#
Get whether monitoring is active.
- Returns:
Whether monitoring is currently active
-
void prepareAdvance(const StallDiagnostics &diagnostics, double requested_start, double requested_end)#
Save the work totals and requested times before CVODE runs.
- Parameters:
diagnostics – Cumulative counters before CVODE runs.
requested_start – Requested start time in seconds.
requested_end – Requested target time in seconds.
-
void recordAdvance(const StallDiagnostics &diagnostics, double actual_time)#
Check and immediately record a successful CVODE call.
- Parameters:
diagnostics – Cumulative counters after CVODE succeeds.
actual_time – Time reached by CVODE in seconds.
-
void reset(double current_time, bool hard)#
Update monitoring state after the solver is reset.
- Parameters:
current_time – Public solver time after reset.
hard – Whether cumulative diagnostic history was cleared.
-
const std::string &logFile() const noexcept#
Return the generated filename, or an empty string while monitoring is off.
- Returns:
String corresponding to current filename
-
long stallCount() const noexcept#
Return the number of stalls found since the last full reset.
- Returns:
Number of stalls since last hard reset
-
long lastAdvanceSteps() const noexcept#
Return successful solver steps used by the most recent checked call.
- Returns:
Number of solver steps in the most recent advancement call
-
long lastAdvanceRhsEvals() const noexcept#
Return right-hand-side calls used by the most recent checked call.
- Returns:
Number of right-hand-side calls in the most recent advancement call
-
long lastAdvanceErrorTestFailures() const noexcept#
Return failed error checks from the most recent checked call.
- Returns:
Number of error test failures in most recent advancement call
-
struct StallDiagnostics#
CVODE’s running work totals at the start or end of a call.
Public Members
-
long steps = 0#
Successful solver steps.
-
long rhs_evals = 0#
Derivative calculations.
-
long error_test_failures = 0#
Steps retried after failing an error check.
-
long nonlinear_iterations = 0#
Attempts to solve the step equations.
-
long nonlinear_failures = 0#
Failed attempts to solve the step equations.
-
long jacobian_evals = 0#
Jacobian evaluations.
-
long steps = 0#
-
StallDetector()#