From: Joe Jordan Date: Wed, 21 Apr 2021 00:36:10 +0000 (+0000) Subject: Rename some enum names in ModuleMultiThread X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=0205e2438f171cab071a39d7ce456b74809c7240;p=alexxy%2Fgromacs.git Rename some enum names in ModuleMultiThread --- diff --git a/src/gromacs/ewald/pme_gpu.cpp b/src/gromacs/ewald/pme_gpu.cpp index 45c6da6b83..084bb3f6cc 100644 --- a/src/gromacs/ewald/pme_gpu.cpp +++ b/src/gromacs/ewald/pme_gpu.cpp @@ -294,7 +294,7 @@ static void sum_forces(gmx::ArrayRef f, gmx::ArrayRef 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); diff --git a/src/gromacs/mdlib/gmx_omp_nthreads.cpp b/src/gromacs/mdlib/gmx_omp_nthreads.cpp index 881ea7c676..6d94b641cf 100644 --- a/src/gromacs/mdlib/gmx_omp_nthreads.cpp +++ b/src/gromacs/mdlib/gmx_omp_nthreads.cpp @@ -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) diff --git a/src/gromacs/mdlib/gmx_omp_nthreads.h b/src/gromacs/mdlib/gmx_omp_nthreads.h index e42e4874ea..1b87c113b6 100644 --- a/src/gromacs/mdlib/gmx_omp_nthreads.h +++ b/src/gromacs/mdlib/gmx_omp_nthreads.h @@ -58,11 +58,11 @@ enum class ModuleMultiThread : int Pairsearch, Nonbonded, Bonded, - PME, + Pme, Update, - VSITE, - LINCS, - SETTLE, + VirtualSite, + Lincs, + Settle, Count }; diff --git a/src/gromacs/mdlib/lincs.cpp b/src/gromacs/mdlib/lincs.cpp index 24b6a63a43..093ff1bec1 100644 --- a/src/gromacs/mdlib/lincs.cpp +++ b/src/gromacs/mdlib/lincs.cpp @@ -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) { diff --git a/src/gromacs/mdlib/tests/constrtestrunners.cpp b/src/gromacs/mdlib/tests/constrtestrunners.cpp index e2fa3db58a..608e05a2b7 100644 --- a/src/gromacs/mdlib/tests/constrtestrunners.cpp +++ b/src/gromacs/mdlib/tests/constrtestrunners.cpp @@ -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; diff --git a/src/gromacs/mdlib/vsite.cpp b/src/gromacs/mdlib/vsite.cpp index 0fed027437..1133c538c8 100644 --- a/src/gromacs/mdlib/vsite.cpp +++ b/src/gromacs/mdlib/vsite.cpp @@ -2606,7 +2606,7 @@ std::unique_ptr makeVirtualSitesHandler(const gmx_mtop_t& m return std::make_unique(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) { diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 21876ff0c7..1f8d599bc5 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -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,