Disable GPU update in the presence of frozen atoms
authorAndrey Alekseenko <al42and@gmail.com>
Wed, 10 Mar 2021 05:55:30 +0000 (05:55 +0000)
committerArtem Zhmurov <zhmurov@gmail.com>
Wed, 10 Mar 2021 05:55:30 +0000 (05:55 +0000)
There is a known bug (Issue #3920) affecting GPU update when frozen
atoms are present. While the bug is being resolved, we mark such
configuration as not allowed.

Refs #3920

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

index 5d3738967031ce4f5aa2c6c8d32dd76b17c9e383..725165f59ef3e1bda76f2f68700d0986e4afec39 100644 (file)
@@ -1373,6 +1373,7 @@ int Mdrunner::mdrunner()
                                                          doEssentialDynamics,
                                                          gmx_mtop_ftype_count(mtop, F_ORIRES) > 0,
                                                          replExParams.exchangeInterval > 0,
+                                                         inputrec->opts.nFreeze != nullptr,
                                                          doRerun,
                                                          devFlags,
                                                          mdlog);
index a2dd4b5d211afca81adedc37f6f9286e7012a31a..ba2e3563c8149dbd15ee08fe010608737041634c 100644 (file)
@@ -544,6 +544,7 @@ bool decideWhetherToUseGpuForUpdate(const bool                     isDomainDecom
                                     const bool                     useEssentialDynamics,
                                     const bool                     doOrientationRestraints,
                                     const bool                     useReplicaExchange,
+                                    const bool                     haveFrozenAtoms,
                                     const bool                     doRerun,
                                     const DevelopmentFeatureFlags& devFlags,
                                     const gmx::MDLogger&           mdlog)
@@ -686,6 +687,11 @@ bool decideWhetherToUseGpuForUpdate(const bool                     isDomainDecom
                 "The number of coupled constraints is higher than supported in the GPU LINCS "
                 "code.\n";
     }
+    if (haveFrozenAtoms)
+    {
+        // There is a known bug with frozen atoms and GPU update, see Issue #3920.
+        errorMessage += "Frozen atoms not supported.\n";
+    }
 
     if (!errorMessage.empty())
     {
index b5fd83907fae8e834cfb18bd137a20ef8ea5b210..765636c448dec7cb1f69c683270c0bfc1b3322f6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -278,6 +278,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]  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.
  * \param[in]  mdlog                        MD logger.
@@ -298,6 +299,7 @@ bool decideWhetherToUseGpuForUpdate(bool                           isDomainDecom
                                     bool                           useEssentialDynamics,
                                     bool                           doOrientationRestraints,
                                     bool                           useReplicaExchange,
+                                    bool                           haveFrozenAtoms,
                                     bool                           doRerun,
                                     const DevelopmentFeatureFlags& devFlags,
                                     const gmx::MDLogger&           mdlog);