how-to/visualize.rst
install-guide/index.rst
release-notes/index.rst
+ release-notes/2022/major/highlights.rst
+ release-notes/2022/major/features.rst
+ release-notes/2022/major/performance.rst
+ release-notes/2022/major/tools.rst
+ release-notes/2022/major/bugs-fixed.rst
+ release-notes/2022/major/removed-functionality.rst
+ release-notes/2022/major/deprecated-functionality.rst
+ release-notes/2022/major/portability.rst
+ release-notes/2022/major/miscellaneous.rst
+ release-notes/2022/major/api.rst
+ release-notes/2021/2021.4.rst
release-notes/2021/2021.3.rst
release-notes/2021/2021.2.rst
release-notes/2021/2021.1.rst
}
else
{
- if (cr->dd->comm->ddRankSetup.usePmeOnlyRanks)
+ const DDRankSetup& rankSetup = cr->dd->comm->ddRankSetup;
+ if (rankSetup.rankOrder != DdRankOrder::pp_pme && rankSetup.usePmeOnlyRanks)
{
- nodeid = ddindex + gmx_ddcoord2pmeindex(cr, x, y, z);
+ nodeid = ddindex + gmx_ddcoord2pmeindex(*cr->dd, x, y, z);
}
else
{
cr_->npmenodes = ddGridSetup_.numPmeOnlyRanks;
- ddRankSetup_ = getDDRankSetup(mdlog_, cr_->sizeOfDefaultCommunicator, ddGridSetup_, ir_);
- ddRankSetup_ = getDDRankSetup(mdlog_, cr_->sizeOfDefaultCommunicator, options_.rankOrder,
- ddGridSetup_, ir_);
++ ddRankSetup_ = getDDRankSetup(
++ mdlog_, cr_->sizeOfDefaultCommunicator, options_.rankOrder, ddGridSetup_, ir_);
/* Generate the group communicator, also decides the duty of each rank */
- cartSetup_ = makeGroupCommunicators(mdlog_, ddSettings_, ddRankSetup_, cr_, ddCellIndex_, &pmeRanks_);
+ cartSetup_ = makeGroupCommunicators(
+ mdlog_, ddSettings_, options_.rankOrder, ddRankSetup_, cr_, ddCellIndex_, &pmeRanks_);
}
gmx_domdec_t* DomainDecompositionBuilder::Impl::build(LocalAtomSetManager* atomSets)
}
}
- const auto& updateGrouping = dd.comm->systemInfo.updateGroupingPerMoleculetype[molblock.type];
+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;
+
+ if (DDMASTER(dd))
+ {
+ buf[0] = state_global->flags;
+ buf[1] = state_global->ngtc;
+ buf[2] = state_global->nnhpres;
+ buf[3] = state_global->nhchainlength;
+ buf[4] = state_global->dfhist ? state_global->dfhist->nlambda : 0;
+ }
+ dd_bcast(&dd, buf.size() * sizeof(int), buf.data());
+
+ init_gtc_state(state_local, buf[1], buf[2], buf[3]);
+ init_dfhist_state(state_local, buf[4]);
+ state_local->flags = buf[0];
+}
++
+ void putUpdateGroupAtomsInSamePeriodicImage(const gmx_domdec_t& dd,
+ const gmx_mtop_t& mtop,
+ const matrix box,
+ gmx::ArrayRef<gmx::RVec> positions)
+ {
+ int atomOffset = 0;
+ for (const gmx_molblock_t& molblock : mtop.molblock)
+ {
++ const auto& updateGrouping = dd.comm->systemInfo.updateGroupingsPerMoleculeType[molblock.type];
+
+ for (int mol = 0; mol < molblock.nmol; mol++)
+ {
+ for (int g = 0; g < updateGrouping.numBlocks(); g++)
+ {
+ const auto& block = updateGrouping.block(g);
+ const int atomBegin = atomOffset + block.begin();
+ const int atomEnd = atomOffset + block.end();
+ for (int a = atomBegin + 1; a < atomEnd; a++)
+ {
+ // Make sure that atoms in the same update group
+ // are in the same periodic image after restarts.
+ for (int d = DIM - 1; d >= 0; d--)
+ {
+ while (positions[a][d] - positions[atomBegin][d] > 0.5_real * box[d][d])
+ {
+ positions[a] -= box[d];
+ }
+ while (positions[a][d] - positions[atomBegin][d] < -0.5_real * box[d][d])
+ {
+ positions[a] += box[d];
+ }
+ }
+ }
+ }
+ atomOffset += updateGrouping.fullRange().end();
+ }
+ }
+ }
}
mk_chi_lookup(chi_lookup, maxchi, nlist, dlist);
- get_chi_product_traj(dih, nf, nlist, maxchi, dlist, time, chi_lookup, multiplicity, FALSE,
- bNormHisto, core_frac, bAll, opt2fn("-cp", NFILE, fnm), oenv);
+ get_chi_product_traj(dih,
+ nf,
- nactdih,
++ nlist,
+ maxchi,
+ dlist,
+ time,
+ chi_lookup,
+ multiplicity,
+ FALSE,
+ bNormHisto,
+ core_frac,
+ bAll,
+ opt2fn("-cp", NFILE, fnm),
+ oenv);
for (i = 0; i < nlist; i++)
{
ddBuilder.reset(nullptr);
// Note that local state still does not exist yet.
}
+ // Ensure that all atoms within the same update group are in the
+ // same periodic image. Otherwise, a simulation that did not use
+ // update groups (e.g. a single-rank simulation) cannot always be
+ // correctly restarted in a way that does use update groups
+ // (e.g. a multi-rank simulation).
+ if (isSimulationMasterRank)
+ {
+ const bool useUpdateGroups = cr->dd ? ddUsesUpdateGroups(*cr->dd) : false;
+ if (useUpdateGroups)
+ {
+ putUpdateGroupAtomsInSamePeriodicImage(*cr->dd, mtop, globalState->box, globalState->x);
+ }
+ }
// The GPU update is decided here because we need to know whether the constraints or
- // SETTLEs can span accross the domain borders (i.e. whether or not update groups are
+ // SETTLEs can span across the domain borders (i.e. whether or not update groups are
// defined). This is only known after DD is initialized, hence decision on using GPU
// update is done so late.
try