Remove GPU update restriction for replica exchange
authorAlan Gray <alangray3@gmail.com>
Tue, 18 May 2021 14:33:42 +0000 (07:33 -0700)
committerAlan Gray <alangray3@gmail.com>
Thu, 20 May 2021 14:16:14 +0000 (14:16 +0000)
Ensures that the end-of-step D2H coordinate copy is active for replica
exchange steps, to allow the GPU update restriction to be relaxed.

src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/taskassignment/decidegpuusage.cpp
src/gromacs/taskassignment/decidegpuusage.h

index 909fb5f065b5e36abdc0afd8cde85b9fdf82f41e..92c51459b85cceac7366b4b6e5f8a09c7b6261d0 100644 (file)
@@ -1675,7 +1675,7 @@ void gmx::LegacySimulator::do_md()
             if (bGStat || needHalfStepKineticEnergy || doInterSimSignal)
             {
                 // Copy coordinates when needed to stop the CM motion.
-                if (useGpuForUpdate && !EI_VV(ir->eI) && bStopCM)
+                if (useGpuForUpdate && (bDoReplEx || (!EI_VV(ir->eI) && bStopCM)))
                 {
                     stateGpu->copyCoordinatesFromGpu(state->x, AtomLocality::Local);
                     stateGpu->waitCoordinatesReadyOnHost(AtomLocality::Local);
index 7c4bcaf2dc43691100c749894a69e5b368d17973..a2f44ea30e7a819384e69cb59fb4eac18731a852 100644 (file)
@@ -1456,7 +1456,6 @@ int Mdrunner::mdrunner()
                                                          mtop,
                                                          doEssentialDynamics,
                                                          gmx_mtop_ftype_count(mtop, F_ORIRES) > 0,
-                                                         replExParams.exchangeInterval > 0,
                                                          haveFrozenAtoms,
                                                          doRerun,
                                                          devFlags,
index 0bb5c92eeae76a6162215aa087fd12bd93a6c14e..c18bba3ec402ef5eb55df76454dc1ccfdc22b9c5 100644 (file)
@@ -543,7 +543,6 @@ bool decideWhetherToUseGpuForUpdate(const bool                     isDomainDecom
                                     const gmx_mtop_t&              mtop,
                                     const bool                     useEssentialDynamics,
                                     const bool                     doOrientationRestraints,
-                                    const bool                     useReplicaExchange,
                                     const bool                     haveFrozenAtoms,
                                     const bool                     doRerun,
                                     const DevelopmentFeatureFlags& devFlags,
@@ -656,10 +655,6 @@ bool decideWhetherToUseGpuForUpdate(const bool                     isDomainDecom
     {
         errorMessage += "Shells are not supported.\n";
     }
-    if (useReplicaExchange)
-    {
-        errorMessage += "Replica exchange simulations are not supported.\n";
-    }
     if (inputrec.eSwapCoords != SwapType::No)
     {
         errorMessage += "Swapping the coordinates is not supported.\n";
index 98d0251c33c93fb3ab5e36bdb770a42ce248b59e..3404bebb6af6f6c6e8bc3097dd8d77695fb6768e 100644 (file)
@@ -278,7 +278,6 @@ bool decideWhetherToUseGpusForBonded(bool              useGpuForNonbonded,
  * \param[in]  mtop                         The global topology.
  * \param[in]  useEssentialDynamics         If essential dynamics is active.
  * \param[in]  doOrientationRestraints      If orientation restraints are enabled.
- * \param[in]  useReplicaExchange           If this is a REMD simulation.
  * \param[in]  haveFrozenAtoms              If this simulation has frozen atoms (see Issue #3920).
  * \param[in]  doRerun                      It this is a rerun.
  * \param[in]  devFlags                     GPU development / experimental feature flags.
@@ -299,7 +298,6 @@ bool decideWhetherToUseGpuForUpdate(bool                           isDomainDecom
                                     const gmx_mtop_t&              mtop,
                                     bool                           useEssentialDynamics,
                                     bool                           doOrientationRestraints,
-                                    bool                           useReplicaExchange,
                                     bool                           haveFrozenAtoms,
                                     bool                           doRerun,
                                     const DevelopmentFeatureFlags& devFlags,