From 29c336cd0a518507c86094b08a447ec388afaad2 Mon Sep 17 00:00:00 2001 From: Alan Gray Date: Tue, 18 May 2021 07:33:42 -0700 Subject: [PATCH] Remove GPU update restriction for replica exchange 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 | 2 +- src/gromacs/mdrun/runner.cpp | 1 - src/gromacs/taskassignment/decidegpuusage.cpp | 5 ----- src/gromacs/taskassignment/decidegpuusage.h | 2 -- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index 909fb5f065..92c51459b8 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -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); diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 7c4bcaf2dc..a2f44ea30e 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -1456,7 +1456,6 @@ int Mdrunner::mdrunner() mtop, doEssentialDynamics, gmx_mtop_ftype_count(mtop, F_ORIRES) > 0, - replExParams.exchangeInterval > 0, haveFrozenAtoms, doRerun, devFlags, diff --git a/src/gromacs/taskassignment/decidegpuusage.cpp b/src/gromacs/taskassignment/decidegpuusage.cpp index 0bb5c92eea..c18bba3ec4 100644 --- a/src/gromacs/taskassignment/decidegpuusage.cpp +++ b/src/gromacs/taskassignment/decidegpuusage.cpp @@ -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"; diff --git a/src/gromacs/taskassignment/decidegpuusage.h b/src/gromacs/taskassignment/decidegpuusage.h index 98d0251c33..3404bebb6a 100644 --- a/src/gromacs/taskassignment/decidegpuusage.h +++ b/src/gromacs/taskassignment/decidegpuusage.h @@ -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, -- 2.22.0