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

#include <gromacs/mdlib/simulationsignal.h>

Description

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< realgetCommunicationBuffer ()
 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().
 

Member Function Documentation

gmx::ArrayRef< real > gmx::SimulationSignaller::getCommunicationBuffer ( )

Return a reference to an array of signal values to communicate.

Returns
If intra-sim signalling will take place, fill and return a reference to the array of reals in which signals will be communicated with the signal values to be sent. Otherwise return a EmptyArrayRef.
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().


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