From: Mark Abraham Date: Wed, 28 Mar 2018 11:19:26 +0000 (+0200) Subject: Merge branch release-2018 X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=afae302cfb3746319ea8b312936a5f4c3b7615f2;p=alexxy%2Fgromacs.git Merge branch release-2018 Some meaningful conflicts in init_multisim associated with multisim fixes and clarifications in release-2018 combining with reorganization in master branch. Preserved the master-branch pre-submit matrix, since all branches have separate changes that cope with gpu_id=2 no longer being valid. Change-Id: Idefe4f1ec3bbbc76dfedf03a81abef8233328de2 --- afae302cfb3746319ea8b312936a5f4c3b7615f2 diff --cc src/gromacs/mdlib/main.cpp index 44c5c6e1fc,2002f94ca0..503dad983e --- a/src/gromacs/mdlib/main.cpp +++ b/src/gromacs/mdlib/main.cpp @@@ -248,27 -248,27 +248,35 @@@ gmx_multisim_t *init_multisystem(MPI_Co int *rank; #endif - if (multidirs.size() <= 1) -#if !GMX_MPI - if (nsim > 1) ++ if (multidirs.empty()) { - gmx_fatal(FARGS, "This binary is compiled without MPI support, can not do multiple simulations."); + return nullptr; + } - if (!GMX_LIB_MPI && multidirs.size() > 1) ++ ++ if (!GMX_LIB_MPI && multidirs.size() >= 1) + { + gmx_fatal(FARGS, "mdrun -multidir is only supported when GROMACS has been " + "configured with a proper external MPI library."); } -#endif - if (nsim == 1) ++ if (multidirs.size() == 1) + { + /* NOTE: It would be nice if this special case worked, but this requires checks/tests. */ - gmx_fatal(FARGS, "To run mdrun in multiple simulation mode, more then one actual simulation is required. The single simulation case is not supported."); ++ gmx_fatal(FARGS, "To run mdrun in multiple simulation mode, more then one " ++ "actual simulation is required. The single simulation case is not supported."); + } + - nnodes = cr->nnodes; - if (nnodes % nsim != 0) +#if GMX_MPI + int numRanks; + MPI_Comm_size(comm, &numRanks); + if (numRanks % multidirs.size() != 0) { - gmx_fatal(FARGS, "The number of ranks (%d) is not a multiple of the number of simulations (%d)", nnodes, nsim); + gmx_fatal(FARGS, "The number of ranks (%d) is not a multiple of the number of simulations (%zu)", numRanks, multidirs.size()); } - nnodpersim = nnodes/nsim; - sim = cr->nodeid/nnodpersim; + int numRanksPerSim = numRanks/multidirs.size(); + int rankWithinComm; + MPI_Comm_rank(comm, &rankWithinComm); if (debug) { diff --cc src/programs/mdrun/md.cpp index d302c1f425,1695e0b72d..a8319e4bf8 --- a/src/programs/mdrun/md.cpp +++ b/src/programs/mdrun/md.cpp @@@ -318,14 -315,14 +319,13 @@@ double gmx::do_md(FILE *fplog, t_commre 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, - bUsingEnsembleRestraints; - 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; @@@ -638,10 -634,10 +638,9 @@@ 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. */ @@@ -919,12 -915,16 +918,16 @@@ bSumEkinhOld = FALSE; bExchanged = FALSE; bNeedRepartition = FALSE; - // TODO This implementation of ensemble orientation restraints is nasty because - // a user can't just do multi-sim with single-sim orientation restraints. - bUsingEnsembleRestraints = (fcd->disres.nsystems > 1) || (ms && fcd->orires.nr); + bool simulationsShareState = false; + int nstSignalComm = nstglobalcomm; { - // Replica exchange and ensemble restraints need all + // 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 // checkpoints and stop conditions to act on the same step, so // the propagation of such signals must take place between