Report if update is running on the GPU or on the CPU
authorArtem Zhmurov <zhmurov@gmail.com>
Fri, 10 Jan 2020 16:37:34 +0000 (17:37 +0100)
committerChristian Blau <cblau@gerrit.gromacs.org>
Mon, 13 Jan 2020 10:52:41 +0000 (11:52 +0100)
This adds a line which states where update is offloaded next
to the rest of the GPU usage information.

Fixes #3292.

Change-Id: Ie6b076c4309c7695ab9b46037ced92e95dea1558

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

index 58c12d092d594f20d51e96aed45b106255aefd19..31935fd77f6abd94f9d60aba9c388dd5c343a5cf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011-2019, by the GROMACS development team, led by
+ * Copyright (c) 2011-2019,2020, 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.
@@ -1150,16 +1150,6 @@ int Mdrunner::mdrunner()
             // algorithm is active, but currently does not.
             EEL_PME(inputrec->coulombtype) && thisRankHasDuty(cr, DUTY_PME));
 
-    const bool printHostName = (cr->nnodes > 1);
-    gpuTaskAssignments.reportGpuUsage(mdlog, printHostName, useGpuForBonded, pmeRunMode);
-
-    // If the user chose a task assignment, give them some hints
-    // where appropriate.
-    if (!userGpuTaskAssignment.empty())
-    {
-        gpuTaskAssignments.logPerformanceHints(mdlog, ssize(gpuIdsToUse));
-    }
-
     // Get the device handles for the modules, nullptr when no task is assigned.
     gmx_device_info_t* nonbondedDeviceInfo = gpuTaskAssignments.initNonbondedDevice(cr);
     gmx_device_info_t* pmeDeviceInfo       = gpuTaskAssignments.initPmeDevice();
@@ -1198,6 +1188,16 @@ int Mdrunner::mdrunner()
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR
 
+    const bool printHostName = (cr->nnodes > 1);
+    gpuTaskAssignments.reportGpuUsage(mdlog, printHostName, useGpuForBonded, pmeRunMode, useGpuForUpdate);
+
+    // If the user chose a task assignment, give them some hints
+    // where appropriate.
+    if (!userGpuTaskAssignment.empty())
+    {
+        gpuTaskAssignments.logPerformanceHints(mdlog, ssize(gpuIdsToUse));
+    }
+
     if (PAR(cr))
     {
         /* After possible communicator splitting in make_dd_communicators.
index 7861cbafb161355eacad11421ee78c90e7a10498..680ce4d31522d68dea137fd3b777a0d5679015c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, 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.
@@ -87,7 +87,8 @@ void reportGpuUsage(const MDLogger&                   mdlog,
                     size_t                            numRanks,
                     bool                              printHostName,
                     bool                              useGpuForBonded,
-                    PmeRunMode                        pmeRunMode)
+                    PmeRunMode                        pmeRunMode,
+                    bool                              useGpuForUpdate)
 {
     size_t numGpusInUse = countUniqueGpuIdsUsed(gpuTaskAssignmentOnRanksOfThisNode);
     if (numGpusInUse == 0)
@@ -145,6 +146,8 @@ void reportGpuUsage(const MDLogger&                   mdlog,
         {
             output += gmx::formatString("PME tasks will do all aspects on the GPU\n");
         }
+        output += gmx::formatString("Coordinates will be updated and constrained on the %s.",
+                                    useGpuForUpdate ? "GPU" : "CPU");
     }
 
     /* NOTE: this print is only for and on one physical node */
index 82252f152a329b17f106f31bbb5c2d8d9d9f61d3..dd07a1469b783aa6db38588484e7ae758b5929d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, 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.
@@ -72,8 +72,9 @@ using GpuTaskAssignment = std::vector<GpuTaskMapping>;
  * \param[in]  numGpuTasksOnThisNode               The number of GPU tasks on this node.
  * \param[in]  numPpRanks                          Number of PP ranks on this node
  * \param[in]  printHostName                       Print the hostname in the usage information
- * \param[in]  useGpuForBonded                     Whether GPU PP tasks will do bonded work on the
- * GPU \param[in]  pmeRunMode                          Describes the execution of PME tasks
+ * \param[in]  useGpuForBonded                     Whether GPU PP tasks will do bonded work on GPU
+ * \param[in]  pmeRunMode                          Describes the execution of PME tasks
+ * \param[in]  useGpuForUpdate                     Whether update will run on the GPU.
  *
  * \throws     std::bad_alloc if out of memory */
 void reportGpuUsage(const MDLogger&                   mdlog,
@@ -82,7 +83,8 @@ void reportGpuUsage(const MDLogger&                   mdlog,
                     size_t                            numPpRanks,
                     bool                              printHostName,
                     bool                              useGpuForBonded,
-                    PmeRunMode                        pmeRunMode);
+                    PmeRunMode                        pmeRunMode,
+                    bool                              useGpuForUpdate);
 
 } // namespace gmx
 
index eb529cb07f70dd4d433f5e153b158cd7a2e4b296..3899d5616e8f0f840a2949332185d0fd79247923 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, 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.
@@ -381,10 +381,11 @@ GpuTaskAssignments::GpuTaskAssignments(const gmx_hw_info_t& hardwareInfo) :
 void GpuTaskAssignments::reportGpuUsage(const MDLogger& mdlog,
                                         bool            printHostName,
                                         bool            useGpuForBonded,
-                                        PmeRunMode      pmeRunMode)
+                                        PmeRunMode      pmeRunMode,
+                                        bool            useGpuForUpdate)
 {
     gmx::reportGpuUsage(mdlog, assignmentForAllRanksOnThisNode_, numGpuTasksOnThisNode_,
-                        numRanksOnThisNode_, printHostName, useGpuForBonded, pmeRunMode);
+                        numRanksOnThisNode_, printHostName, useGpuForBonded, pmeRunMode, useGpuForUpdate);
 }
 
 gmx_device_info_t* GpuTaskAssignments::initNonbondedDevice(const t_commrec* cr) const
index 749d91bef37d9d14179d649284bacdd84f4242ba..899666fbdd33bd7d8986ab1d22be0b7b64f21d0b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019,2020, 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.
@@ -220,12 +220,19 @@ public:
      * and in what way.
      *
      * \param[in]  mdlog           Logging object.
-     * \param[in]  printHostName   Print the hostname in the usage information
-     * \param[in]  useGpuForBonded Whether GPU PP tasks will do bonded work on the GPU
-     * \param[in]  pmeRunMode      Describes the execution of PME tasks
+     * \param[in]  printHostName   Print the hostname in the usage information.
+     * \param[in]  useGpuForBonded Whether GPU PP tasks will do bonded work on the GPU.
+     * \param[in]  pmeRunMode      Describes the execution of PME tasks.
+     * \param[in]  useGpuForUpdate Whether the update is offloaded on the GPU.
      *
-     * \throws     std::bad_alloc if out of memory */
-    void reportGpuUsage(const MDLogger& mdlog, bool printHostName, bool useGpuForBonded, PmeRunMode pmeRunMode);
+     * \throws     std::bad_alloc if out of memory
+     */
+    void reportGpuUsage(const MDLogger& mdlog,
+                        bool            printHostName,
+                        bool            useGpuForBonded,
+                        PmeRunMode      pmeRunMode,
+                        bool            useGpuForUpdate);
+
     /*! \brief Logs to \c mdlog information that may help a user
      * learn how to let mdrun make a task assignment that runs
      * faster.