Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammodels::sph::WalltimeLimiter Struct Reference

Tracks the wall-clock budget for Solver::evolve_until(): decides when the next walltime check is due, and whether the limit has been exceeded. More...

#include <shammodels/sph/include/shammodels/sph/Solver.hpp>

Public Member Functions

 WalltimeLimiter (bool active, f64 max_walltime)
f64 synced_wtime ()
bool due (i32 iter_count) const
 True if the next walltime check is due at this iteration count.
bool exceeded (i32 iter_count)

Public Attributes

bool active
f64 max_walltime
f64 start_wall_time
i32 next_check_iter

Detailed Description

Tracks the wall-clock budget for Solver::evolve_until(): decides when the next walltime check is due, and whether the limit has been exceeded.

Definition at line 69 of file Solver.hpp.

Constructor & Destructor Documentation

◆ WalltimeLimiter()

shammodels::sph::WalltimeLimiter::WalltimeLimiter ( bool active,
f64 max_walltime )
inline

Definition at line 75 of file Solver.hpp.

Member Function Documentation

◆ due()

bool shammodels::sph::WalltimeLimiter::due ( i32 iter_count) const
inline

True if the next walltime check is due at this iteration count.

Definition at line 89 of file Solver.hpp.

◆ exceeded()

bool shammodels::sph::WalltimeLimiter::exceeded ( i32 iter_count)
inline

Must only be called when due(iter_count) is true. Returns true if the walltime limit has been reached, otherwise updates the next check iteration estimate.

Definition at line 93 of file Solver.hpp.

Here is the call graph for this function:

◆ synced_wtime()

f64 shammodels::sph::WalltimeLimiter::synced_wtime ( )
inline

Definition at line 81 of file Solver.hpp.

Member Data Documentation

◆ active

bool shammodels::sph::WalltimeLimiter::active

Definition at line 70 of file Solver.hpp.

◆ max_walltime

f64 shammodels::sph::WalltimeLimiter::max_walltime

Definition at line 71 of file Solver.hpp.

◆ next_check_iter

i32 shammodels::sph::WalltimeLimiter::next_check_iter

Definition at line 73 of file Solver.hpp.

◆ start_wall_time

f64 shammodels::sph::WalltimeLimiter::start_wall_time

Definition at line 72 of file Solver.hpp.


The documentation for this struct was generated from the following file: