From: Joe Jordan Date: Fri, 26 Feb 2021 14:02:54 +0000 (+0000) Subject: Only use const ref for mtop and inputrec in domdec X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=f63fbdf6b94cdc90c00b7f09fb1a9864237ccf8b;p=alexxy%2Fgromacs.git Only use const ref for mtop and inputrec in domdec All const pointers of mtop and inputrec in domdec module are converted to const refs. Additionally, since inputrec lines need to change anyway, renaming from ir to inputrec is performed. --- diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index 5345c92a30..ad43086893 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -1706,7 +1706,7 @@ static real* get_slb_frac(const gmx::MDLogger& mdlog, const char* dir, int nc, c 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); @@ -1741,22 +1741,22 @@ static int dd_getenv(const gmx::MDLogger& mdlog, const char* env_var, int def) 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( @@ -1811,14 +1811,14 @@ static DlbState forceDlbOffOrBail(DlbState cmdlineDlbState, * \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; @@ -1838,11 +1838,11 @@ static DlbState determineInitialDlbState(const gmx::MDLogger& mdlog, } /* 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); } @@ -2051,7 +2051,7 @@ static DDSystemInfo getSystemInfo(const gmx::MDLogger& 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) { @@ -2145,7 +2145,7 @@ static DDSystemInfo getSystemInfo(const gmx::MDLogger& mdlog, ? 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); @@ -2391,8 +2391,8 @@ static void set_dd_limits(const gmx::MDLogger& mdlog, 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; @@ -2421,9 +2421,9 @@ static void set_dd_limits(const gmx::MDLogger& mdlog, * 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( - *mtop, systemInfo.updateGroupingPerMoleculetype, maxReferenceTemperature(*ir), homeAtomCountEstimate); + mtop, systemInfo.updateGroupingPerMoleculetype, maxReferenceTemperature(ir), homeAtomCountEstimate); } /* Set the DD setup given by ddGridSetup */ @@ -2503,11 +2503,11 @@ void dd_init_bondeds(FILE* fplog, 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) { - 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; @@ -2525,8 +2525,8 @@ void dd_init_bondeds(FILE* fplog, 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) @@ -2582,7 +2582,7 @@ static void writeSettings(gmx::TextWriter* log, } 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) @@ -2642,7 +2642,7 @@ static void writeSettings(gmx::TextWriter* log, 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(); @@ -2651,8 +2651,8 @@ static void writeSettings(gmx::TextWriter* log, 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) { @@ -2674,7 +2674,7 @@ static void logSettings(const gmx::MDLogger& mdlog, 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; @@ -2683,7 +2683,7 @@ static void set_cell_limits_dlb(const gmx::MDLogger& mdlog, 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 */ @@ -2735,7 +2735,7 @@ static void set_cell_limits_dlb(const gmx::MDLogger& mdlog, } 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); @@ -2794,14 +2794,14 @@ gmx_bool dd_bonded_molpbc(const gmx_domdec_t* dd, PbcType pbcType) 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) @@ -2827,12 +2827,12 @@ static void set_ddgrid_parameters(const gmx::MDLogger& mdlog, } 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(dd->nnodes)) : ((1 + comm_box_frac(dd->numCells, comm->systemInfo.cutoff, *ddbox)) / static_cast(dd->nnodes)); @@ -2840,7 +2840,7 @@ static void set_ddgrid_parameters(const gmx::MDLogger& mdlog, { 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(vol_frac * natoms_tot)); } @@ -2882,8 +2882,8 @@ static DDSettings getDDSettings(const gmx::MDLogger& mdlog, 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(ddSettings.initialDlbState)]); @@ -3050,15 +3050,15 @@ gmx_domdec_t* DomainDecompositionBuilder::Impl::build(LocalAtomSetManager* atomS 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); } diff --git a/src/gromacs/domdec/domdec.h b/src/gromacs/domdec/domdec.h index 9c1e1cea7a..bc00e86fdd 100644 --- a/src/gromacs/domdec/domdec.h +++ b/src/gromacs/domdec/domdec.h @@ -168,7 +168,7 @@ void dd_init_bondeds(FILE* fplog, 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); @@ -268,7 +268,7 @@ gmx::ArrayRef dd_constraints_nlocalatoms(const gmx_domdec_t* dd); [[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 x, const matrix box); @@ -276,9 +276,9 @@ gmx::ArrayRef dd_constraints_nlocalatoms(const gmx_domdec_t* dd); /*! \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 */ @@ -307,8 +307,8 @@ t_blocka* makeBondedLinks(const gmx_mtop_t& mtop, gmx::ArrayRef cgi /*! \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 x, const matrix box, DDBondedChecking ddBondedChecking, diff --git a/src/gromacs/domdec/domdec_constraints.cpp b/src/gromacs/domdec/domdec_constraints.cpp index 234a2c858c..d456b933cf 100644 --- a/src/gromacs/domdec/domdec_constraints.cpp +++ b/src/gromacs/domdec/domdec_constraints.cpp @@ -222,7 +222,7 @@ static void walk_out(int con, /*! \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> at2settle_mt, int cg_start, @@ -240,16 +240,16 @@ static void atoms_to_settles(gmx_domdec_t* dd, { 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; @@ -297,7 +297,7 @@ static void atoms_to_settles(gmx_domdec_t* dd, /*! \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> at2con_mt, int nrec, @@ -321,12 +321,12 @@ static void atoms_to_constraints(gmx_domdec_t* dd, 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 ia1 = mtop->moltype[molb.type].ilist[F_CONSTR].iatoms; - gmx::ArrayRef ia2 = mtop->moltype[molb.type].ilist[F_CONSTRNC].iatoms; + gmx::ArrayRef ia1 = mtop.moltype[molb.type].ilist[F_CONSTR].iatoms; + gmx::ArrayRef 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 @@ -398,7 +398,7 @@ static void atoms_to_constraints(gmx_domdec_t* dd, 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, @@ -563,7 +563,7 @@ int dd_make_local_constraints(gmx_domdec_t* dd, 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) { @@ -573,16 +573,16 @@ void init_domdec_constraints(gmx_domdec_t* dd, const gmx_mtop_t* mtop) 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]; } @@ -594,7 +594,7 @@ void init_domdec_constraints(gmx_domdec_t* dd, const gmx_mtop_t* mtop) /* 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>(numKeysEstimate); dc->nthread = gmx_omp_nthreads_get(emntDomdec); diff --git a/src/gromacs/domdec/domdec_constraints.h b/src/gromacs/domdec/domdec_constraints.h index de25e404a0..e2a5772b18 100644 --- a/src/gromacs/domdec/domdec_constraints.h +++ b/src/gromacs/domdec/domdec_constraints.h @@ -3,7 +3,7 @@ * * 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. @@ -63,13 +63,13 @@ void dd_clear_local_constraint_indices(gmx_domdec_t* dd); /*! \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 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 diff --git a/src/gromacs/domdec/domdec_topology.cpp b/src/gromacs/domdec/domdec_topology.cpp index 5b4b2feacd..3c51f193db 100644 --- a/src/gromacs/domdec/domdec_topology.cpp +++ b/src/gromacs/domdec/domdec_topology.cpp @@ -389,7 +389,7 @@ static void printMissingInteractionsAtoms(const gmx::MDLogger& mdlog, 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 x, const matrix box) @@ -451,7 +451,7 @@ void dd_print_missing_interactions(const gmx::MDLogger& mdlog, } } - 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; @@ -747,9 +747,9 @@ gmx_reverse_top_t::Impl::Impl(const gmx_mtop_t& mtop, 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) @@ -767,14 +767,14 @@ void dd_make_reverse_top(FILE* fplog, !dd->comm->systemInfo.haveSplitSettles); dd->reverse_top = std::make_unique( - *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) { @@ -1440,7 +1440,7 @@ static void make_exclusions_zone(ArrayRef globalAtomInd /*! \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, @@ -1510,7 +1510,7 @@ static int make_local_bondeds_excls(gmx_domdec_t* dd, dd->globalAtomIndices, *dd->ga2la, zones, - mtop->molblock, + mtop.molblock, bRCheckMB, rcheck, bRCheck2B, @@ -1542,13 +1542,13 @@ static int make_local_bondeds_excls(gmx_domdec_t* dd, *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 @@ -1665,7 +1665,7 @@ void dd_make_local_top(gmx_domdec_t* dd, dd->nbonded_local = make_local_bondeds_excls(dd, zones, - &mtop, + mtop, fr->cginfo.data(), bRCheckMB, rcheck, @@ -2074,8 +2074,8 @@ static void getWholeMoleculeCoordinates(const gmx_moltype_t* molt, } 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 x, const matrix box, const DDBondedChecking ddBondedChecking, @@ -2085,14 +2085,14 @@ void dd_bonded_cg_distance(const gmx::MDLogger& mdlog, 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; @@ -2100,7 +2100,7 @@ void dd_bonded_cg_distance(const gmx::MDLogger& mdlog, else { t_graph graph; - if (ir->pbcType != PbcType::No) + if (inputrec.pbcType != PbcType::No) { graph = mk_graph_moltype(molt); } @@ -2109,8 +2109,8 @@ void dd_bonded_cg_distance(const gmx::MDLogger& mdlog, 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), @@ -2138,13 +2138,13 @@ void dd_bonded_cg_distance(const gmx::MDLogger& mdlog, } } - 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); diff --git a/src/gromacs/domdec/dump.cpp b/src/gromacs/domdec/dump.cpp index 274a998789..be9f0c77db 100644 --- a/src/gromacs/domdec/dump.cpp +++ b/src/gromacs/domdec/dump.cpp @@ -1,7 +1,7 @@ /* * 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. @@ -159,7 +159,7 @@ void write_dd_grid_pdb(const char* fn, int64_t step, gmx_domdec_t* dd, matrix bo 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[], diff --git a/src/gromacs/domdec/dump.h b/src/gromacs/domdec/dump.h index fabc6a5887..01c004a420 100644 --- a/src/gromacs/domdec/dump.h +++ b/src/gromacs/domdec/dump.h @@ -1,7 +1,7 @@ /* * 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. @@ -63,7 +63,7 @@ void write_dd_grid_pdb(const char* fn, int64_t step, gmx_domdec_t* dd, matrix bo 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[], diff --git a/src/gromacs/domdec/mdsetup.cpp b/src/gromacs/domdec/mdsetup.cpp index 6c76374521..9db54f0c33 100644 --- a/src/gromacs/domdec/mdsetup.cpp +++ b/src/gromacs/domdec/mdsetup.cpp @@ -64,7 +64,7 @@ namespace gmx * 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, @@ -99,7 +99,7 @@ void mdAlgorithmsSetupAtomData(const t_commrec* cr, } atoms2md(&top_global, - ir, + &inputrec, numAtomIndex, usingDomDec ? cr->dd->globalAtomIndices : std::vector(), numHomeAtoms, @@ -112,7 +112,7 @@ void mdAlgorithmsSetupAtomData(const t_commrec* cr, } 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) diff --git a/src/gromacs/domdec/mdsetup.h b/src/gromacs/domdec/mdsetup.h index ab0da8fcf1..007c410660 100644 --- a/src/gromacs/domdec/mdsetup.h +++ b/src/gromacs/domdec/mdsetup.h @@ -1,7 +1,7 @@ /* * 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. @@ -77,7 +77,7 @@ void make_local_shells(const t_commrec* cr, const t_mdatoms* md, gmx_shellfc_t* * 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 @@ -88,7 +88,7 @@ void make_local_shells(const t_commrec* cr, const t_mdatoms* md, gmx_shellfc_t* * \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, diff --git a/src/gromacs/domdec/partition.cpp b/src/gromacs/domdec/partition.cpp index bf73b3b25f..789dc73522 100644 --- a/src/gromacs/domdec/partition.cpp +++ b/src/gromacs/domdec/partition.cpp @@ -2672,7 +2672,7 @@ void reset_dd_statistics_counters(gmx_domdec_t* dd) 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; @@ -2700,7 +2700,8 @@ void print_dd_statistics(const t_commrec* cr, const t_inputrec* ir, FILE* fplog) { 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); @@ -2711,7 +2712,7 @@ void print_dd_statistics(const t_commrec* cr, const t_inputrec* ir, FILE* fplog) { fprintf(fplog, " av. #atoms communicated per step for LINCS: %d x %.1f\n", - 1 + ir->nLincsIter, + 1 + inputrec.nLincsIter, av); } break; @@ -2720,7 +2721,7 @@ void print_dd_statistics(const t_commrec* cr, const t_inputrec* ir, FILE* fplog) } 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); } @@ -2735,7 +2736,7 @@ void dd_partition_system(FILE* fplog, 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, @@ -2768,8 +2769,8 @@ void dd_partition_system(FILE* fplog, // 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. @@ -2780,7 +2781,7 @@ void dd_partition_system(FILE* fplog, * 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; @@ -2807,7 +2808,7 @@ void dd_partition_system(FILE* fplog, * 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; } @@ -2823,14 +2824,15 @@ void dd_partition_system(FILE* fplog, 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)) @@ -3143,7 +3145,7 @@ void dd_partition_system(FILE* fplog, /* 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(); } @@ -3225,10 +3227,10 @@ void dd_partition_system(FILE* fplog, /* 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; @@ -3254,7 +3256,7 @@ void dd_partition_system(FILE* fplog, } else { - if (EEL_FULL(ir->coulombtype) && dd->haveExclusions) + if (EEL_FULL(inputrec.coulombtype) && dd->haveExclusions) { nat_f_novirsum = comm->atomRanges.end(DDAtomRanges::Type::Zones); } @@ -3276,7 +3278,7 @@ void dd_partition_system(FILE* fplog, 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)) @@ -3303,7 +3305,7 @@ void dd_partition_system(FILE* fplog, } // 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); @@ -3331,7 +3333,7 @@ void dd_partition_system(FILE* fplog, write_dd_pdb("dd_dump", step, "dump", - &top_global, + top_global, cr, -1, state_local->x.rvec_array(), @@ -3366,7 +3368,7 @@ void dd_partition_system(FILE* fplog, 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 x, const matrix box, diff --git a/src/gromacs/domdec/partition.h b/src/gromacs/domdec/partition.h index de05c4a738..da3c066737 100644 --- a/src/gromacs/domdec/partition.h +++ b/src/gromacs/domdec/partition.h @@ -1,7 +1,7 @@ /* * 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. @@ -79,7 +79,7 @@ class VirtualSitesHandler; 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. * @@ -96,7 +96,7 @@ void print_dd_statistics(const t_commrec* cr, const t_inputrec* ir, FILE* fplog) * \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 @@ -118,7 +118,7 @@ void dd_partition_system(FILE* fplog, 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, @@ -146,7 +146,7 @@ void dd_partition_system(FILE* fplog, 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 x, const matrix box, diff --git a/src/gromacs/mdlib/update_vv.cpp b/src/gromacs/mdlib/update_vv.cpp index 2b92b3fd97..b1d3b76c69 100644 --- a/src/gromacs/mdlib/update_vv.cpp +++ b/src/gromacs/mdlib/update_vv.cpp @@ -204,7 +204,7 @@ void integrateVVFirstStep(int64_t step, checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index fe3b1423ff..de642b84de 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -384,7 +384,7 @@ void gmx::LegacySimulator::do_md() 1, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, @@ -407,7 +407,7 @@ void gmx::LegacySimulator::do_md() 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); } @@ -691,7 +691,7 @@ void gmx::LegacySimulator::do_md() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, @@ -1002,7 +1002,7 @@ void gmx::LegacySimulator::do_md() nstglobalcomm, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, @@ -1071,7 +1071,7 @@ void gmx::LegacySimulator::do_md() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, @@ -1647,7 +1647,7 @@ void gmx::LegacySimulator::do_md() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, @@ -1891,7 +1891,7 @@ void gmx::LegacySimulator::do_md() 1, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, diff --git a/src/gromacs/mdrun/mimic.cpp b/src/gromacs/mdrun/mimic.cpp index e258a8a2c5..a06cca33b1 100644 --- a/src/gromacs/mdrun/mimic.cpp +++ b/src/gromacs/mdrun/mimic.cpp @@ -303,7 +303,7 @@ void gmx::LegacySimulator::do_mimic() 1, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, @@ -324,7 +324,7 @@ void gmx::LegacySimulator::do_mimic() /* 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(); @@ -374,7 +374,7 @@ void gmx::LegacySimulator::do_mimic() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, @@ -489,7 +489,7 @@ void gmx::LegacySimulator::do_mimic() nstglobalcomm, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, @@ -662,7 +662,7 @@ void gmx::LegacySimulator::do_mimic() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, diff --git a/src/gromacs/mdrun/minimize.cpp b/src/gromacs/mdrun/minimize.cpp index 102b4393c7..9563ac5c94 100644 --- a/src/gromacs/mdrun/minimize.cpp +++ b/src/gromacs/mdrun/minimize.cpp @@ -435,7 +435,7 @@ static void init_em(FILE* fplog, 1, state_global, *top_global, - ir, + *ir, imdSession, pull_work, &ems->s, @@ -458,7 +458,7 @@ static void init_em(FILE* fplog, 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]); @@ -803,7 +803,7 @@ static void em_dd_partition_system(FILE* fplog, 1, nullptr, *top_global, - ir, + *ir, imdSession, pull_work, &ems->s, diff --git a/src/gromacs/mdrun/rerun.cpp b/src/gromacs/mdrun/rerun.cpp index 69bf4d661a..c9700481d1 100644 --- a/src/gromacs/mdrun/rerun.cpp +++ b/src/gromacs/mdrun/rerun.cpp @@ -347,7 +347,7 @@ void gmx::LegacySimulator::do_rerun() 1, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, @@ -368,7 +368,7 @@ void gmx::LegacySimulator::do_rerun() /* 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(); @@ -418,7 +418,7 @@ void gmx::LegacySimulator::do_rerun() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, @@ -599,7 +599,7 @@ void gmx::LegacySimulator::do_rerun() nstglobalcomm, state_global, *top_global, - ir, + *ir, imdSession, pull_work, state, @@ -772,7 +772,7 @@ void gmx::LegacySimulator::do_rerun() checkNumberOfBondedInteractions(mdlog, cr, totalNumberOfBondedInteractions, - top_global, + *top_global, &top, makeConstArrayRef(state->x), state->box, diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 350ace3f2f..5d37389670 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -597,7 +597,7 @@ static TaskTarget findTaskTarget(const char* optionString) 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, @@ -622,7 +622,7 @@ static void finish_run(FILE* fplog, 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)) { @@ -714,9 +714,9 @@ static void finish_run(FILE* fplog, 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) @@ -1893,7 +1893,7 @@ int Mdrunner::mdrunner() cr->dd, mtop, vsite.get(), - inputrec.get(), + *inputrec, domdecOptions.checkBondedInteractions ? DDBondedChecking::All : DDBondedChecking::ExcludeZeroLimit, fr->cginfo_mb); @@ -1992,7 +1992,7 @@ int Mdrunner::mdrunner() finish_run(fplog, mdlog, cr, - inputrec.get(), + *inputrec, &nrnb, wcycle, walltime_accounting, diff --git a/src/gromacs/modularsimulator/computeglobalselement.cpp b/src/gromacs/modularsimulator/computeglobalselement.cpp index 1d59ae9063..f5f4e67470 100644 --- a/src/gromacs/modularsimulator/computeglobalselement.cpp +++ b/src/gromacs/modularsimulator/computeglobalselement.cpp @@ -309,7 +309,7 @@ void ComputeGlobalsElement::compute(gmx::Step step, 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); diff --git a/src/gromacs/modularsimulator/domdechelper.cpp b/src/gromacs/modularsimulator/domdechelper.cpp index 204a031ddc..a55426cf09 100644 --- a/src/gromacs/modularsimulator/domdechelper.cpp +++ b/src/gromacs/modularsimulator/domdechelper.cpp @@ -166,7 +166,7 @@ void DomDecHelper::partitionSystem(bool verbose, nstglobalcomm, globalState, topologyHolder_->globalTopology(), - inputrec_, + *inputrec_, imdSession_, pull_work_, localState.get(), diff --git a/src/gromacs/modularsimulator/topologyholder.cpp b/src/gromacs/modularsimulator/topologyholder.cpp index 87e647bd54..bbef75bad2 100644 --- a/src/gromacs/modularsimulator/topologyholder.cpp +++ b/src/gromacs/modularsimulator/topologyholder.cpp @@ -1,7 +1,7 @@ /* * 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. @@ -71,7 +71,7 @@ TopologyHolder::TopologyHolder(std::vector clients, // 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();