Set GPU update to false in case of a rerun
authorArtem Zhmurov <zhmurov@gmail.com>
Mon, 9 Dec 2019 18:20:03 +0000 (19:20 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Tue, 10 Dec 2019 12:07:34 +0000 (13:07 +0100)
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
src/gromacs/taskassignment/decidegpuusage.cpp
src/gromacs/taskassignment/decidegpuusage.h

index 7ce0a14071a2292a737eb096f13ae89147d5065e..9b30f4d60c6843ed0b744ac839123f3e05756bbf 100644 (file)
@@ -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
 
index a83b2b82e04324f7fc3048a9719c7c439ef194cd..69279929be622786b89cc4e514fca4ddf6de208d 100644 (file)
@@ -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
index 08ff410b406fd6e389543665cfce7abee9cebbfd..ace5f39cc2f3bb465b81d777d31d311f005ca1cb 100644 (file)
@@ -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