diff --git a/src/CellDecomposition.cu b/src/CellDecomposition.cu index a17133f823af62f5bf9047efd46b1d71ed3063da..a94137c764c9635a917e6d7c3bc22d803f213760 100644 --- a/src/CellDecomposition.cu +++ b/src/CellDecomposition.cu @@ -141,6 +141,7 @@ void make_rangesKernel(CellDecomposition::cell_t cells[], int tmp[], if (idx < num * numReplicas) { const int repID = cells[idx].repID; + assert(repID == idx/num); const int cellID = cells[idx].id + repID * numCells; // cellID in tmp array // Get positions in tmp array. @@ -156,14 +157,14 @@ void make_rangesKernel(CellDecomposition::cell_t cells[], int tmp[], const int prev_id = idx - 1; if (prev_id >= 0 - and cellID != cells[prev_id].id - and cells[prev_id].repID == repID) + and cells[prev_id].repID == repID + and cellID != cells[prev_id].id + repID * numCells) tmp[first] = idx; const int next_id = idx + 1; if (next_id < num * numReplicas - and cellID != cells[next_id].id - and cells[next_id].repID == repID) + and cells[next_id].repID == repID + and cellID != cells[next_id].id + repID * numCells) tmp[last] = idx + 1; } } diff --git a/src/ComputeForce.cu b/src/ComputeForce.cu index 4bc38245b85d6e6b49ec8a512fdfec49f5f8bc17..cd7bdcf7833b4c363423548c92ca581d0e3f199e 100644 --- a/src/ComputeForce.cu +++ b/src/ComputeForce.cu @@ -26,7 +26,7 @@ ComputeForce::ComputeForce(const Configuration& c, const int numReplicas = 1) : num(c.num), numParts(c.numParts), sys(c.sys), switchStart(c.switchStart), switchLen(c.switchLen), electricConst(c.coulombConst), cutoff2((c.switchLen + c.switchStart) * (c.switchLen + c.switchStart)), - decomp(c.sys->getBox(), c.sys->getOrigin(), c.switchStart + c.switchLen, numReplicas), + decomp(c.sys->getBox(), c.sys->getOrigin(), c.switchStart + c.switchLen + c.pairlistDistance, numReplicas), numBonds(c.numBonds), numTabBondFiles(c.numTabBondFiles), numExcludes(c.numExcludes), numAngles(c.numAngles), numTabAngleFiles(c.numTabAngleFiles), numDihedrals(c.numDihedrals), diff --git a/src/ComputeForce.cuh b/src/ComputeForce.cuh index 64ee8b1148dff16463eec3738f4791f152c21e5a..ce5c3c159a57dfee65eef1632efeb81983c56533 100644 --- a/src/ComputeForce.cuh +++ b/src/ComputeForce.cuh @@ -262,8 +262,8 @@ void createPairlists(Vector3* __restrict__ pos, const int num, const int numRepl // Vector3 posi = pos[ai]; // Same as for bonds, but for exclusions now - const int ex_start = (numExcludes > 0 && excludeMap != NULL) ? excludeMap[ai].x : -1; - const int ex_end = (numExcludes > 0 && excludeMap != NULL) ? excludeMap[ai].y : -1; + const int ex_start = (numExcludes > 0 && excludeMap != NULL) ? excludeMap[ai -repID*num].x : -1; + const int ex_end = (numExcludes > 0 && excludeMap != NULL) ? excludeMap[ai -repID*num].y : -1; for (int x = -1; x <= 1; ++x) { for (int y = -1; y <= 1; ++y) {