SimulationGroups *groups = &top_global->groups;
std::unique_ptr<EssentialDynamics> ed = nullptr;
- if (opt2bSet("-ei", nfile, fnm) || observablesHistory->edsamHistory != nullptr)
+ if (opt2bSet("-ei", nfile, fnm))
{
/* Initialize essential dynamics sampling */
ed = init_edsam(mdlog,
oenv,
startingBehavior);
}
+ else if (observablesHistory->edsamHistory)
+ {
+ gmx_fatal(FARGS,
+ "The checkpoint is from a run with essential dynamics sampling, "
+ "but the current run did not specify the -ei option. "
+ "Either specify the -ei option to mdrun, or do not use this checkpoint file.");
+ }
initialize_lambdas(fplog, *ir, MASTER(cr), &state_global->fep_state, state_global->lambda, lam0);
Update upd(ir, deform);
cr doesn't reflect the final parallel state right now */
gmx_mtop_t mtop;
- bool doMembed = opt2bSet("-membed", filenames.size(), filenames.data());
- bool doRerun = mdrunOptions.rerun;
+ /* TODO: inputrec should tell us whether we use an algorithm, not a file option */
+ const bool doEssentialDynamics = opt2bSet("-ei", filenames.size(), filenames.data());
+ const bool doMembed = opt2bSet("-membed", filenames.size(), filenames.data());
+ const bool doRerun = mdrunOptions.rerun;
// Handle task-assignment related user options.
EmulateGpuNonbonded emulateGpuNonbonded = (getenv("GMX_EMULATE_GPU") != nullptr ?
startingBehavior);
}
- /* Let makeConstraints know whether we have essential dynamics constraints.
- * TODO: inputrec should tell us whether we use an algorithm, not a file option or the checkpoint
- */
- bool doEssentialDynamics = (opt2fn_null("-ei", filenames.size(), filenames.data()) != nullptr
- || observablesHistory.edsamHistory);
- auto constr = makeConstraints(mtop, *inputrec, pull_work, doEssentialDynamics,
- fplog, *mdAtoms->mdatoms(),
- cr, ms, &nrnb, wcycle, fr->bMolPBC);
+ /* Let makeConstraints know whether we have essential dynamics constraints. */
+ auto constr = makeConstraints(mtop, *inputrec, pull_work, doEssentialDynamics,
+ fplog, *mdAtoms->mdatoms(),
+ cr, ms, &nrnb, wcycle, fr->bMolPBC);
/* Energy terms and groups */
gmx_enerdata_t enerd(mtop.groups.groups[SimulationAtomGroupType::EnergyOutput].size(), inputrec->fepvals->n_lambda);