auto* nonConstInputrec = const_cast<t_inputrec*>(inputrec);
nonConstInputrec->nsteps = MimicCommunicator::getStepNumber();
}
- if (DOMAINDECOMP(cr))
+ if (haveDDAtomOrdering(*cr))
{
// TODO: Avoid changing inputrec (#3854)
auto* nonConstInputrec = const_cast<t_inputrec*>(inputrec);
top_global,
constr ? constr->numFlexibleConstraints() : 0,
ir->nstcalcenergy,
- DOMAINDECOMP(cr),
+ haveDDAtomOrdering(*cr),
runScheduleWork->simulationWork.useGpuPme);
{
}
}
- // Local state only becomes valid now.
- std::unique_ptr<t_state> stateInstance;
- t_state* state;
-
- gmx_localtop_t top(top_global.ffparams);
-
- if (DOMAINDECOMP(cr))
+ if (haveDDAtomOrdering(*cr))
{
- stateInstance = std::make_unique<t_state>();
- state = stateInstance.get();
+ // Local state only becomes valid now.
dd_init_local_state(*cr->dd, state_global, state);
/* Distribute the charge groups over the nodes from the master node */
state,
&f,
mdAtoms,
- &top,
+ top,
fr,
vsite,
constr,
else
{
state_change_natoms(state_global, state_global->natoms);
- /* Copy the pointer to the global state */
- state = state_global;
-
- mdAlgorithmsSetupAtomData(cr, *ir, top_global, &top, fr, &f, mdAtoms, constr, vsite, shellfc);
+ mdAlgorithmsSetupAtomData(cr, *ir, top_global, top, fr, &f, mdAtoms, constr, vsite, shellfc);
}
auto* mdatoms = mdAtoms->mdatoms();
int64_t step_rel = 0;
{
- int cglo_flags = CGLO_GSTAT;
- if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
- {
- cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
- }
+ int cglo_flags = CGLO_GSTAT;
bool bSumEkinhOld = false;
t_vcm* vcm = nullptr;
compute_globals(gstat,
shake_vir,
total_vir,
pres,
- gmx::ArrayRef<real>{},
&nullSignaller,
state->box,
&bSumEkinhOld,
cglo_flags,
step,
&observablesReducer);
- if (DOMAINDECOMP(cr))
- {
- dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
- &top, makeConstArrayRef(state->x), state->box);
- }
+ // Clean up after pre-step use of compute_globals()
+ observablesReducer.markAsReadyToReduce();
}
if (MASTER(cr))
if (MASTER(cr))
{
const bool constructVsites = ((vsite != nullptr) && mdrunOptions.rerunConstructVsites);
- if (constructVsites && DOMAINDECOMP(cr))
+ if (constructVsites && haveDDAtomOrdering(*cr))
{
gmx_fatal(FARGS,
"Vsite recalculation with -rerun is not implemented with domain "
}
}
- if (DOMAINDECOMP(cr))
+ if (haveDDAtomOrdering(*cr))
{
/* Repartition the domain decomposition */
const bool bMasterState = true;
state,
&f,
mdAtoms,
- &top,
+ top,
fr,
vsite,
constr,
pull_work,
bNS,
force_flags,
- &top,
+ top,
constr,
enerd,
state->natoms,
step,
nrnb,
wcycle,
- &top,
+ top,
state->box,
state->x.arrayRefWithPadding(),
&state->hist,
SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
int cglo_flags = CGLO_GSTAT | CGLO_ENERGY;
- if (DOMAINDECOMP(cr) && dd_localTopologyChecker(*cr->dd).shouldCheckNumberOfBondedInteractions())
- {
- cglo_flags |= CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
- }
compute_globals(gstat,
cr,
ir,
nullptr,
nullptr,
nullptr,
- constr != nullptr ? constr->rmsdData() : gmx::ArrayRef<real>{},
&signaller,
state->box,
&bSumEkinhOld,
cglo_flags,
step,
&observablesReducer);
- if (DOMAINDECOMP(cr))
- {
- dd_localTopologyChecker(cr->dd)->checkNumberOfBondedInteractions(
- &top, makeConstArrayRef(state->x), state->box);
- }
}
{
gmx::HostVector<gmx::RVec> fglobal(top_global.natoms);
gmx::ArrayRef<gmx::RVec> ftemp;
gmx::ArrayRef<const gmx::RVec> flocal = f.view().force();
- if (DOMAINDECOMP(cr))
+ if (haveDDAtomOrdering(*cr))
{
ftemp = gmx::makeArrayRef(fglobal);
dd_collect_vec(cr->dd, state->ddp_count, state->ddp_count_cg_gl, state->cg_gl, flocal, ftemp);
mdatoms->tmass,
enerd,
ir->fepvals.get(),
- ir->expandedvals.get(),
state->box,
PTCouplingArrays({ state->boxv,
state->nosehoover_xi,
}
cycles = wallcycle_stop(wcycle, WallCycleCounter::Step);
- if (DOMAINDECOMP(cr) && wcycle)
+ if (haveDDAtomOrdering(*cr) && wcycle)
{
dd_cycles_add(cr->dd, cycles, ddCyclStep);
}
/* increase the MD step number */
step++;
step_rel++;
+ observablesReducer.markAsReadyToReduce();
}
/* End of main MD loop */