Fix mdrun -nb GPU on non-gpu builds
[alexxy/gromacs.git] / src / gromacs / taskassignment / decidegpuusage.h
index 3f67d36f3dd278e09508bcab74f08474e54b900e..34e61ffa9284bafb42da9d761200548990e33906 100644 (file)
@@ -68,11 +68,12 @@ enum class TaskTarget : int
  * user. So we need to consider this before any automated choice of
  * the number of thread-MPI ranks.
  *
- * \param[in]  nonbondedTarget           The user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
- * \param[in]  gpuIdsToUse               The compatible GPUs that the user permitted us to use.
- * \param[in]  userGpuTaskAssignment     The user-specified assignment of GPU tasks to device IDs.
- * \param[in]  emulateGpuNonbonded       Whether we will emulate GPU calculation of nonbonded interactions.
- * \param[in]  usingVerletScheme         Whether the nonbondeds are using the Verlet scheme.
+ * \param[in]  nonbondedTarget             The user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
+ * \param[in]  gpuIdsToUse                 The compatible GPUs that the user permitted us to use.
+ * \param[in]  userGpuTaskAssignment       The user-specified assignment of GPU tasks to device IDs.
+ * \param[in]  emulateGpuNonbonded         Whether we will emulate GPU calculation of nonbonded interactions.
+ * \param[in]  buildSupportsNonbondedOnGpu Whether GROMACS was built with GPU support.
+ * \param[in]  usingVerletScheme           Whether the nonbondeds are using the Verlet scheme.
  * \param[in]  nonbondedOnGpuIsUseful    Whether computing nonbonded interactions on a GPU is useful for this calculation.
  * \param[in]  numRanksPerSimulation     The number of ranks in each simulation.
  *
@@ -80,13 +81,14 @@ enum class TaskTarget : int
  *
  * \throws     std::bad_alloc          If out of memory
  *             InconsistentInputError  If the user requirements are inconsistent. */
-bool decideWhetherToUseGpusForNonbondedWithThreadMpi(TaskTarget                nonbondedTarget,
-                                                     const std::vector<int>   &gpuIdsToUse,
-                                                     const std::vector<int>   &userGpuTaskAssignment,
-                                                     EmulateGpuNonbonded       emulateGpuNonbonded,
-                                                     bool                      usingVerletScheme,
-                                                     bool                      nonbondedOnGpuIsUseful,
-                                                     int                       numRanksPerSimulation);
+bool decideWhetherToUseGpusForNonbondedWithThreadMpi(TaskTarget              nonbondedTarget,
+                                                     const std::vector<int> &gpuIdsToUse,
+                                                     const std::vector<int> &userGpuTaskAssignment,
+                                                     EmulateGpuNonbonded     emulateGpuNonbonded,
+                                                     bool                    buildSupportsNonbondedOnGpu,
+                                                     bool                    usingVerletScheme,
+                                                     bool                    nonbondedOnGpuIsUseful,
+                                                     int                     numRanksPerSimulation);
 
 /*! \brief Decide whether this thread-MPI simulation will run
  * PME tasks on GPUs.
@@ -132,23 +134,25 @@ bool decideWhetherToUseGpusForPmeWithThreadMpi(bool                    useGpuFor
  * decision is made in this routine, along with many more
  * consistency checks.
  *
- * \param[in]  nonbondedTarget           The user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
- * \param[in]  userGpuTaskAssignment     The user-specified assignment of GPU tasks to device IDs.
- * \param[in]  emulateGpuNonbonded       Whether we will emulate GPU calculation of nonbonded interactions.
- * \param[in]  usingVerletScheme         Whether the nonbondeds are using the Verlet scheme.
- * \param[in]  nonbondedOnGpuIsUseful    Whether computing nonbonded interactions on a GPU is useful for this calculation.
- * \param[in]  gpusWereDetected          Whether compatible GPUs were detected on any node.
+ * \param[in]  nonbondedTarget             The user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
+ * \param[in]  userGpuTaskAssignment       The user-specified assignment of GPU tasks to device IDs.
+ * \param[in]  emulateGpuNonbonded         Whether we will emulate GPU calculation of nonbonded interactions.
+ * \param[in]  buildSupportsNonbondedOnGpu Whether GROMACS was build with GPU support.
+ * \param[in]  usingVerletScheme           Whether the nonbondeds are using the Verlet scheme.
+ * \param[in]  nonbondedOnGpuIsUseful      Whether computing nonbonded interactions on a GPU is useful for this calculation.
+ * \param[in]  gpusWereDetected            Whether compatible GPUs were detected on any node.
  *
  * \returns    Whether the simulation will run nonbonded and PME tasks, respectively, on GPUs.
  *
  * \throws     std::bad_alloc          If out of memory
  *             InconsistentInputError  If the user requirements are inconsistent. */
-bool decideWhetherToUseGpusForNonbonded(TaskTarget                 nonbondedTarget,
-                                        const std::vector<int>    &userGpuTaskAssignment,
-                                        EmulateGpuNonbonded        emulateGpuNonbonded,
-                                        bool                       usingVerletScheme,
-                                        bool                       nonbondedOnGpuIsUseful,
-                                        bool                       gpusWereDetected);
+bool decideWhetherToUseGpusForNonbonded(TaskTarget              nonbondedTarget,
+                                        const std::vector<int> &userGpuTaskAssignment,
+                                        EmulateGpuNonbonded     emulateGpuNonbonded,
+                                        bool                    buildSupportsNonbondedOnGpu,
+                                        bool                    usingVerletScheme,
+                                        bool                    nonbondedOnGpuIsUseful,
+                                        bool                    gpusWereDetected);
 
 /*! \brief Decide whether the simulation will try to run tasks of
  * different types on GPUs.