return slb_frac;
}
-static int multi_body_bondeds_count(const gmx_mtop_t* mtop)
+static int multi_body_bondeds_count(const gmx_mtop_t& mtop)
{
int n = 0;
gmx_mtop_ilistloop_t iloop = gmx_mtop_ilistloop_init(mtop);
return nst;
}
-static void check_dd_restrictions(const gmx_domdec_t* dd, const t_inputrec* ir, const gmx::MDLogger& mdlog)
+static void check_dd_restrictions(const gmx_domdec_t* dd, const t_inputrec& inputrec, const gmx::MDLogger& mdlog)
{
- if (ir->pbcType == PbcType::Screw
+ if (inputrec.pbcType == PbcType::Screw
&& (dd->numCells[XX] == 1 || dd->numCells[YY] > 1 || dd->numCells[ZZ] > 1))
{
gmx_fatal(FARGS,
"With pbc=%s can only do domain decomposition in the x-direction",
- c_pbcTypeNames[ir->pbcType].c_str());
+ c_pbcTypeNames[inputrec.pbcType].c_str());
}
- if (ir->nstlist == 0)
+ if (inputrec.nstlist == 0)
{
gmx_fatal(FARGS, "Domain decomposition does not work with nstlist=0");
}
- if (ir->comm_mode == ComRemovalAlgorithm::Angular && ir->pbcType != PbcType::No)
+ if (inputrec.comm_mode == ComRemovalAlgorithm::Angular && inputrec.pbcType != PbcType::No)
{
GMX_LOG(mdlog.warning)
.appendText(
* \param [in] dlbOption Enum value for the DLB option.
* \param [in] bRecordLoad True if the load balancer is recording load information.
* \param [in] mdrunOptions Options for mdrun.
- * \param [in] ir Pointer mdrun to input parameters.
+ * \param [in] inputrec Pointer mdrun to input parameters.
* \returns DLB initial/startup state.
*/
static DlbState determineInitialDlbState(const gmx::MDLogger& mdlog,
DlbOption dlbOption,
gmx_bool bRecordLoad,
const gmx::MdrunOptions& mdrunOptions,
- const t_inputrec* ir)
+ const t_inputrec& inputrec)
{
DlbState dlbState = DlbState::offCanTurnOn;
}
/* Unsupported integrators */
- if (!EI_DYNAMICS(ir->eI))
+ if (!EI_DYNAMICS(inputrec.eI))
{
auto reasonStr =
gmx::formatString("it is only supported with dynamics, not with integrator '%s'.",
- enumValueToString(ir->eI));
+ enumValueToString(inputrec.eI));
return forceDlbOffOrBail(dlbState, reasonStr, mdlog);
}
systemInfo.haveInterDomainBondeds =
(!systemInfo.moleculesAreAlwaysWhole || mtop.bIntermolecularInteractions);
systemInfo.haveInterDomainMultiBodyBondeds =
- (systemInfo.haveInterDomainBondeds && multi_body_bondeds_count(&mtop) > 0);
+ (systemInfo.haveInterDomainBondeds && multi_body_bondeds_count(mtop) > 0);
if (systemInfo.useUpdateGroups)
{
? DDBondedChecking::All
: DDBondedChecking::ExcludeZeroLimit;
- dd_bonded_cg_distance(mdlog, &mtop, &ir, xGlobal, box, ddBondedChecking, &r_2b, &r_mb);
+ dd_bonded_cg_distance(mdlog, mtop, ir, xGlobal, box, ddBondedChecking, &r_2b, &r_mb);
}
gmx_bcast(sizeof(r_2b), &r_2b, communicator);
gmx_bcast(sizeof(r_mb), &r_mb, communicator);
const DDSystemInfo& systemInfo,
const DDGridSetup& ddGridSetup,
const int numPPRanks,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& ir,
const gmx_ddbox_t& ddbox)
{
gmx_domdec_comm_t* comm = dd->comm;
* but that is not yet available here. But this anyhow only
* affect performance up to the second dd_partition_system call.
*/
- const int homeAtomCountEstimate = mtop->natoms / numPPRanks;
+ const int homeAtomCountEstimate = mtop.natoms / numPPRanks;
comm->updateGroupsCog = std::make_unique<gmx::UpdateGroupsCog>(
- *mtop, systemInfo.updateGroupingPerMoleculetype, maxReferenceTemperature(*ir), homeAtomCountEstimate);
+ mtop, systemInfo.updateGroupingPerMoleculetype, maxReferenceTemperature(ir), homeAtomCountEstimate);
}
/* Set the DD setup given by ddGridSetup */
gmx_domdec_t* dd,
const gmx_mtop_t& mtop,
const gmx::VirtualSitesHandler* vsite,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
const DDBondedChecking ddBondedChecking,
gmx::ArrayRef<cginfo_mb_t> cginfo_mb)
{
- dd_make_reverse_top(fplog, dd, &mtop, vsite, ir, ddBondedChecking);
+ dd_make_reverse_top(fplog, dd, mtop, vsite, inputrec, ddBondedChecking);
gmx_domdec_comm_t* comm = dd->comm;
static void writeSettings(gmx::TextWriter* log,
gmx_domdec_t* dd,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& ir,
gmx_bool bDynLoadBal,
real dlb_scale,
const gmx_ddbox_t* ddbox)
}
const bool haveInterDomainVsites =
- (countInterUpdategroupVsites(*mtop, comm->systemInfo.updateGroupingPerMoleculetype) != 0);
+ (countInterUpdategroupVsites(mtop, comm->systemInfo.updateGroupingPerMoleculetype) != 0);
if (comm->systemInfo.haveInterDomainBondeds || haveInterDomainVsites
|| comm->systemInfo.haveSplitConstraints || comm->systemInfo.haveSplitSettles)
if (comm->systemInfo.haveSplitConstraints || comm->systemInfo.haveSplitSettles)
{
std::string separation =
- gmx::formatString("atoms separated by up to %d constraints", 1 + ir->nProjOrder);
+ gmx::formatString("atoms separated by up to %d constraints", 1 + ir.nProjOrder);
log->writeLineFormatted("%40s %-7s %6.3f nm\n", separation.c_str(), "(-rcon)", limit);
}
log->ensureLineBreak();
static void logSettings(const gmx::MDLogger& mdlog,
gmx_domdec_t* dd,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& ir,
real dlb_scale,
const gmx_ddbox_t* ddbox)
{
static void set_cell_limits_dlb(const gmx::MDLogger& mdlog,
gmx_domdec_t* dd,
real dlb_scale,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
const gmx_ddbox_t* ddbox)
{
int npulse = 0;
gmx_domdec_comm_t* comm = dd->comm;
- bool bNoCutOff = (ir->rvdw == 0 || ir->rcoulomb == 0);
+ bool bNoCutOff = (inputrec.rvdw == 0 || inputrec.rcoulomb == 0);
/* Determine the maximum number of comm. pulses in one dimension */
}
comm->maxpulse = 1;
- comm->bVacDLBNoLimit = (ir->pbcType == PbcType::No);
+ comm->bVacDLBNoLimit = (inputrec.pbcType == PbcType::No);
for (int d = 0; d < dd->ndim; d++)
{
comm->cd[d].np_dlb = std::min(npulse, dd->numCells[dd->dim[d]] - 1);
static void set_ddgrid_parameters(const gmx::MDLogger& mdlog,
gmx_domdec_t* dd,
real dlb_scale,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& inputrec,
const gmx_ddbox_t* ddbox)
{
gmx_domdec_comm_t* comm = dd->comm;
DDRankSetup& ddRankSetup = comm->ddRankSetup;
- if (EEL_PME(ir->coulombtype) || EVDW_PME(ir->vdwtype))
+ if (EEL_PME(inputrec.coulombtype) || EVDW_PME(inputrec.vdwtype))
{
init_ddpme(dd, &ddRankSetup.ddpme[0], 0);
if (ddRankSetup.npmedecompdim >= 2)
}
if (!isDlbDisabled(comm))
{
- set_cell_limits_dlb(mdlog, dd, dlb_scale, ir, ddbox);
+ set_cell_limits_dlb(mdlog, dd, dlb_scale, inputrec, ddbox);
}
- logSettings(mdlog, dd, mtop, ir, dlb_scale, ddbox);
+ logSettings(mdlog, dd, mtop, inputrec, dlb_scale, ddbox);
- const real vol_frac = (ir->pbcType == PbcType::No)
+ const real vol_frac = (inputrec.pbcType == PbcType::No)
? (1 - 1 / static_cast<double>(dd->nnodes))
: ((1 + comm_box_frac(dd->numCells, comm->systemInfo.cutoff, *ddbox))
/ static_cast<double>(dd->nnodes));
{
fprintf(debug, "Volume fraction for all DD zones: %f\n", vol_frac);
}
- int natoms_tot = mtop->natoms;
+ int natoms_tot = mtop.natoms;
dd->ga2la = new gmx_ga2la_t(natoms_tot, static_cast<int>(vol_frac * natoms_tot));
}
ddSettings.recordLoad = (wallcycle_have_counter() && recload > 0);
}
- ddSettings.initialDlbState = determineInitialDlbState(
- mdlog, options.dlbOption, ddSettings.recordLoad, mdrunOptions, &ir);
+ ddSettings.initialDlbState =
+ determineInitialDlbState(mdlog, options.dlbOption, ddSettings.recordLoad, mdrunOptions, ir);
GMX_LOG(mdlog.info)
.appendTextFormatted("Dynamic load balancing: %s",
edlbs_names[static_cast<int>(ddSettings.initialDlbState)]);
systemInfo_,
ddGridSetup_,
ddRankSetup_.numPPRanks,
- &mtop_,
- &ir_,
+ mtop_,
+ ir_,
ddbox_);
setupGroupCommunication(mdlog_, ddSettings_, pmeRanks_, cr_, mtop_.natoms, dd);
if (thisRankHasDuty(cr_, DUTY_PP))
{
- set_ddgrid_parameters(mdlog_, dd, options_.dlbScaling, &mtop_, &ir_, &ddbox_);
+ set_ddgrid_parameters(mdlog_, dd, options_.dlbScaling, mtop_, ir_, &ddbox_);
setup_neighbor_relations(dd);
}
gmx_domdec_t* dd,
const gmx_mtop_t& mtop,
const gmx::VirtualSitesHandler* vsite,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
DDBondedChecking ddBondedChecking,
gmx::ArrayRef<cginfo_mb_t> cginfo_mb);
[[noreturn]] void dd_print_missing_interactions(const gmx::MDLogger& mdlog,
t_commrec* cr,
int local_count,
- const gmx_mtop_t* top_global,
+ const gmx_mtop_t& top_global,
const gmx_localtop_t* top_local,
gmx::ArrayRef<const gmx::RVec> x,
const matrix box);
/*! \brief Generate and store the reverse topology */
void dd_make_reverse_top(FILE* fplog,
gmx_domdec_t* dd,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const gmx::VirtualSitesHandler* vsite,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
DDBondedChecking ddBondedChecking);
/*! \brief Generate the local topology and virtual site data */
/*! \brief Calculate the maximum distance involved in 2-body and multi-body bonded interactions */
void dd_bonded_cg_distance(const gmx::MDLogger& mdlog,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& ir,
gmx::ArrayRef<const gmx::RVec> x,
const matrix box,
DDBondedChecking ddBondedChecking,
/*! \brief Looks up SETTLE constraints for a range of charge-groups */
static void atoms_to_settles(gmx_domdec_t* dd,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const int* cginfo,
gmx::ArrayRef<const std::vector<int>> at2settle_mt,
int cg_start,
{
int a_gl = dd->globalAtomIndices[a];
int a_mol = 0;
- mtopGetMolblockIndex(mtop, a_gl, &mb, nullptr, &a_mol);
+ mtopGetMolblockIndex(&mtop, a_gl, &mb, nullptr, &a_mol);
- const gmx_molblock_t* molb = &mtop->molblock[mb];
+ const gmx_molblock_t* molb = &mtop.molblock[mb];
int settle = at2settle_mt[molb->type][a_mol];
if (settle >= 0)
{
int offset = a_gl - a_mol;
- const int* ia1 = mtop->moltype[molb->type].ilist[F_SETTLE].iatoms.data();
+ const int* ia1 = mtop.moltype[molb->type].ilist[F_SETTLE].iatoms.data();
int a_gls[3];
gmx_bool bAssign = FALSE;
/*! \brief Looks up constraint for the local atoms */
static void atoms_to_constraints(gmx_domdec_t* dd,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const int* cginfo,
gmx::ArrayRef<const ListOfLists<int>> at2con_mt,
int nrec,
int a_gl = dd->globalAtomIndices[a];
int molnr = 0;
int a_mol = 0;
- mtopGetMolblockIndex(mtop, a_gl, &mb, &molnr, &a_mol);
+ mtopGetMolblockIndex(&mtop, a_gl, &mb, &molnr, &a_mol);
- const gmx_molblock_t& molb = mtop->molblock[mb];
+ const gmx_molblock_t& molb = mtop.molblock[mb];
- gmx::ArrayRef<const int> ia1 = mtop->moltype[molb.type].ilist[F_CONSTR].iatoms;
- gmx::ArrayRef<const int> ia2 = mtop->moltype[molb.type].ilist[F_CONSTRNC].iatoms;
+ gmx::ArrayRef<const int> ia1 = mtop.moltype[molb.type].ilist[F_CONSTR].iatoms;
+ gmx::ArrayRef<const int> ia2 = mtop.moltype[molb.type].ilist[F_CONSTRNC].iatoms;
/* Calculate the global constraint number offset for the molecule.
* This is only required for the global index to make sure
int dd_make_local_constraints(gmx_domdec_t* dd,
int at_start,
- const struct gmx_mtop_t* mtop,
+ const struct gmx_mtop_t& mtop,
const int* cginfo,
gmx::Constraints* constr,
int nrec,
return at_end;
}
-void init_domdec_constraints(gmx_domdec_t* dd, const gmx_mtop_t* mtop)
+void init_domdec_constraints(gmx_domdec_t* dd, const gmx_mtop_t& mtop)
{
if (debug)
{
dd->constraints = new gmx_domdec_constraints_t;
gmx_domdec_constraints_t* dc = dd->constraints;
- dc->molb_con_offset.resize(mtop->molblock.size());
- dc->molb_ncon_mol.resize(mtop->molblock.size());
+ dc->molb_con_offset.resize(mtop.molblock.size());
+ dc->molb_ncon_mol.resize(mtop.molblock.size());
int ncon = 0;
- for (size_t mb = 0; mb < mtop->molblock.size(); mb++)
+ for (size_t mb = 0; mb < mtop.molblock.size(); mb++)
{
- const gmx_molblock_t* molb = &mtop->molblock[mb];
+ const gmx_molblock_t* molb = &mtop.molblock[mb];
dc->molb_con_offset[mb] = ncon;
- dc->molb_ncon_mol[mb] = mtop->moltype[molb->type].ilist[F_CONSTR].size() / 3
- + mtop->moltype[molb->type].ilist[F_CONSTRNC].size() / 3;
+ dc->molb_ncon_mol[mb] = mtop.moltype[molb->type].ilist[F_CONSTR].size() / 3
+ + mtop.moltype[molb->type].ilist[F_CONSTRNC].size() / 3;
ncon += molb->nmol * dc->molb_ncon_mol[mb];
}
/* Use a hash table for the global to local index.
* The number of keys is a rough estimate, it will be optimized later.
*/
- int numKeysEstimate = std::min(mtop->natoms / 20, mtop->natoms / (2 * dd->nnodes));
+ int numKeysEstimate = std::min(mtop.natoms / 20, mtop.natoms / (2 * dd->nnodes));
dc->ga2la = std::make_unique<gmx::HashedMap<int>>(numKeysEstimate);
dc->nthread = gmx_omp_nthreads_get(emntDomdec);
*
* Copyright (c) 2005,2006,2007,2008,2009 by the GROMACS development team.
* Copyright (c) 2010,2012,2013,2014,2015 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*! \brief Sets up communication and atom indices for all local+connected constraints */
int dd_make_local_constraints(struct gmx_domdec_t* dd,
int at_start,
- const struct gmx_mtop_t* mtop,
+ const struct gmx_mtop_t& mtop,
const int* cginfo,
gmx::Constraints* constr,
int nrec,
gmx::ArrayRef<InteractionList> il_local);
/*! \brief Initializes the data structures for constraint communication */
-void init_domdec_constraints(gmx_domdec_t* dd, const gmx_mtop_t* mtop);
+void init_domdec_constraints(gmx_domdec_t* dd, const gmx_mtop_t& mtop);
#endif
void dd_print_missing_interactions(const gmx::MDLogger& mdlog,
t_commrec* cr,
int local_count,
- const gmx_mtop_t* top_global,
+ const gmx_mtop_t& top_global,
const gmx_localtop_t* top_local,
gmx::ArrayRef<const gmx::RVec> x,
const matrix box)
}
}
- printMissingInteractionsAtoms(mdlog, cr, *top_global, top_local->idef);
+ printMissingInteractionsAtoms(mdlog, cr, top_global, top_local->idef);
write_dd_pdb("dd_dump_err", 0, "dump", top_global, cr, -1, as_rvec_array(x.data()), box);
std::string errorMessage;
void dd_make_reverse_top(FILE* fplog,
gmx_domdec_t* dd,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const gmx::VirtualSitesHandler* vsite,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
const DDBondedChecking ddBondedChecking)
{
if (fplog)
!dd->comm->systemInfo.haveSplitSettles);
dd->reverse_top = std::make_unique<gmx_reverse_top_t>(
- *mtop, ir->efep != FreeEnergyPerturbationType::No, rtOptions);
+ mtop, inputrec.efep != FreeEnergyPerturbationType::No, rtOptions);
dd->nbonded_global = dd->reverse_top->impl_->numInteractionsToCheck;
dd->haveExclusions = false;
- for (const gmx_molblock_t& molb : mtop->molblock)
+ for (const gmx_molblock_t& molb : mtop.molblock)
{
- const int maxNumExclusionsPerAtom = getMaxNumExclusionsPerAtom(mtop->moltype[molb.type].excls);
+ const int maxNumExclusionsPerAtom = getMaxNumExclusionsPerAtom(mtop.moltype[molb.type].excls);
// We checked above that max 1 exclusion means only self exclusions
if (maxNumExclusionsPerAtom > 1)
{
/*! \brief Generate and store all required local bonded interactions in \p idef and local exclusions in \p lexcls */
static int make_local_bondeds_excls(gmx_domdec_t* dd,
gmx_domdec_zones_t* zones,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const int* cginfo,
gmx_bool bRCheckMB,
ivec rcheck,
dd->globalAtomIndices,
*dd->ga2la,
zones,
- mtop->molblock,
+ mtop.molblock,
bRCheckMB,
rcheck,
bRCheck2B,
*dd->ga2la,
zones,
rt->impl_->mbi,
- mtop->moltype,
+ mtop.moltype,
cginfo,
excl_t,
izone,
cg0t,
cg1t,
- mtop->intermolecularExclusionGroup);
+ mtop.intermolecularExclusionGroup);
}
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR
dd->nbonded_local = make_local_bondeds_excls(dd,
zones,
- &mtop,
+ mtop,
fr->cginfo.data(),
bRCheckMB,
rcheck,
}
void dd_bonded_cg_distance(const gmx::MDLogger& mdlog,
- const gmx_mtop_t* mtop,
- const t_inputrec* ir,
+ const gmx_mtop_t& mtop,
+ const t_inputrec& inputrec,
ArrayRef<const RVec> x,
const matrix box,
const DDBondedChecking ddBondedChecking,
bonded_distance_t bd_2b = { 0, -1, -1, -1 };
bonded_distance_t bd_mb = { 0, -1, -1, -1 };
- bool bExclRequired = inputrecExclForces(ir);
+ bool bExclRequired = inputrecExclForces(&inputrec);
*r_2b = 0;
*r_mb = 0;
int at_offset = 0;
- for (const gmx_molblock_t& molb : mtop->molblock)
+ for (const gmx_molblock_t& molb : mtop.molblock)
{
- const gmx_moltype_t& molt = mtop->moltype[molb.type];
+ const gmx_moltype_t& molt = mtop.moltype[molb.type];
if (molt.atoms.nr == 1 || molb.nmol == 0)
{
at_offset += molb.nmol * molt.atoms.nr;
else
{
t_graph graph;
- if (ir->pbcType != PbcType::No)
+ if (inputrec.pbcType != PbcType::No)
{
graph = mk_graph_moltype(molt);
}
for (int mol = 0; mol < molb.nmol; mol++)
{
getWholeMoleculeCoordinates(&molt,
- &mtop->ffparams,
- ir->pbcType,
+ &mtop.ffparams,
+ inputrec.pbcType,
&graph,
box,
x.subArray(at_offset, molt.atoms.nr),
}
}
- if (mtop->bIntermolecularInteractions)
+ if (mtop.bIntermolecularInteractions)
{
- GMX_RELEASE_ASSERT(mtop->intermolecular_ilist,
+ GMX_RELEASE_ASSERT(mtop.intermolecular_ilist,
"We should have an ilist when intermolecular interactions are on");
bonded_distance_intermol(
- *mtop->intermolecular_ilist, ddBondedChecking, x, ir->pbcType, box, &bd_2b, &bd_mb);
+ *mtop.intermolecular_ilist, ddBondedChecking, x, inputrec.pbcType, box, &bd_2b, &bd_mb);
}
*r_2b = sqrt(bd_2b.r2);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void write_dd_pdb(const char* fn,
int64_t step,
const char* title,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const t_commrec* cr,
int natoms,
const rvec x[],
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void write_dd_pdb(const char* fn,
int64_t step,
const char* title,
- const gmx_mtop_t* mtop,
+ const gmx_mtop_t& mtop,
const t_commrec* cr,
int natoms,
const rvec x[],
* for initialization and atom-data setup.
*/
void mdAlgorithmsSetupAtomData(const t_commrec* cr,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
const gmx_mtop_t& top_global,
gmx_localtop_t* top,
t_forcerec* fr,
}
atoms2md(&top_global,
- ir,
+ &inputrec,
numAtomIndex,
usingDomDec ? cr->dd->globalAtomIndices : std::vector<int>(),
numHomeAtoms,
}
else
{
- gmx_mtop_generate_local_top(top_global, top, ir->efep != FreeEnergyPerturbationType::No);
+ gmx_mtop_generate_local_top(top_global, top, inputrec.efep != FreeEnergyPerturbationType::No);
}
if (vsite)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* This is called at the start of serial runs and during domain decomposition.
*
* \param[in] cr Communication record
- * \param[in] ir Input parameter record
+ * \param[in] inputrec Input parameter record
* \param[in] top_global The global topology
* \param[in,out] top The local topology
* \param[in,out] fr The force calculation parameter/data record
* \param[in,out] shellfc The shell/flexible-constraint data, can be NULL
*/
void mdAlgorithmsSetupAtomData(const t_commrec* cr,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
const gmx_mtop_t& top_global,
gmx_localtop_t* top,
t_forcerec* fr,
comm->load_pme = 0;
}
-void print_dd_statistics(const t_commrec* cr, const t_inputrec* ir, FILE* fplog)
+void print_dd_statistics(const t_commrec* cr, const t_inputrec& inputrec, FILE* fplog)
{
gmx_domdec_comm_t* comm = cr->dd->comm;
{
fprintf(fplog,
" av. #atoms communicated per step for vsites: %d x %.1f\n",
- (EEL_PME(ir->coulombtype) || ir->coulombtype == CoulombInteractionType::Ewald)
+ (EEL_PME(inputrec.coulombtype)
+ || inputrec.coulombtype == CoulombInteractionType::Ewald)
? 3
: 2,
av);
{
fprintf(fplog,
" av. #atoms communicated per step for LINCS: %d x %.1f\n",
- 1 + ir->nLincsIter,
+ 1 + inputrec.nLincsIter,
av);
}
break;
}
fprintf(fplog, "\n");
- if (comm->ddSettings.recordLoad && EI_DYNAMICS(ir->eI))
+ if (comm->ddSettings.recordLoad && EI_DYNAMICS(inputrec.eI))
{
print_dd_load_av(fplog, cr->dd);
}
int nstglobalcomm,
t_state* state_global,
const gmx_mtop_t& top_global,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
gmx::ImdSession* imdSession,
pull_t* pull_work,
t_state* state_local,
// TODO if the update code becomes accessible here, use
// upd->deform for this logic.
- bBoxChanged = (bMasterState || inputrecDeform(ir));
- if (ir->epc != PressureCoupling::No)
+ bBoxChanged = (bMasterState || inputrecDeform(&inputrec));
+ if (inputrec.epc != PressureCoupling::No)
{
/* With nstpcouple > 1 pressure coupling happens.
* one step after calculating the pressure.
* We need to determine the last step in which p-coupling occurred.
* MRS -- need to validate this for vv?
*/
- int n = ir->nstpcouple;
+ int n = inputrec.nstpcouple;
if (n == 1)
{
step_pcoupl = step - 1;
* Since it requires (possibly expensive) global communication,
* we might want to do DLB less frequently.
*/
- if (bBoxChanged || ir->epc != PressureCoupling::No)
+ if (bBoxChanged || inputrec.epc != PressureCoupling::No)
{
bDoDLB = bBoxChanged;
}
bCheckWhetherToTurnDlbOn = dd_dlb_get_should_check_whether_to_turn_dlb_on(dd);
/* Print load every nstlog, first and last step to the log file */
- bLogLoad = ((ir->nstlog > 0 && step % ir->nstlog == 0) || comm->n_load_collect == 0
- || (ir->nsteps >= 0 && (step + ir->nstlist > ir->init_step + ir->nsteps)));
+ bLogLoad = ((inputrec.nstlog > 0 && step % inputrec.nstlog == 0) || comm->n_load_collect == 0
+ || (inputrec.nsteps >= 0
+ && (step + inputrec.nstlist > inputrec.init_step + inputrec.nsteps)));
/* Avoid extra communication due to verbose screen output
* when nstglobalcomm is set.
*/
if (bDoDLB || bLogLoad || bCheckWhetherToTurnDlbOn
- || (bVerbose && (ir->nstlist == 0 || nstglobalcomm <= ir->nstlist)))
+ || (bVerbose && (inputrec.nstlist == 0 || nstglobalcomm <= inputrec.nstlist)))
{
get_load_distribution(dd, wcycle);
if (DDMASTER(dd))
/* With the group scheme the sorting array is part of the DD state,
* but it just got out of sync, so mark as invalid by emptying it.
*/
- if (ir->cutoff_scheme == CutoffScheme::Group)
+ if (inputrec.cutoff_scheme == CutoffScheme::Group)
{
comm->sort->sorted.clear();
}
/* Only for inter-cg constraints we need special code */
n = dd_make_local_constraints(dd,
n,
- &top_global,
+ top_global,
fr->cginfo.data(),
constr,
- ir->nProjOrder,
+ inputrec.nProjOrder,
top_local->idef.il);
}
break;
}
else
{
- if (EEL_FULL(ir->coulombtype) && dd->haveExclusions)
+ if (EEL_FULL(inputrec.coulombtype) && dd->haveExclusions)
{
nat_f_novirsum = comm->atomRanges.end(DDAtomRanges::Type::Zones);
}
nat_f_novirsum);
/* Update atom data for mdatoms and several algorithms */
- mdAlgorithmsSetupAtomData(cr, ir, top_global, top_local, fr, f, mdAtoms, constr, vsite, nullptr);
+ mdAlgorithmsSetupAtomData(cr, inputrec, top_global, top_local, fr, f, mdAtoms, constr, vsite, nullptr);
auto mdatoms = mdAtoms->mdatoms();
if (!thisRankHasDuty(cr, DUTY_PME))
}
// The pull group construction can need the atom sets updated above
- if (ir->bPull)
+ if (inputrec.bPull)
{
/* Update the local pull groups */
dd_make_local_pull_groups(cr, pull_work);
write_dd_pdb("dd_dump",
step,
"dump",
- &top_global,
+ top_global,
cr,
-1,
state_local->x.rvec_array(),
void checkNumberOfBondedInteractions(const gmx::MDLogger& mdlog,
t_commrec* cr,
int totalNumberOfBondedInteractions,
- const gmx_mtop_t* top_global,
+ const gmx_mtop_t& top_global,
const gmx_localtop_t* top_local,
gmx::ArrayRef<const gmx::RVec> x,
const matrix box,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
bool check_grid_jump(int64_t step, const gmx_domdec_t* dd, real cutoff, const gmx_ddbox_t* ddbox, gmx_bool bFatal);
/*! \brief Print statistics for domain decomposition communication */
-void print_dd_statistics(const t_commrec* cr, const t_inputrec* ir, FILE* fplog);
+void print_dd_statistics(const t_commrec* cr, const t_inputrec& inputrec, FILE* fplog);
/*! \brief Partition the system over the nodes.
*
* \param[in] nstglobalcomm Will globals be computed on this step
* \param[in] state_global Global state
* \param[in] top_global Global topology
- * \param[in] ir Input record
+ * \param[in] inputrec Input record
* \param[in] imdSession IMD handle
* \param[in] pull_work Pulling data
* \param[in] state_local Local state
int nstglobalcomm,
t_state* state_global,
const gmx_mtop_t& top_global,
- const t_inputrec* ir,
+ const t_inputrec& inputrec,
gmx::ImdSession* imdSession,
pull_t* pull_work,
t_state* state_local,
void checkNumberOfBondedInteractions(const gmx::MDLogger& mdlog,
t_commrec* cr,
int totalNumberOfBondedInteractions,
- const gmx_mtop_t* top_global,
+ const gmx_mtop_t& top_global,
const gmx_localtop_t* top_local,
gmx::ArrayRef<const gmx::RVec> x,
const matrix box,
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
1,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
state = state_global;
/* Generate and initialize new topology */
- mdAlgorithmsSetupAtomData(cr, ir, *top_global, &top, fr, &f, mdAtoms, constr, vsite, shellfc);
+ mdAlgorithmsSetupAtomData(cr, *ir, *top_global, &top, fr, &f, mdAtoms, constr, vsite, shellfc);
upd.setNumAtoms(state->natoms);
}
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
nstglobalcomm,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
1,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
1,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
/* 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();
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
nstglobalcomm,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
1,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
&ems->s,
state_change_natoms(&ems->s, ems->s.natoms);
mdAlgorithmsSetupAtomData(
- cr, ir, *top_global, top, fr, &ems->f, mdAtoms, constr, vsite, shellfc ? *shellfc : nullptr);
+ cr, *ir, *top_global, top, fr, &ems->f, mdAtoms, constr, vsite, shellfc ? *shellfc : nullptr);
}
update_mdatoms(mdAtoms->mdatoms(), ems->s.lambda[FreeEnergyPerturbationCouplingType::Mass]);
1,
nullptr,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
&ems->s,
1,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
/* 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();
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
nstglobalcomm,
state_global,
*top_global,
- ir,
+ *ir,
imdSession,
pull_work,
state,
checkNumberOfBondedInteractions(mdlog,
cr,
totalNumberOfBondedInteractions,
- top_global,
+ *top_global,
&top,
makeConstArrayRef(state->x),
state->box,
static void finish_run(FILE* fplog,
const gmx::MDLogger& mdlog,
const t_commrec* cr,
- const t_inputrec* inputrec,
+ const t_inputrec& inputrec,
t_nrnb nrnb[],
gmx_wallcycle_t wcycle,
gmx_walltime_accounting_t walltime_accounting,
Further, we only report performance for dynamical integrators,
because those are the only ones for which we plan to
consider doing any optimizations. */
- bool printReport = EI_DYNAMICS(inputrec->eI) && SIMMASTER(cr);
+ bool printReport = EI_DYNAMICS(inputrec.eI) && SIMMASTER(cr);
if (printReport && !walltime_accounting_get_valid_finish(walltime_accounting))
{
nbnxn_gpu_timings,
&pme_gpu_timings);
- if (EI_DYNAMICS(inputrec->eI))
+ if (EI_DYNAMICS(inputrec.eI))
{
- delta_t = inputrec->delta_t;
+ delta_t = inputrec.delta_t;
}
if (fplog)
cr->dd,
mtop,
vsite.get(),
- inputrec.get(),
+ *inputrec,
domdecOptions.checkBondedInteractions ? DDBondedChecking::All
: DDBondedChecking::ExcludeZeroLimit,
fr->cginfo_mb);
finish_run(fplog,
mdlog,
cr,
- inputrec.get(),
+ *inputrec,
&nrnb,
wcycle,
walltime_accounting,
energyData_->needToSumEkinhOld(),
flags | (shouldCheckNumberOfBondedInteractions_ ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
checkNumberOfBondedInteractions(
- mdlog_, cr_, totalNumberOfBondedInteractions_, top_global_, localTopology_, x, box, &shouldCheckNumberOfBondedInteractions_);
+ mdlog_, cr_, totalNumberOfBondedInteractions_, *top_global_, localTopology_, x, box, &shouldCheckNumberOfBondedInteractions_);
if (flags & CGLO_STOPCM && !isInit)
{
process_and_stopcm_grp(fplog_, &vcm_, *mdAtoms_->mdatoms(), x, v);
nstglobalcomm,
globalState,
topologyHolder_->globalTopology(),
- inputrec_,
+ *inputrec_,
imdSession_,
pull_work_,
localState.get(),
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
// TopologyHolder has no access to the forces, so we are passing a nullptr
// TODO: Find a unique approach to resizing the forces in modular simulator (#3461)
mdAlgorithmsSetupAtomData(
- cr, inputrec, globalTopology, localTopology_.get(), fr, nullptr, mdAtoms, constr, vsite, nullptr);
+ cr, *inputrec, globalTopology, localTopology_.get(), fr, nullptr, mdAtoms, constr, vsite, nullptr);
}
// Send copy of initial topology to clients
updateLocalTopology();