*
* \tparam jClusterSize The number of atoms in a j-cluster
* \tparam jSubClusterIndex The j-sub-cluster index (0/1), used when size(j-cluster) <
- * size(i-cluster) \param[in] ci The i-cluster index
+ * size(i-cluster)
+ * \param[in] ci The i-cluster index
*/
template<int jClusterSize, int jSubClusterIndex>
static inline int cjFromCi(int ci)
*
* \tparam layout The pair-list layout
* \tparam jSubClusterIndex The j-sub-cluster index (0/1), used when size(j-cluster) <
- * size(i-cluster) \param[in] ci The i-cluster index
+ * size(i-cluster)
+ * \param[in] ci The i-cluster index
*/
template<NbnxnLayout layout, int jSubClusterIndex>
static inline int cjFromCi(int ci)
isCpuType_(!sc_isGpuPairListType[pairlistParams.pairlistType])
{
- const int numLists = gmx_omp_nthreads_get(emntNonbonded);
+ const int numLists = gmx_omp_nthreads_get(ModuleMultiThread::Nonbonded);
if (!combineLists_ && numLists > NBNXN_BUFFERFLAG_MAX_THREADS)
{
fprintf(fp, "nbl nci %zu ncj %d\n", nbl.ci.size(), nbl.ncjInUse);
const int numAtomsJCluster = grid.geometry().numAtomsJCluster;
+
+ if (grid.numCells() == 0)
+ {
+ return;
+ }
+
const double numAtomsPerCell = nbl.ncjInUse / static_cast<double>(grid.numCells()) * numAtomsJCluster;
fprintf(fp,
"nbl na_cj %d rl %g ncp %d per cell %.1f atoms %.1f ratio %.2f\n",
"nbl average j cell list length %.1f\n",
0.25 * nbl.ncjInUse / std::max(static_cast<double>(nbl.ci.size()), 1.0));
- int cs[SHIFTS] = { 0 };
- int npexcl = 0;
+ int cs[gmx::c_numShiftVectors] = { 0 };
+ int npexcl = 0;
for (const nbnxn_ci_t& ciEntry : nbl.ci)
{
cs[ciEntry.shift & NBNXN_CI_SHIFT] += ciEntry.cj_ind_end - ciEntry.cj_ind_start;
nbl.cj.size(),
npexcl,
100 * npexcl / std::max(static_cast<double>(nbl.cj.size()), 1.0));
- for (int s = 0; s < SHIFTS; s++)
+ for (int s = 0; s < gmx::c_numShiftVectors; s++)
{
if (cs[s] > 0)
{
* \param[in] rbb2 The squared cut-off for putting cluster-pairs in the list based on bounding box distance only
* \param[in,out] numDistanceChecks The number of distance checks performed
*/
-static void makeClusterListSimple(const Grid& jGrid,
- NbnxnPairlistCpu* nbl,
- int icluster,
- int jclusterFirst,
- int jclusterLast,
- bool excludeSubDiagonal,
+static void makeClusterListSimple(const Grid& jGrid,
+ NbnxnPairlistCpu* nbl,
+ int icluster,
+ int jclusterFirst,
+ int jclusterLast,
+ bool excludeSubDiagonal,
const real* gmx_restrict x_j,
real rlist2,
float rbb2,
- int* gmx_restrict numDistanceChecks)
+ int* gmx_restrict numDistanceChecks)
{
const BoundingBox* gmx_restrict bb_ci = nbl->work->iClusterData.bb.data();
- const real* gmx_restrict x_ci = nbl->work->iClusterData.x.data();
+ const real* gmx_restrict x_ci = nbl->work->iClusterData.x.data();
bool InRange = false;
while (!InRange && jclusterFirst <= jclusterLast)
#ifndef DOXYGEN
template<typename CjListType>
JListRanges::JListRanges(int cjIndexStart, int cjIndexEnd, gmx::ArrayRef<const CjListType> cjList) :
- cjIndexStart(cjIndexStart),
- cjIndexEnd(cjIndexEnd)
+ cjIndexStart(cjIndexStart), cjIndexEnd(cjIndexEnd)
{
GMX_ASSERT(cjIndexEnd > cjIndexStart, "JListRanges should only be called with non-empty lists");
NbnxnPairlistCpu* nbl,
gmx_bool bDiagRemoved,
nbnxn_ci_t* nbl_ci,
- real gmx_unused shx,
- real gmx_unused shy,
- real gmx_unused shz,
- real gmx_unused rlist_fep2,
- const Grid& iGrid,
- const Grid& jGrid,
- t_nblist* nlist)
+ real gmx_unused shx,
+ real gmx_unused shy,
+ real gmx_unused shz,
+ real gmx_unused rlist_fep2,
+ const Grid& iGrid,
+ const Grid& jGrid,
+ t_nblist* nlist)
{
int gid_i = 0;
int gid_cj = 0;
* Sets all atom-pair exclusions from the topology stored in exclusions
* as masks in the pair-list for i-super-cluster list entry iEntry.
*/
-static void setExclusionsForIEntry(const Nbnxm::GridSet& gridSet,
- NbnxnPairlistGpu* nbl,
- gmx_bool diagRemoved,
+static void setExclusionsForIEntry(const Nbnxm::GridSet& gridSet,
+ NbnxnPairlistGpu* nbl,
+ gmx_bool diagRemoved,
int gmx_unused na_cj_2log,
const nbnxn_sci_t& iEntry,
const ListOfLists<int>& exclusions)
}
/* Close this simple list i entry */
-static void closeIEntry(NbnxnPairlistCpu* nbl,
- int gmx_unused sp_max_av,
+static void closeIEntry(NbnxnPairlistCpu* nbl,
+ int gmx_unused sp_max_av,
gmx_bool gmx_unused progBal,
- float gmx_unused nsp_tot_est,
- int gmx_unused thread,
- int gmx_unused nthread)
+ float gmx_unused nsp_tot_est,
+ int gmx_unused thread,
+ int gmx_unused nthread)
{
nbnxn_ci_t& ciEntry = nbl->ci.back();
}
/* Copies PBC shifted super-cell atom coordinates x,y,z to working array */
-static void icell_set_x(int ci,
- real shx,
- real shy,
- real shz,
- int stride,
- const real* x,
+static void icell_set_x(int ci,
+ real shx,
+ real shy,
+ real shz,
+ int stride,
+ const real* x,
ClusterDistanceKernelType gmx_unused kernelType,
NbnxnPairlistGpuWork* work)
{
/* Each thread should copy its own data to the combined arrays,
* as otherwise data will go back and forth between different caches.
*/
- const int gmx_unused nthreads = gmx_omp_nthreads_get(emntPairsearch);
+ const int gmx_unused nthreads = gmx_omp_nthreads_get(ModuleMultiThread::Pairsearch);
#pragma omp parallel for num_threads(nthreads) schedule(static)
for (gmx::index n = 0; n < nbls.ssize(); n++)
const int nrj_target = (nrj_tot + numLists - 1) / numLists;
- GMX_ASSERT(gmx_omp_nthreads_get(emntNonbonded) == numLists,
+ GMX_ASSERT(gmx_omp_nthreads_get(ModuleMultiThread::Nonbonded) == numLists,
"We should have as many work objects as FEP lists");
#pragma omp parallel for schedule(static) num_threads(numLists)
}
}
-static void makeClusterListWrapper(NbnxnPairlistGpu* nbl,
- const Grid& gmx_unused iGrid,
- const int ci,
- const Grid& jGrid,
- const int firstCell,
- const int lastCell,
- const bool excludeSubDiagonal,
- const nbnxn_atomdata_t* nbat,
- const real rlist2,
- const real rbb2,
+static void makeClusterListWrapper(NbnxnPairlistGpu* nbl,
+ const Grid& gmx_unused iGrid,
+ const int ci,
+ const Grid& jGrid,
+ const int firstCell,
+ const int lastCell,
+ const bool excludeSubDiagonal,
+ const nbnxn_atomdata_t* nbat,
+ const real rlist2,
+ const real rbb2,
ClusterDistanceKernelType gmx_unused kernelType,
int* numDistanceChecks)
{
}
static void setBufferFlags(const NbnxnPairlistGpu gmx_unused& nbl,
- int gmx_unused ncj_old_j,
- int gmx_unused gridj_flag_shift,
+ int gmx_unused ncj_old_j,
+ int gmx_unused gridj_flag_shift,
gmx_bitmask_t gmx_unused* gridj_flag,
- int gmx_unused th)
+ int gmx_unused th)
{
GMX_ASSERT(false, "This function should never be called");
}
for (int tx = -shp[XX]; tx <= shp[XX]; tx++)
{
- const int shift = XYZ2IS(tx, ty, tz);
+ const int shift = xyzToShiftIndex(tx, ty, tz);
- const bool excludeSubDiagonal = (isIntraGridList && shift == CENTRAL);
+ const bool excludeSubDiagonal = (isIntraGridList && shift == gmx::c_centralShiftIndex);
- if (c_pbcShiftBackward && isIntraGridList && shift > CENTRAL)
+ if (c_pbcShiftBackward && isIntraGridList && shift > gmx::c_centralShiftIndex)
{
continue;
}
/* When true, leave the pairs with i > j.
* Skip half of y when i and j have the same x.
*/
- const bool skipHalfY =
- (isIntraGridList && cx == 0
- && (!c_pbcShiftBackward || shift == CENTRAL) && cyf < ci_y);
- const int cyf_x = skipHalfY ? ci_y : cyf;
+ const bool skipHalfY = (isIntraGridList && cx == 0
+ && (!c_pbcShiftBackward || shift == gmx::c_centralShiftIndex)
+ && cyf < ci_y);
+ const int cyf_x = skipHalfY ? ci_y : cyf;
for (int cy = cyf_x; cy <= cyl; cy++)
{
*/
int midCell =
columnStart
- + static_cast<int>(bz1_frac
- * static_cast<real>(columnEnd - columnStart));
+ + static_cast<int>(
+ bz1_frac * static_cast<real>(columnEnd - columnStart));
if (midCell >= columnEnd)
{
midCell = columnEnd - 1;
/* We want each atom/cell pair only once,
* only use cj >= ci.
*/
- if (!c_pbcShiftBackward || shift == CENTRAL)
+ if (!c_pbcShiftBackward || shift == gmx::c_centralShiftIndex)
{
firstCell = std::max(firstCell, ci);
}
* When setFlags==true, flag bit t is set in flag for all i and j clusters.
*/
template<bool setFlags>
-static void copySelectedListRange(const nbnxn_ci_t* gmx_restrict srcCi,
+static void copySelectedListRange(const nbnxn_ci_t* gmx_restrict srcCi,
const NbnxnPairlistCpu* gmx_restrict src,
- NbnxnPairlistCpu* gmx_restrict dest,
- gmx_bitmask_t* flag,
- int iFlagShift,
- int jFlagShift,
- int t)
+ NbnxnPairlistCpu* gmx_restrict dest,
+ gmx_bitmask_t* flag,
+ int iFlagShift,
+ int jFlagShift,
+ int t)
{
const int ncj = srcCi->cj_ind_end - srcCi->cj_ind_start;