}
Grid::Grid(const PairlistType pairlistType, const bool& haveFep) :
- geometry_(pairlistType),
- haveFep_(haveFep)
+ geometry_(pairlistType), haveFep_(haveFep)
{
}
* sort should have a size of at least n_per_h*c_sortGridRatio + n,
* or easier, allocate at least n*c_sortGridMaxSizeFactor elements.
*/
-static void sort_atoms(int dim,
- gmx_bool Backwards,
- int gmx_unused dd_zone,
+static void sort_atoms(int dim,
+ gmx_bool Backwards,
+ int gmx_unused dd_zone,
bool gmx_unused relevantAtomsAreWithinGridBounds,
int* a,
int n,
ba[YY] += bb.upper.y - bb.lower.y;
ba[ZZ] += bb.upper.z - bb.lower.z;
}
- dsvmul(1.0 / grid.numCells(), ba, ba);
+ if (grid.numCells() > 0)
+ {
+ dsvmul(1.0 / grid.numCells(), ba, ba);
+ }
const Grid::Dimensions& dims = grid.dimensions();
real avgCellSizeZ =
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",
* \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)
{
}
}
-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");
}
*/
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;
* 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;