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

#include <gromacs/domdec/localtopologychecker.h>

Description

Has responsibility for checking that the local topology distributed across domains describes a total number of bonded interactions that matches the system topology.

This uses the ObservablesReducer framework to check that the count of bonded interactions in the local topology made for each domain sums to the expected value. Because this check is not urgent, the communication that it requires is done at the next opportunity, rather than requiring extra communication. If the check fails, a fatal error stops execution. In principle, if there was a bug, GROMACS might crash in the meantime because of the wrong forces. However as a bug is unlikely we optimize by avoiding creating extra overhead from communication.

Public Member Functions

 LocalTopologyChecker (const MDLogger &mdlog, const MpiComm &mpiComm, const gmx_domdec_t &dd, const gmx_mtop_t &mtop, DDBondedChecking ddBondedChecking, bool useUpdateGroups, ObservablesReducerBuilder *observablesReducerBuilder)
 Constructor. More...
 
 ~LocalTopologyChecker ()
 Destructor.
 
 LocalTopologyChecker (LocalTopologyChecker &&other) noexcept
 Move constructor.
 
LocalTopologyCheckeroperator= (LocalTopologyChecker &&other) noexcept
 Move assignment.
 
void scheduleCheckOfLocalTopology (const gmx_localtop_t &localTopology, int numBondedInteractionsToReduce, const t_state *localState)
 Set that the local topology should be checked via observables reduction whenever that reduction is required by another module. In case of a single domain a direct assertion is performed instead. More...
 

Constructor & Destructor Documentation

gmx::LocalTopologyChecker::LocalTopologyChecker ( const MDLogger mdlog,
const MpiComm mpiComm,
const gmx_domdec_t &  dd,
const gmx_mtop_t &  mtop,
DDBondedChecking  ddBondedChecking,
bool  useUpdateGroups,
ObservablesReducerBuilder observablesReducerBuilder 
)

Constructor.

Parameters
[in]mdlogLogger
[in]mpiCommCommunication object for my group
[in]ddDomain decomposition object
[in]mtopGlobal system topology
[in]ddBondedCheckingTells for which bonded interactions presence should be checked
[in]useUpdateGroupsWhether update groups are in use
[in]observablesReducerBuilderHandle to builder for ObservablesReducer

Member Function Documentation

void gmx::LocalTopologyChecker::scheduleCheckOfLocalTopology ( const gmx_localtop_t localTopology,
int  numBondedInteractionsToReduce,
const t_state localState 
)

Set that the local topology should be checked via observables reduction whenever that reduction is required by another module. In case of a single domain a direct assertion is performed instead.

Parameters
[in]localTopologyThe local topology
[in]numBondedInteractionsToReduceThe number of interactions in localTopology
[in]localStateThe local state, for printing distances, can be nullptr

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