}
/*! \libinternal
- \copydoc integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+ \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+ const gmx_multisim_t *ms,
+ const gmx::MDLogger &mdlog,
int nfile, const t_filenm fnm[],
const gmx_output_env_t *oenv,
const MdrunOptions &mdrunOptions,
gmx_membed_t *membed,
gmx_walltime_accounting_t walltime_accounting)
*/
-double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+double gmx::do_md(FILE *fplog, t_commrec *cr,
+ const gmx_multisim_t *ms,
+ const gmx::MDLogger &mdlog,
int nfile, const t_filenm fnm[],
const gmx_output_env_t *oenv,
const MdrunOptions &mdrunOptions,
gmx_membed_t *membed,
gmx_walltime_accounting_t walltime_accounting)
{
- gmx_mdoutf_t outf = nullptr;
- gmx_int64_t step, step_rel;
- double elapsed_time;
- double t, t0, lam0[efptNR];
- gmx_bool bGStatEveryStep, bGStat, bCalcVir, bCalcEnerStep, bCalcEner;
- gmx_bool bNS, bNStList, bSimAnn, bStopCM,
- bFirstStep, bInitStep, bLastStep = FALSE,
- bBornRadii;
+ gmx_mdoutf_t outf = nullptr;
+ gmx_int64_t step, step_rel;
+ double elapsed_time;
+ double t, t0, lam0[efptNR];
+ gmx_bool bGStatEveryStep, bGStat, bCalcVir, bCalcEnerStep, bCalcEner;
+ gmx_bool bNS, bNStList, bSimAnn, bStopCM,
+ bFirstStep, bInitStep, bLastStep = FALSE;
gmx_bool bDoDHDL = FALSE, bDoFEP = FALSE, bDoExpanded = FALSE;
gmx_bool do_ene, do_log, do_verbose, bRerunWarnNoV = TRUE,
bForceUpdate = FALSE, bCPT;
SimulationSignals signals;
// Most global communnication stages don't propagate mdrun
// signals, and will use this object to achieve that.
- SimulationSignaller nullSignaller(nullptr, nullptr, false, false);
+ SimulationSignaller nullSignaller(nullptr, nullptr, nullptr, false, false);
if (!mdrunOptions.writeConfout)
{
}
/* Set up interactive MD (IMD) */
- init_IMD(ir, cr, top_global, fplog, ir->nstcalcenergy, MASTER(cr) ? as_rvec_array(state_global->x.data()) : nullptr,
+ init_IMD(ir, cr, ms, top_global, fplog, ir->nstcalcenergy,
+ MASTER(cr) ? as_rvec_array(state_global->x.data()) : nullptr,
nfile, fnm, oenv, mdrunOptions);
if (DOMAINDECOMP(cr))
/* Initialize AWH and restore state from history in checkpoint if needed. */
if (ir->bDoAwh)
{
- ir->awh = new gmx::Awh(fplog, *ir, cr, *ir->awhParams, opt2fn("-awh", nfile, fnm), ir->pull_work);
+ ir->awh = new gmx::Awh(fplog, *ir, cr, ms, *ir->awhParams, opt2fn("-awh", nfile, fnm), ir->pull_work);
if (startingFromCheckpoint)
{
const bool useReplicaExchange = (replExParams.exchangeInterval > 0);
if (useReplicaExchange && MASTER(cr))
{
- repl_ex = init_replica_exchange(fplog, cr->ms, top_global->natoms, ir,
+ repl_ex = init_replica_exchange(fplog, ms, top_global->natoms, ir,
replExParams);
}
-
/* PME tuning is only supported in the Verlet scheme, with PME for
* Coulomb. It is not supported with only LJ PME, or for
* reruns. */
{
/* Constrain the initial coordinates and velocities */
do_constrain_first(fplog, constr, ir, mdatoms, state,
- cr, nrnb, fr, top);
+ cr, ms, nrnb, fr, top);
}
if (vsite)
{
{
// TODO This implementation of ensemble orientation restraints is nasty because
// a user can't just do multi-sim with single-sim orientation restraints.
- bool usingEnsembleRestraints = (fcd->disres.nsystems > 1) || (cr->ms && fcd->orires.nr);
- bool awhUsesMultiSim = (ir->bDoAwh && ir->awhParams->shareBiasMultisim && cr->ms);
+ bool usingEnsembleRestraints = (fcd->disres.nsystems > 1) || (ms && fcd->orires.nr);
+ bool awhUsesMultiSim = (ir->bDoAwh && ir->awhParams->shareBiasMultisim && ms);
// Replica exchange, ensemble restraints and AWH need all
// simulations to remain synchronized, so they need
step_rel = 0;
// TODO extract this to new multi-simulation module
- if (MASTER(cr) && MULTISIM(cr) && !useReplicaExchange)
+ if (MASTER(cr) && isMultiSim(ms) && !useReplicaExchange)
{
- if (!multisim_int_all_are_equal(cr->ms, ir->nsteps))
+ if (!multisim_int_all_are_equal(ms, ir->nsteps))
{
GMX_LOG(mdlog.warning).appendText(
"Note: The number of steps is not consistent across multi simulations,\n"
"but we are proceeding anyway!");
}
- if (!multisim_int_all_are_equal(cr->ms, ir->init_step))
+ if (!multisim_int_all_are_equal(ms, ir->init_step))
{
GMX_LOG(mdlog.warning).appendText(
"Note: The initial step is not consistent across multi simulations,\n"
bLastStep = TRUE;
}
- /* Determine whether or not to update the Born radii if doing GB */
- bBornRadii = bFirstStep;
- if (ir->implicit_solvent && (step % ir->nstgbradii == 0))
- {
- bBornRadii = TRUE;
- }
-
/* do_log triggers energy and virial calculation. Because this leads
* to different code paths, forces can be different. Thus for exact
* continuation we should avoid extra log output.
if (shellfc)
{
/* Now is the time to relax the shells */
- relax_shell_flexcon(fplog, cr, mdrunOptions.verbose, step,
+ relax_shell_flexcon(fplog, cr, ms, mdrunOptions.verbose, step,
ir, bNS, force_flags, top,
constr, enerd, fcd,
state, &f, force_vir, mdatoms,
nrnb, wcycle, graph, groups,
- shellfc, fr, bBornRadii, t, mu_tot,
+ shellfc, fr, t, mu_tot,
vsite,
ddOpenBalanceRegion, ddCloseBalanceRegion);
}
* This is parallellized as well, and does communication too.
* Check comments in sim_util.c
*/
- do_force(fplog, cr, ir, step, nrnb, wcycle, top, groups,
+ do_force(fplog, cr, ms, ir, step, nrnb, wcycle, top, groups,
state->box, state->x, &state->hist,
f, force_vir, mdatoms, enerd, fcd,
state->lambda, graph,
- fr, vsite, mu_tot, t, ed, bBornRadii,
+ fr, vsite, mu_tot, t, ed,
(bNS ? GMX_FORCE_NS : 0) | force_flags,
ddOpenBalanceRegion, ddCloseBalanceRegion);
}
update_constraints(fplog, step, nullptr, ir, mdatoms,
state, fr->bMolPBC, graph, f,
&top->idef, shake_vir,
- cr, nrnb, wcycle, upd, constr,
+ cr, ms, nrnb, wcycle, upd, constr,
TRUE, bCalcVir);
wallcycle_start(wcycle, ewcUPDATE);
}
update_constraints(fplog, step, nullptr, ir, mdatoms,
state, fr->bMolPBC, graph, f,
&top->idef, tmp_vir,
- cr, nrnb, wcycle, upd, constr,
+ cr, ms, nrnb, wcycle, upd, constr,
TRUE, bCalcVir);
}
}
update_constraints(fplog, step, &dvdl_constr, ir, mdatoms, state,
fr->bMolPBC, graph, f,
&top->idef, shake_vir,
- cr, nrnb, wcycle, upd, constr,
+ cr, ms, nrnb, wcycle, upd, constr,
FALSE, bCalcVir);
if (ir->eI == eiVVAK)
update_constraints(fplog, step, nullptr, ir, mdatoms,
state, fr->bMolPBC, graph, f,
&top->idef, tmp_vir,
- cr, nrnb, wcycle, upd, nullptr,
+ cr, ms, nrnb, wcycle, upd, nullptr,
FALSE, bCalcVir);
}
if (EI_VV(ir->eI))
// situation where e.g. checkpointing can't be
// signalled.
bool doIntraSimSignal = true;
- SimulationSignaller signaller(&signals, cr, doInterSimSignal, doIntraSimSignal);
+ SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
state->fep_state = lamnew;
}
/* Print the remaining wall clock time for the run */
- if (MULTIMASTER(cr) &&
+ if (isMasterSimMasterRank(ms, cr) &&
(do_verbose || gmx_got_usr_signal()) &&
!bPMETunePrinting)
{
bExchanged = FALSE;
if (bDoReplEx)
{
- bExchanged = replica_exchange(fplog, cr, repl_ex,
+ bExchanged = replica_exchange(fplog, cr, ms, repl_ex,
state_global, enerd,
state, step, t);
}
eprAVER, mdebin, fcd, groups, &(ir->opts), ir->awh);
}
}
- // TODO Enable the next line when merging to master branch
- // done_ebin(mdebin->ebin);
+ done_ebin(mdebin->ebin);
done_mdoutf(outf);
if (bPMETune)