dd->atomSets = atomSets;
- dd->localTopologyChecker =
- std::make_unique<LocalTopologyChecker>(mtop_, dd->comm->systemInfo.useUpdateGroups);
+ dd->localTopologyChecker = std::make_unique<LocalTopologyChecker>(
+ mdlog_, cr_, mtop_, dd->comm->systemInfo.useUpdateGroups);
return dd;
}
}
}
+const gmx::LocalTopologyChecker& dd_localTopologyChecker(const gmx_domdec_t& dd)
+{
+ return *dd.localTopologyChecker;
+}
+
+gmx::LocalTopologyChecker* dd_localTopologyChecker(gmx_domdec_t* dd)
+{
+ return dd->localTopologyChecker.get();
+}
+
void dd_init_local_state(const gmx_domdec_t& dd, const t_state* state_global, t_state* state_local)
{
std::array<int, 5> buf;
struct AtomInfoWithinMoleculeBlock;
class DeviceStreamManager;
class ForceWithShiftForces;
+class LocalTopologyChecker;
class MDLogger;
class RangePartitioning;
class VirtualSitesHandler;
template<typename>
class ArrayRef;
-enum class DDBondedChecking : bool;
} // namespace gmx
/*! \brief Returns the global topology atom number belonging to local atom index i.
*/
gmx::ArrayRef<const int> dd_constraints_nlocalatoms(const gmx_domdec_t* dd);
-/* In domdec_top.c */
+/*! Const getter for the local topology checker
+ *
+ * \returns Const handle to local topology checker */
+const gmx::LocalTopologyChecker& dd_localTopologyChecker(const gmx_domdec_t& dd);
+
+/*! Getter for the local topology checker
+ *
+ * \returns Handle to local topology checker */
+gmx::LocalTopologyChecker* dd_localTopologyChecker(gmx_domdec_t* dd);
/*! \brief Construct local state */
void dd_init_local_state(const gmx_domdec_t& dd, const t_state* state_global, t_state* local_state);
template<typename T>
class HashedMap;
class LocalAtomSetManager;
-struct LocalTopologyChecker;
+class LocalTopologyChecker;
class GpuHaloExchange;
} // namespace gmx
#include "gmxpre.h"
+#include "gromacs/domdec/localtopologychecker.h"
+
+#include <optional>
#include <string>
#include <vector>
-#include "gromacs/domdec/localtopologychecker.h"
-
#include "gromacs/domdec/domdec_internal.h"
#include "gromacs/domdec/reversetopology.h"
#include "gromacs/gmxlib/network.h"
#include "dump.h"
-using gmx::ArrayRef;
-using gmx::RVec;
+namespace gmx
+{
/*! \brief Checks whether interactions have been assigned for one function type
*
static void flagInteractionsForType(const int ftype,
const InteractionList& il,
const reverse_ilist_t& ril,
- const gmx::Range<int>& atomRange,
+ const Range<int>& atomRange,
const int numAtomsPerMolecule,
ArrayRef<const int> globalAtomIndices,
ArrayRef<int> isAssigned)
*
* \note This function needs to be called on all ranks (contains a global summation)
*/
-static std::string printMissingInteractionsMolblock(t_commrec* cr,
+static std::string printMissingInteractionsMolblock(const t_commrec* cr,
const gmx_reverse_top_t& rt,
const char* moltypename,
const reverse_ilist_t& ril,
- const gmx::Range<int>& atomRange,
+ const Range<int>& atomRange,
const int numAtomsPerMolecule,
const int numMolecules,
const InteractionDefinitions& idef)
{
- const int nril_mol = ril.index[numAtomsPerMolecule];
- std::vector<int> isAssigned(numMolecules * nril_mol, 0);
- gmx::StringOutputStream stream;
- gmx::TextWriter log(&stream);
+ const int nril_mol = ril.index[numAtomsPerMolecule];
+ std::vector<int> isAssigned(numMolecules * nril_mol, 0);
+ StringOutputStream stream;
+ TextWriter log(&stream);
for (int ftype = 0; ftype < F_NRE; ftype++)
{
}
/*! \brief Help print error output when interactions are missing */
-static void printMissingInteractionsAtoms(const gmx::MDLogger& mdlog,
- t_commrec* cr,
+static void printMissingInteractionsAtoms(const MDLogger& mdlog,
+ const t_commrec* cr,
const gmx_mtop_t& mtop,
const InteractionDefinitions& idef)
{
const gmx_moltype_t& moltype = mtop.moltype[molb.type];
const int a_start = a_end;
a_end = a_start + molb.nmol * moltype.atoms.nr;
- const gmx::Range<int> atomRange(a_start, a_end);
+ const Range<int> atomRange(a_start, a_end);
auto warning = printMissingInteractionsMolblock(
cr,
}
/*! \brief Print error output when interactions are missing */
-[[noreturn]] static void dd_print_missing_interactions(const gmx::MDLogger& mdlog,
- t_commrec* cr,
+[[noreturn]] static void dd_print_missing_interactions(const MDLogger& mdlog,
+ const t_commrec* cr,
const int numBondedInteractionsOverAllDomains,
const int expectedNumGlobalBondedInteractions,
const gmx_mtop_t& top_global,
}
else
{
- errorMessage = gmx::formatString(
+ errorMessage = formatString(
"%d of the %d bonded interactions could not be calculated because some atoms "
"involved moved further apart than the multi-body cut-off distance (%g nm) or the "
"two-body cut-off distance (%g nm), see option -rdd, for pairs and tabulated bonds "
gmx_fatal_collective(FARGS, cr->mpi_comm_mygroup, MASTER(cr), "%s", errorMessage.c_str());
}
-namespace gmx
+/*! \brief Data to help check local topology construction
+ *
+ * Partitioning could incorrectly miss a bonded interaction.
+ * However, checking for that requires a global communication
+ * stage, which does not otherwise happen during partitioning. So,
+ * for performance, we do that alongside the first global energy
+ * reduction after a new DD is made. These variables handle
+ * whether the check happens, its input for this domain, output
+ * across all domains, and the expected value it should match. */
+class LocalTopologyChecker::Impl
{
+public:
+ //! Constructor
+ Impl(const MDLogger& mdlog, const t_commrec* cr, const gmx_mtop_t& mtop, bool useUpdateGroups);
+
+ //! Objects used when reporting that interactions are missing
+ //! {
+ //! Logger
+ const MDLogger& mdlog_;
+ //! Communication record
+ const t_commrec* cr_;
+ //! Global system topology
+ const gmx_mtop_t& mtop_;
+ //! }
+
+ /*! \brief Number of bonded interactions found in the local
+ * topology for this domain. */
+ int numBondedInteractionsToReduce_ = 0;
+ /*! \brief Whether to check at the next global communication
+ * stage the total number of bonded interactions found.
+ *
+ * Cleared after that number is found. */
+ bool shouldCheckNumberOfBondedInteractions_ = false;
+ /*! \brief The total number of bonded interactions found in
+ * the local topology across all domains.
+ *
+ * Only has a value after reduction across all ranks, which is
+ * removed when it is again time to check after a new
+ * partition. */
+ std::optional<int> numBondedInteractionsOverAllDomains_;
+ //! The number of bonded interactions computed from the full system topology
+ int expectedNumGlobalBondedInteractions_ = 0;
+};
+
/*! \brief Compute the total bonded interaction count
*
return expectedNumGlobalBondedInteractions;
}
-LocalTopologyChecker::LocalTopologyChecker(const gmx_mtop_t& mtop, const bool useUpdateGroups) :
- expectedNumGlobalBondedInteractions(computeExpectedNumGlobalBondedInteractions(mtop, useUpdateGroups))
+LocalTopologyChecker::Impl::Impl(const MDLogger& mdlog,
+ const t_commrec* cr,
+ const gmx_mtop_t& mtop,
+ const bool useUpdateGroups) :
+ mdlog_(mdlog),
+ cr_(cr),
+ mtop_(mtop),
+ expectedNumGlobalBondedInteractions_(computeExpectedNumGlobalBondedInteractions(mtop, useUpdateGroups))
{
}
-} // namespace gmx
+LocalTopologyChecker::LocalTopologyChecker(const MDLogger& mdlog,
+ const t_commrec* cr,
+ const gmx_mtop_t& mtop,
+ const bool useUpdateGroups) :
+ impl_(std::make_unique<Impl>(mdlog, cr, mtop, useUpdateGroups))
+{
+}
+
+LocalTopologyChecker::~LocalTopologyChecker() = default;
-void scheduleCheckOfLocalTopology(gmx_domdec_t* dd, const int numBondedInteractionsToReduce)
+LocalTopologyChecker::LocalTopologyChecker(LocalTopologyChecker&&) noexcept = default;
+
+LocalTopologyChecker& LocalTopologyChecker::operator=(LocalTopologyChecker&& other) noexcept
{
- dd->localTopologyChecker->numBondedInteractionsToReduce = numBondedInteractionsToReduce;
+ impl_ = std::move(other.impl_);
+ return *this;
+}
+
+void LocalTopologyChecker::scheduleCheckOfLocalTopology(const int numBondedInteractionsToReduce)
+{
+ impl_->numBondedInteractionsToReduce_ = numBondedInteractionsToReduce;
// Note that it's possible for this to still be true from the last
// time it was set, e.g. if repartitioning was triggered before
// global communication that would have acted on the true
// value. This could happen for example when replica exchange took
// place soon after a partition.
- dd->localTopologyChecker->shouldCheckNumberOfBondedInteractions = true;
+ impl_->shouldCheckNumberOfBondedInteractions_ = true;
// Clear the old global value, which is now invalid
- dd->localTopologyChecker->numBondedInteractionsOverAllDomains.reset();
+ impl_->numBondedInteractionsOverAllDomains_.reset();
}
-bool shouldCheckNumberOfBondedInteractions(const gmx_domdec_t& dd)
+bool LocalTopologyChecker::shouldCheckNumberOfBondedInteractions() const
{
- return dd.localTopologyChecker->shouldCheckNumberOfBondedInteractions;
+ return impl_->shouldCheckNumberOfBondedInteractions_;
}
-int numBondedInteractions(const gmx_domdec_t& dd)
+int LocalTopologyChecker::numBondedInteractions() const
{
- return dd.localTopologyChecker->numBondedInteractionsToReduce;
+ return impl_->numBondedInteractionsToReduce_;
}
-void setNumberOfBondedInteractionsOverAllDomains(gmx_domdec_t* dd, int newValue)
+void LocalTopologyChecker::setNumberOfBondedInteractionsOverAllDomains(const int newValue)
{
- GMX_RELEASE_ASSERT(!dd->localTopologyChecker->numBondedInteractionsOverAllDomains.has_value(),
+ GMX_RELEASE_ASSERT(!impl_->numBondedInteractionsOverAllDomains_.has_value(),
"Cannot set number of bonded interactions because it is already set");
- dd->localTopologyChecker->numBondedInteractionsOverAllDomains.emplace(newValue);
+ impl_->numBondedInteractionsOverAllDomains_.emplace(newValue);
}
-void checkNumberOfBondedInteractions(const gmx::MDLogger& mdlog,
- t_commrec* cr,
- const gmx_mtop_t& top_global,
- const gmx_localtop_t* top_local,
- ArrayRef<const RVec> x,
- const matrix box)
+void LocalTopologyChecker::checkNumberOfBondedInteractions(const gmx_localtop_t* top_local,
+ ArrayRef<const RVec> x,
+ const matrix box)
{
- GMX_RELEASE_ASSERT(
- DOMAINDECOMP(cr),
- "No need to check number of bonded interactions when not using domain decomposition");
- if (cr->dd->localTopologyChecker->shouldCheckNumberOfBondedInteractions)
+ if (impl_->shouldCheckNumberOfBondedInteractions_)
{
- GMX_RELEASE_ASSERT(cr->dd->localTopologyChecker->numBondedInteractionsOverAllDomains.has_value(),
+ GMX_RELEASE_ASSERT(impl_->numBondedInteractionsOverAllDomains_.has_value(),
"The check for the total number of bonded interactions requires the "
"value to have been reduced across all domains");
- if (cr->dd->localTopologyChecker->numBondedInteractionsOverAllDomains.value()
- != cr->dd->localTopologyChecker->expectedNumGlobalBondedInteractions)
+ if (impl_->numBondedInteractionsOverAllDomains_.value() != impl_->expectedNumGlobalBondedInteractions_)
{
- dd_print_missing_interactions(
- mdlog,
- cr,
- cr->dd->localTopologyChecker->numBondedInteractionsOverAllDomains.value(),
- cr->dd->localTopologyChecker->expectedNumGlobalBondedInteractions,
- top_global,
- top_local,
- x,
- box); // Does not return
+ dd_print_missing_interactions(impl_->mdlog_,
+ impl_->cr_,
+ impl_->numBondedInteractionsOverAllDomains_.value(),
+ impl_->expectedNumGlobalBondedInteractions_,
+ impl_->mtop_,
+ top_local,
+ x,
+ box); // Does not return
}
// Now that the value is set and the check complete, future
// global communication should not compute the value until
// after the next partitioning.
- cr->dd->localTopologyChecker->shouldCheckNumberOfBondedInteractions = false;
+ impl_->shouldCheckNumberOfBondedInteractions_ = false;
}
}
+
+} // namespace gmx
#ifndef GMX_DOMDEC_LOCALTOPOLOGYCHECKER_H
#define GMX_DOMDEC_LOCALTOPOLOGYCHECKER_H
-#include <optional>
+#include <memory>
#include "gromacs/math/vectypes.h"
-struct gmx_domdec_t;
struct gmx_localtop_t;
struct gmx_mtop_t;
struct t_commrec;
class MDLogger;
template<typename>
class ArrayRef;
-enum class DDBondedChecking : bool;
} // namespace gmx
namespace gmx
{
-struct LocalTopologyChecker
+/*! \brief Has responsibility for checking that the local topology
+ * distributed across domains describes a total number of bonded
+ * interactions that matches the system topology
+ *
+ * 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.
+ */
+class LocalTopologyChecker
{
public:
- //! Constructor
- LocalTopologyChecker(const gmx_mtop_t& mtop, bool useUpdateGroups);
- /*! \brief Data to help check local topology construction
- *
- * Partitioning could incorrectly miss a bonded interaction.
- * However, checking for that requires a global communication
- * stage, which does not otherwise happen during partitioning. So,
- * for performance, we do that alongside the first global energy
- * reduction after a new DD is made. These variables handle
- * whether the check happens, its input for this domain, output
- * across all domains, and the expected value it should match. */
- /*! \{ */
- /*! \brief Number of bonded interactions found in the local
- * topology for this domain. */
- int numBondedInteractionsToReduce = 0;
- /*! \brief Whether to check at the next global communication
- * stage the total number of bonded interactions found.
- *
- * Cleared after that number is found. */
- bool shouldCheckNumberOfBondedInteractions = false;
- /*! \brief The total number of bonded interactions found in
- * the local topology across all domains.
- *
- * Only has a value after reduction across all ranks, which is
- * removed when it is again time to check after a new
- * partition. */
- std::optional<int> numBondedInteractionsOverAllDomains;
- //! The number of bonded interactions computed from the full system topology
- int expectedNumGlobalBondedInteractions = 0;
- /*! \} */
-};
+ /*! \brief Constructor
+ * \param[in] mdlog Logger
+ * \param[in] cr Communication object
+ * \param[in] mtop Global system topology
+ * \param[in] useUpdateGroups Whether update groups are in use
+ */
+ LocalTopologyChecker(const MDLogger& mdlog, const t_commrec* cr, const gmx_mtop_t& mtop, bool useUpdateGroups);
+ //! Destructor
+ ~LocalTopologyChecker();
+ //! Move constructor
+ LocalTopologyChecker(LocalTopologyChecker&& other) noexcept;
+ //! Move assignment
+ LocalTopologyChecker& operator=(LocalTopologyChecker&& other) noexcept;
-} // namespace gmx
+ /*! \brief Set that the local topology should be checked via
+ * observables reduction whenever that reduction is required by
+ * another module. */
+ void scheduleCheckOfLocalTopology(int numBondedInteractionsToReduce);
-//! Set that the local topology should be checked via observables reduction
-void scheduleCheckOfLocalTopology(gmx_domdec_t* dd, int numBondedInteractionsToReduce);
+ /*! \brief Return whether the total bonded interaction count across
+ * domains should be checked in observables reduction this step. */
+ bool shouldCheckNumberOfBondedInteractions() const;
-/*! \brief Return whether the total bonded interaction count across
- * domains should be checked in observables reduction. */
-bool shouldCheckNumberOfBondedInteractions(const gmx_domdec_t& dd);
+ //! Return the number of bonded interactions in this domain.
+ int numBondedInteractions() const;
-//! Return the number of bonded interactions in this domain.
-int numBondedInteractions(const gmx_domdec_t& dd);
+ /*! \brief Set total bonded interaction count across domains. */
+ void setNumberOfBondedInteractionsOverAllDomains(int newValue);
-/*! \brief Set total bonded interaction count across domains. */
-void setNumberOfBondedInteractionsOverAllDomains(gmx_domdec_t* dd, int newValue);
+ /*! \brief Check whether bonded interactions are missing from the reverse topology
+ * produced by domain decomposition.
+ *
+ * \param[in] top_local Local topology for the error message
+ * \param[in] x Position vector for the error message
+ * \param[in] box Box matrix for the error message
+ */
+ void checkNumberOfBondedInteractions(const gmx_localtop_t* top_local,
+ ArrayRef<const RVec> x,
+ const matrix box);
-/*! \brief Check whether bonded interactions are missing from the reverse topology
- * produced by domain decomposition.
- *
- * Must only be called when DD is active.
- *
- * \param[in] mdlog Logger
- * \param[in] cr Communication object
- * \param[in] top_global Global topology for the error message
- * \param[in] top_local Local topology for the error message
- * \param[in] x Position vector for the error message
- * \param[in] box Box matrix for the error message
- */
-void checkNumberOfBondedInteractions(const gmx::MDLogger& mdlog,
- t_commrec* cr,
- const gmx_mtop_t& top_global,
- const gmx_localtop_t* top_local,
- gmx::ArrayRef<const gmx::RVec> x,
- const matrix box);
+private:
+ class Impl;
+ std::unique_ptr<Impl> impl_;
+};
+} // namespace gmx
#endif
state_local->x,
top_global,
top_local);
- scheduleCheckOfLocalTopology(dd, numBondedInteractionsToReduce);
+ dd->localTopologyChecker->scheduleCheckOfLocalTopology(numBondedInteractionsToReduce);
wallcycle_sub_stop(wcycle, WallCycleSubCounter::DDMakeTop);
GMX_RELEASE_ASSERT(DOMAINDECOMP(cr),
"No need to check number of bonded interactions when not using domain "
"decomposition");
- nb = numBondedInteractions(*cr->dd);
+ nb = cr->dd->localTopologyChecker->numBondedInteractions();
inb = add_bind(rb, 1, &nb);
}
if (!sig.empty())
GMX_RELEASE_ASSERT(DOMAINDECOMP(cr),
"No need to check number of bonded interactions when not using domain "
"decomposition");
- setNumberOfBondedInteractionsOverAllDomains(cr->dd, gmx::roundToInt(nb));
+ cr->dd->localTopologyChecker->setNumberOfBondedInteractionsOverAllDomains(gmx::roundToInt(nb));
}
if (!sig.empty())
const t_fcdata& fcdata,
t_extmass* MassQ,
t_vcm* vcm,
- const gmx_mtop_t& top_global,
const gmx_localtop_t& top,
gmx_enerdata_t* enerd,
gmx_ekindata_t* ekind,
gmx::SimulationSignaller* nullSignaller,
gmx::EnumerationArray<TrotterSequence, std::vector<int>> trotter_seq,
t_nrnb* nrnb,
- const gmx::MDLogger& mdlog,
FILE* fplog,
gmx_wallcycle* wcycle)
{
((bGStat ? CGLO_GSTAT : 0) | (bCalcEner ? CGLO_ENERGY : 0)
| (bTemp ? CGLO_TEMPERATURE : 0) | (bPres ? CGLO_PRESSURE : 0)
| (bPres ? CGLO_CONSTRAINT : 0) | (bStopCM ? CGLO_STOPCM : 0) | CGLO_SCALEEKIN);
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd))
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
{
cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
EkinAveVel because it's needed for the pressure */
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
if (bStopCM)
{
* \param[in] fcdata Force calculation data.
* \param[in] MassQ Mass/pressure data.
* \param[in] vcm Center of mass motion removal.
- * \param[in] top_global Global topology.
* \param[in] top Local topology.
* \param[in] enerd Energy data.
* \param[in] ekind Kinetic energy data.
* \param[in] nullSignaller Simulation signaller.
* \param[in] trotter_seq NPT variables.
* \param[in] nrnb Cycle counters.
- * \param[in] mdlog Logger.
* \param[in] fplog Another logger.
* \param[in] wcycle Wall-clock cycle counter.
*/
const t_fcdata& fcdata,
t_extmass* MassQ,
t_vcm* vcm,
- const gmx_mtop_t& top_global,
const gmx_localtop_t& top,
gmx_enerdata_t* enerd,
gmx_ekindata_t* ekind,
gmx::SimulationSignaller* nullSignaller,
gmx::EnumerationArray<TrotterSequence, std::vector<int>> trotter_seq,
t_nrnb* nrnb,
- const gmx::MDLogger& mdlog,
FILE* fplog,
gmx_wallcycle* wcycle);
cglo_flags_iteration |= CGLO_STOPCM;
cglo_flags_iteration &= ~CGLO_TEMPERATURE;
}
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd) && cgloIteration == 0)
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions()
+ && cgloIteration == 0)
{
cglo_flags_iteration |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
}
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
if (ir->eI == IntegrationAlgorithm::VVAK)
{
* the full step kinetic energy and possibly for T-coupling.*/
/* This may not be quite working correctly yet . . . . */
int cglo_flags = CGLO_GSTAT | CGLO_TEMPERATURE;
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd))
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
{
cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
cglo_flags);
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
}
clear_mat(force_vir);
fcdata,
&MassQ,
&vcm,
- top_global,
top,
enerd,
ekind,
&nullSignaller,
trotter_seq,
nrnb,
- mdlog,
fplog,
wcycle);
if (vsite != nullptr && needVirtualVelocitiesThisStep)
| (!EI_VV(ir->eI) && bStopCM ? CGLO_STOPCM : 0)
| (!EI_VV(ir->eI) ? CGLO_TEMPERATURE : 0)
| (!EI_VV(ir->eI) ? CGLO_PRESSURE : 0) | CGLO_CONSTRAINT
- | (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd)
+ | (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions()
? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS
: 0));
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
if (!EI_VV(ir->eI) && bStopCM)
{
{
int cglo_flags = CGLO_GSTAT;
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd))
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
{
cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
cglo_flags);
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
}
SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
int cglo_flags = CGLO_GSTAT | CGLO_ENERGY;
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd))
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
{
cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
cglo_flags);
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
}
{
int cglo_flags = CGLO_GSTAT;
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd))
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
{
cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
cglo_flags);
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
}
SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
int cglo_flags = CGLO_GSTAT | CGLO_ENERGY;
- if (DOMAINDECOMP(cr) && shouldCheckNumberOfBondedInteractions(*cr->dd))
+ if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
{
cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
cglo_flags);
if (DOMAINDECOMP(cr))
{
- checkNumberOfBondedInteractions(
- mdlog, cr, top_global, &top, makeConstArrayRef(state->x), state->box);
+ dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
+ &top, makeConstArrayRef(state->x), state->box);
}
}
const auto* lastbox = useLastBox ? statePropagatorData_->constPreviousBox()
: statePropagatorData_->constBox();
- if (DOMAINDECOMP(cr_) && shouldCheckNumberOfBondedInteractions(*cr_->dd))
+ if (DOMAINDECOMP(cr_) && dd_localTopologyChecker(*cr_->dd).shouldCheckNumberOfBondedInteractions())
{
flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
}
flags);
if (DOMAINDECOMP(cr_))
{
- checkNumberOfBondedInteractions(mdlog_, cr_, top_global_, localTopology_, x, box);
+ dd_localTopologyChecker(cr_->dd)->checkNumberOfBondedInteractions(localTopology_, x, box);
}
if (flags & CGLO_STOPCM && !isInit)
{