Merge branch release-2018
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 28 Mar 2018 11:19:26 +0000 (13:19 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 28 Mar 2018 11:28:03 +0000 (13:28 +0200)
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

1  2 
cmake/gmxVersionInfo.cmake
docs/CMakeLists.txt
docs/user-guide/mdrun-performance.rst
src/gromacs/fileio/checkpoint.cpp
src/gromacs/mdlib/main.cpp
src/gromacs/pulling/pull.cpp
src/programs/mdrun/md.cpp

Simple merge
Simple merge
Simple merge
Simple merge
index 44c5c6e1fc8286598654ca6b421bc8f3821b9a75,2002f94ca006b3734b4c4eda5f836cfef9f28b04..503dad983e35b3cae1177ee4157e876604c0a697
@@@ -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)
      {
Simple merge
index d302c1f425b37a62b3eb352e2802eb867e46dedb,1695e0b72d53729f4ece973596131895d9a122b8..a8319e4bf8c89905242648c97b6766d92a4ec039
@@@ -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;
      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. */
      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