Gromacs
2024.3
|
#include <gromacs/mdlib/simulationsignal.h>
Object used by mdrun ranks to signal to each other at this step.
This object has responsibility to read signal values from gs
, coordinate communication within and perhaps between simulations, and set result signal values in gs
as appropriate.
It is intended to have a very short lifetime, so should remain easy to construct and destruct on the stack just when the global communication occurs.
Public Member Functions | |
SimulationSignaller (SimulationSignals *signals, const t_commrec *cr, const gmx_multisim_t *ms, bool doInterSim, bool doIntraSim) | |
Constructor. | |
gmx::ArrayRef< real > | getCommunicationBuffer () |
Return a reference to an array of signal values to communicate. More... | |
void | signalInterSim () |
Handle inter-simulation signal communication. More... | |
void | setSignals () |
Propagate signals when appropriate. More... | |
void | finalizeSignals () |
Convenience wrapper that calls signalInterSim() then setSignals(). | |
gmx::ArrayRef< real > gmx::SimulationSignaller::getCommunicationBuffer | ( | ) |
Return a reference to an array of signal values to communicate.
void gmx::SimulationSignaller::setSignals | ( | ) |
Propagate signals when appropriate.
Always propagate an mdrun signal value when doing inter-simulation signalling; otherwise, propagate it only if should be propagated within this simulation, ie. locally. See documentation of SimulationSignal for details.
void gmx::SimulationSignaller::signalInterSim | ( | ) |
Handle inter-simulation signal communication.
If an inter-simulation signal should be handled, communicate between simulation-main ranks, then propagate from the mains to the rest of the ranks for each simulation. It is the responsibility of the calling code to ensure that any necessary intra-simulation signalling has already occurred, e.g. in global_stat().