From ec272c758b175a81074b1222fbce5dfcd8849893 Mon Sep 17 00:00:00 2001 From: Artem Zhmurov Date: Mon, 9 Dec 2019 19:20:03 +0100 Subject: [PATCH] Set GPU update to false in case of a rerun Rerun does not require the numerical integration of equation of motion, hence the useGpuUpdate should be false. Fixes #3231. Change-Id: I9027641e9dc32fb464ebbb6148c11c530c0eb2cd --- src/gromacs/mdrun/runner.cpp | 2 +- src/gromacs/taskassignment/decidegpuusage.cpp | 7 ++++++- src/gromacs/taskassignment/decidegpuusage.h | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 7ce0a14071..9b30f4d60c 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -898,7 +898,7 @@ int Mdrunner::mdrunner() useGpuForUpdate = decideWhetherToUseGpuForUpdate( useDomainDecomposition, useGpuForPme, useGpuForNonbonded, updateTarget, gpusWereDetected, *inputrec, mtop, doEssentialDynamics, - gmx_mtop_ftype_count(mtop, F_ORIRES) > 0, replExParams.exchangeInterval > 0); + gmx_mtop_ftype_count(mtop, F_ORIRES) > 0, replExParams.exchangeInterval > 0, doRerun); } GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR diff --git a/src/gromacs/taskassignment/decidegpuusage.cpp b/src/gromacs/taskassignment/decidegpuusage.cpp index a83b2b82e0..69279929be 100644 --- a/src/gromacs/taskassignment/decidegpuusage.cpp +++ b/src/gromacs/taskassignment/decidegpuusage.cpp @@ -497,7 +497,8 @@ bool decideWhetherToUseGpuForUpdate(const bool isDomainDecomposition, const gmx_mtop_t& mtop, const bool useEssentialDynamics, const bool doOrientationRestraints, - const bool useReplicaExchange) + const bool useReplicaExchange, + const bool doRerun) { if (updateTarget == TaskTarget::Cpu) @@ -575,6 +576,10 @@ bool decideWhetherToUseGpuForUpdate(const bool isDomainDecomposition, { errorMessage += "Swapping the coordinates is not supported.\n"; } + if (doRerun) + { + errorMessage += "Re-run is not supported.\n"; + } // TODO: F_CONSTRNC is only unsupported, because isNumCoupledConstraintsSupported() // does not support it, the actual CUDA LINCS code does support it diff --git a/src/gromacs/taskassignment/decidegpuusage.h b/src/gromacs/taskassignment/decidegpuusage.h index 08ff410b40..ace5f39cc2 100644 --- a/src/gromacs/taskassignment/decidegpuusage.h +++ b/src/gromacs/taskassignment/decidegpuusage.h @@ -241,6 +241,7 @@ bool decideWhetherToUseGpusForBonded(bool useGpuForNonbonded, * \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] doRerun It this is a rerun. * * \returns Whether complete simulation can be run on GPU. * \throws std::bad_alloc If out of memory @@ -255,7 +256,8 @@ bool decideWhetherToUseGpuForUpdate(bool isDomainDecomposition, const gmx_mtop_t& mtop, bool useEssentialDynamics, bool doOrientationRestraints, - bool useReplicaExchange); + bool useReplicaExchange, + bool doRerun); } // namespace gmx -- 2.22.0