Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::ResetHandler Class Referencefinal

#include <gromacs/mdlib/resethandler.h>

Description

Class handling the reset of counters.

Main rank sets the reset signal if half the run time is reached. All ranks receive the reset signal and reset their respective counters. This also resets the counters if half the time steps have passed (no communication needed).

Public Member Functions

 ResetHandler (compat::not_null< SimulationSignal * > signal, bool simulationsShareState, int64_t nsteps, bool isMain, bool resetHalfway, real maximumHoursToRun, const MDLogger &mdlog, gmx_wallcycle *wcycle, gmx_walltime_accounting *walltime_accounting)
 ResetHandler constructor. More...
 
void setSignal (gmx_walltime_accounting *walltime_accounting)
 Decides whether a reset signal needs to be set. More...
 
void resetCounters (int64_t step, int64_t step_rel, const MDLogger &mdlog, FILE *fplog, const t_commrec *cr, nonbonded_verlet_t *nbv, t_nrnb *nrnb, const gmx_pme_t *pme, const pme_load_balancing_t *pme_loadbal, gmx_wallcycle *wcycle, gmx_walltime_accounting *walltime_accounting)
 Decides whether the counters are reset, and performs the reset if needed. More...
 

Constructor & Destructor Documentation

gmx::ResetHandler::ResetHandler ( compat::not_null< SimulationSignal * >  signal,
bool  simulationsShareState,
int64_t  nsteps,
bool  isMain,
bool  resetHalfway,
real  maximumHoursToRun,
const MDLogger mdlog,
gmx_wallcycle *  wcycle,
gmx_walltime_accounting walltime_accounting 
)

ResetHandler constructor.

Needs a pointer to the signal to communicate between ranks, information on whether multiple simulations need to be synchronized, and additional data to determine whether counter resetting takes place at all, and whether the current rank can set the resetting signal.

Member Function Documentation

void gmx::ResetHandler::resetCounters ( int64_t  step,
int64_t  step_rel,
const MDLogger mdlog,
FILE *  fplog,
const t_commrec *  cr,
nonbonded_verlet_t nbv,
t_nrnb *  nrnb,
const gmx_pme_t *  pme,
const pme_load_balancing_t *  pme_loadbal,
gmx_wallcycle *  wcycle,
gmx_walltime_accounting walltime_accounting 
)
inline

Decides whether the counters are reset, and performs the reset if needed.

The counters are reset if

* the signal for resetting was received, or
* the (local) number of steps reached the defined counter reset step.

Note that even if two reset conditions are present (at a specific step and a specific time), the reset will only take place once, whenever the first condition is met.

void gmx::ResetHandler::setSignal ( gmx_walltime_accounting walltime_accounting)
inline

Decides whether a reset signal needs to be set.

Reset signal is set if run time is greater than 49.5% of maximal run time.


The documentation for this class was generated from the following files: