Rename some enum names in ModuleMultiThread
authorJoe Jordan <ejjordan12@gmail.com>
Wed, 21 Apr 2021 00:36:10 +0000 (00:36 +0000)
committerPascal Merz <pascal.merz@me.com>
Wed, 21 Apr 2021 00:36:10 +0000 (00:36 +0000)
src/gromacs/ewald/pme_gpu.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/gmx_omp_nthreads.cpp
src/gromacs/mdlib/gmx_omp_nthreads.h
src/gromacs/mdlib/lincs.cpp
src/gromacs/mdlib/tests/constrtestrunners.cpp
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdrun/runner.cpp

index 45c6da6b83f826d78dbb8b9305d6ab8b04035e65..084bb3f6cc53f81355e63e7e225006b25304601c 100644 (file)
@@ -294,7 +294,7 @@ static void sum_forces(gmx::ArrayRef<gmx::RVec> f, gmx::ArrayRef<const gmx::RVec
 {
     const int end = forceToAdd.size();
 
-    int gmx_unused nt = gmx_omp_nthreads_get(ModuleMultiThread::PME);
+    int gmx_unused nt = gmx_omp_nthreads_get(ModuleMultiThread::Pme);
 #pragma omp parallel for num_threads(nt) schedule(static)
     for (int i = 0; i < end; i++)
     {
index 70559e6d35dd55377279bbe34c3da5146ace32a7..ecaaa2c85f5a0b1e92e2c8f8bd819e71afc5407d 100644 (file)
@@ -459,7 +459,7 @@ bool Constraints::Impl::apply(bool                      bLog,
 
     if (nsettle > 0)
     {
-        nth = gmx_omp_nthreads_get(ModuleMultiThread::SETTLE);
+        nth = gmx_omp_nthreads_get(ModuleMultiThread::Settle);
     }
     else
     {
@@ -1200,7 +1200,7 @@ Constraints::Impl::Impl(const gmx_mtop_t&     mtop_p,
         }
 
         /* Allocate thread-local work arrays */
-        int nthreads = gmx_omp_nthreads_get(ModuleMultiThread::SETTLE);
+        int nthreads = gmx_omp_nthreads_get(ModuleMultiThread::Settle);
         if (nthreads > 1 && threadConstraintsVirial == nullptr)
         {
             snew(threadConstraintsVirial, nthreads);
index 881ea7c676b8a159b958dd1f2dd82d975c6fd6c4..6d94b641cf5295cb3df9f24051e7f7161370456c 100644 (file)
@@ -159,7 +159,7 @@ static void pick_module_nthreads(const gmx::MDLogger& mdlog, ModuleMultiThread m
         }
 
         /* only babble if we are really overriding with a different value */
-        if ((bSepPME && m == ModuleMultiThread::PME && nth != modth.gnth_pme) || (nth != modth.gnth))
+        if ((bSepPME && m == ModuleMultiThread::Pme && nth != modth.gnth_pme) || (nth != modth.gnth))
         {
             GMX_LOG(mdlog.warning)
                     .asParagraph()
@@ -173,7 +173,7 @@ static void pick_module_nthreads(const gmx::MDLogger& mdlog, ModuleMultiThread m
     {
         /* pick the global PME node nthreads if we are setting the number
          * of threads in separate PME nodes  */
-        nth = (bSepPME && m == ModuleMultiThread::PME) ? modth.gnth_pme : modth.gnth;
+        nth = (bSepPME && m == ModuleMultiThread::Pme) ? modth.gnth_pme : modth.gnth;
     }
 
     gmx_omp_nthreads_set(m, nth);
@@ -354,11 +354,11 @@ static void manage_number_of_openmp_threads(const gmx::MDLogger& mdlog,
     pick_module_nthreads(mdlog, ModuleMultiThread::Pairsearch, bSepPME);
     pick_module_nthreads(mdlog, ModuleMultiThread::Nonbonded, bSepPME);
     pick_module_nthreads(mdlog, ModuleMultiThread::Bonded, bSepPME);
-    pick_module_nthreads(mdlog, ModuleMultiThread::PME, bSepPME);
+    pick_module_nthreads(mdlog, ModuleMultiThread::Pme, bSepPME);
     pick_module_nthreads(mdlog, ModuleMultiThread::Update, bSepPME);
-    pick_module_nthreads(mdlog, ModuleMultiThread::VSITE, bSepPME);
-    pick_module_nthreads(mdlog, ModuleMultiThread::LINCS, bSepPME);
-    pick_module_nthreads(mdlog, ModuleMultiThread::SETTLE, bSepPME);
+    pick_module_nthreads(mdlog, ModuleMultiThread::VirtualSite, bSepPME);
+    pick_module_nthreads(mdlog, ModuleMultiThread::Lincs, bSepPME);
+    pick_module_nthreads(mdlog, ModuleMultiThread::Settle, bSepPME);
 
     /* set the number of threads globally */
     if (bOMP)
index e42e4874eab2c01d15d28a1b6ee35db2ac097f3d..1b87c113b65e72d4956288807bed00c039074895 100644 (file)
@@ -58,11 +58,11 @@ enum class ModuleMultiThread : int
     Pairsearch,
     Nonbonded,
     Bonded,
-    PME,
+    Pme,
     Update,
-    VSITE,
-    LINCS,
-    SETTLE,
+    VirtualSite,
+    Lincs,
+    Settle,
     Count
 };
 
index 24b6a63a4310c9667ee01292a16d7e44946891a5..093ff1bec170985b91bd0e6d0f2b5cc173520723 100644 (file)
@@ -1505,7 +1505,7 @@ Lincs* init_lincs(FILE*                            fplog,
      * The current constraint to task assignment code can create independent
      * tasks only when not more than two constraints are connected sequentially.
      */
-    li->ntask    = gmx_omp_nthreads_get(ModuleMultiThread::LINCS);
+    li->ntask    = gmx_omp_nthreads_get(ModuleMultiThread::Lincs);
     li->bTaskDep = (li->ntask > 1 && bMoreThanTwoSeq);
     if (debug)
     {
index e2fa3db58aa32d67c7f7fc26d337fcfccf61389d..608e05a2b73d41d0e72ae2c7519dbae93cbbc3c9 100644 (file)
@@ -111,7 +111,7 @@ void LincsConstraintsRunner::applyConstraints(ConstraintsTestData* testData, t_p
     Lincs* lincsd;
     int    maxwarn         = 100;
     int    warncount_lincs = 0;
-    gmx_omp_nthreads_set(ModuleMultiThread::LINCS, 1);
+    gmx_omp_nthreads_set(ModuleMultiThread::Lincs, 1);
 
     // Communication record
     t_commrec cr;
index 0fed027437d7e69d0f9d557f2baa42568544db91..1133c538c86d183df3de707100ea96a5abf91a13 100644 (file)
@@ -2606,7 +2606,7 @@ std::unique_ptr<VirtualSitesHandler> makeVirtualSitesHandler(const gmx_mtop_t& m
     return std::make_unique<VirtualSitesHandler>(mtop, cr->dd, pbcType);
 }
 
-ThreadingInfo::ThreadingInfo() : numThreads_(gmx_omp_nthreads_get(ModuleMultiThread::VSITE))
+ThreadingInfo::ThreadingInfo() : numThreads_(gmx_omp_nthreads_get(ModuleMultiThread::VirtualSite))
 {
     if (numThreads_ > 1)
     {
index 21876ff0c7d7520ef3b0289e090853706d7fd5bc..1f8d599bc5ce24d3c6af3f7a9ea202bc764cb0f5 100644 (file)
@@ -753,7 +753,7 @@ static void finish_run(FILE*                     fplog,
      * mechanism to keep cycle counting working during the transition
      * to task parallelism. */
     int nthreads_pp  = gmx_omp_nthreads_get(ModuleMultiThread::Nonbonded);
-    int nthreads_pme = gmx_omp_nthreads_get(ModuleMultiThread::PME);
+    int nthreads_pme = gmx_omp_nthreads_get(ModuleMultiThread::Pme);
     wallcycle_scale_by_num_threads(
             wcycle, thisRankHasDuty(cr, DUTY_PME) && !thisRankHasDuty(cr, DUTY_PP), nthreads_pp, nthreads_pme);
     auto cycle_sum(wallcycle_sum(cr, wcycle));
@@ -1565,7 +1565,7 @@ int Mdrunner::mdrunner()
      */
     const int numThreadsOnThisRank = thisRankHasDuty(cr, DUTY_PP)
                                              ? gmx_omp_nthreads_get(ModuleMultiThread::Nonbonded)
-                                             : gmx_omp_nthreads_get(ModuleMultiThread::PME);
+                                             : gmx_omp_nthreads_get(ModuleMultiThread::Pme);
     checkHardwareOversubscription(
             numThreadsOnThisRank, cr->nodeid, *hwinfo_->hardwareTopology, physicalNodeComm, mdlog);
 
@@ -1838,7 +1838,7 @@ int Mdrunner::mdrunner()
                                        mdrunOptions.reproducible,
                                        ewaldcoeff_q,
                                        ewaldcoeff_lj,
-                                       gmx_omp_nthreads_get(ModuleMultiThread::PME),
+                                       gmx_omp_nthreads_get(ModuleMultiThread::Pme),
                                        pmeRunMode,
                                        nullptr,
                                        deviceContext,
@@ -2044,7 +2044,7 @@ int Mdrunner::mdrunner()
     {
         GMX_RELEASE_ASSERT(pmedata, "pmedata was NULL while cr->duty was not DUTY_PP");
         /* do PME only */
-        walltime_accounting = walltime_accounting_init(gmx_omp_nthreads_get(ModuleMultiThread::PME));
+        walltime_accounting = walltime_accounting_init(gmx_omp_nthreads_get(ModuleMultiThread::Pme));
         gmx_pmeonly(pmedata,
                     cr,
                     &nrnb,