Skip to content

Commit

Permalink
line 329 calculateenergy.cpp box dimensions do not need to be unique …
Browse files Browse the repository at this point in the history
…between threads.
  • Loading branch information
roryslange committed Jul 7, 2024
1 parent ff3f67a commit aeb2a21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CalculateEnergy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ CalculateEnergy::BoxForce(SystemPotential potential, XYZArray const &coords,
#if defined _OPENMP && _OPENMP >= 201511 // check if OpenMP version is 4.5
#pragma omp parallel for default(none) shared(boxAxes, cellStartIndex, \
cellVector, coords, mapParticleToCell, neighborList) \
firstprivate(box, atomCount, molCount, num::qqFact) \
//firstprivate(box, atomCount, molCount, num::qqFact)
reduction(+:tempREn, tempLJEn, aForcex[:atomCount], aForcey[:atomCount], \
aForcez[:atomCount], mForcex[:molCount], mForcey[:molCount], \
mForcez[:molCount])
Expand Down Expand Up @@ -1493,6 +1493,7 @@ void CalculateEnergy::SingleMoleculeInter(
const double lambdaNewCoulomb, const uint molIndex, const uint box) const {
double tempREnOld = 0.0, tempLJEnOld = 0.0;
double tempREnNew = 0.0, tempLJEnNew = 0.0;

if (box < BOXES_WITH_U_NB) {
uint length = mols.GetKind(molIndex).NumAtoms();
uint start = mols.MolStart(molIndex);
Expand All @@ -1516,6 +1517,7 @@ firstprivate(atom, box, lambdaNewCoulomb, lambdaOldCoulomb, lambdaOldVDW, \
lambdaNewVDW, num::qqFact) reduction(+:tempREnOld, tempLJEnOld, tempREnNew, \
tempLJEnNew)
#endif

for (int i = 0; i < (int)nIndex.size(); i++) {
double distSq = 0.0;
XYZ virComponents;
Expand Down

0 comments on commit aeb2a21

Please sign in to comment.