NAMD
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ComputeNonbondedPair Class Reference

#include <ComputeNonbondedPair.h>

Inheritance diagram for ComputeNonbondedPair:
ComputePatchPair ComputeNonbondedUtil Compute

Public Member Functions

 ComputeNonbondedPair (ComputeID c, PatchID pid[], int trans[], ComputeNonbondedWorkArrays *_workArrays, int minPartition=0, int maxPartition=1, int numPartitions=1)
 
 ~ComputeNonbondedPair ()
 
- Public Member Functions inherited from ComputePatchPair
 ComputePatchPair (ComputeID c, PatchID pid[], int t[])
 
virtual ~ComputePatchPair ()
 
virtual void atomUpdate ()
 
virtual void doWork ()
 
- Public Member Functions inherited from Compute
 Compute (ComputeID)
 
int type ()
 
virtual ~Compute ()
 
void setNumPatches (int n)
 
int getNumPatches ()
 
virtual void patchReady (PatchID, int doneMigration, int seq)
 
virtual void finishPatch (int)
 
int sequence (void)
 
int priority (void)
 
int getGBISPhase (void)
 
virtual void gbisP2PatchReady (PatchID, int seq)
 
virtual void gbisP3PatchReady (PatchID, int seq)
 

Public Attributes

nonbonded params
 
GBISParamStruct gbisParams
 
- Public Attributes inherited from Compute
const ComputeID cid
 
LDObjHandle ldObjHandle
 
LocalWorkMsg *const localWorkMsg
 

Protected Member Functions

virtual void initialize ()
 
virtual int noWork ()
 
virtual void doForce (CompAtom *p[2], CompAtomExt *pExt[2], Results *r[2])
 
- Protected Member Functions inherited from Compute
void enqueueWork ()
 

Protected Attributes

Box< Patch, CompAtom > * avgPositionBox [2]
 
Box< Patch, CompAtom > * velocityBox [2]
 
RealintRad [2]
 
Box< Patch, Real > * intRadBox [2]
 
Box< Patch, GBReal > * psiSumBox [2]
 
Box< Patch, Real > * bornRadBox [2]
 
Box< Patch, GBReal > * dEdaSumBox [2]
 
Box< Patch, Real > * dHdrPrefixBox [2]
 
Pairlists gbisStepPairlists [numGBISPairlists]
 
BigReal reductionData [reductionDataSize]
 
SubmitReductionreduction
 
SubmitReductionpressureProfileReduction
 
BigRealpressureProfileData
 
ComputeNonbondedWorkArrays *const workArrays
 
Pairlists pairlists
 
int pairlistsValid
 
BigReal pairlistTolerance
 
int minPart
 
int maxPart
 
int numParts
 
- Protected Attributes inherited from ComputePatchPair
int numAtoms [2]
 
CompAtomExtpExt [2]
 
CompAtomp [2]
 
Resultsr [2]
 
Patchpatch [2]
 
PatchID patchID [2]
 
int trans [2]
 
Box< Patch, CompAtom > * positionBox [2]
 
Box< Patch, Results > * forceBox [2]
 
- Protected Attributes inherited from Compute
int computeType
 
int basePriority
 
int gbisPhase
 
int gbisPhasePriority [3]
 

Static Protected Attributes

static const int numGBISPairlists = 4
 

Detailed Description

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 14 of file ComputeNonbondedPair.h.

Constructor & Destructor Documentation

◆ ComputeNonbondedPair()

ComputeNonbondedPair::ComputeNonbondedPair ( ComputeID  c,
PatchID  pid[],
int  trans[],
ComputeNonbondedWorkArrays _workArrays,
int  minPartition = 0,
int  maxPartition = 1,
int  numPartitions = 1 
)

Definition at line 25 of file ComputeNonbondedPair.C.

References Node::Object(), ReductionMgr::Object(), pairlistsValid, pairlistTolerance, Node::parameters, nonbonded::parameters, params, ComputeNonbondedUtil::pressureProfileAtomTypes, pressureProfileData, ComputeNonbondedUtil::pressureProfileOn, pressureProfileReduction, ComputeNonbondedUtil::pressureProfileSlabs, Node::rand, nonbonded::random, reduction, REDUCTIONS_BASIC, REDUCTIONS_PPROF_NONBONDED, Node::simParameters, nonbonded::simParameters, and ReductionMgr::willSubmit().

28  : ComputePatchPair(c,pid,trans), workArrays(_workArrays),
29  minPart(minPartition), maxPart(maxPartition), numParts(numPartitions)
30 {
32  if (pressureProfileOn) {
33  int n = pressureProfileAtomTypes;
37  } else {
39  pressureProfileData = NULL;
40  }
41  pairlistsValid = 0;
42  pairlistTolerance = 0.;
46 }
static Node * Object()
Definition: Node.h:86
Parameters * parameters
SimParameters * simParameters
Definition: Node.h:181
ComputeNonbondedWorkArrays *const workArrays
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:366
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:279
SimParameters * simParameters
SubmitReduction * pressureProfileReduction
Parameters * parameters
Definition: Node.h:180
SubmitReduction * reduction
Random * rand
Definition: Node.h:175
ComputePatchPair(ComputeID c, PatchID pid[], int t[])
double BigReal
Definition: common.h:123

◆ ~ComputeNonbondedPair()

ComputeNonbondedPair::~ComputeNonbondedPair ( )

Definition at line 82 of file ComputeNonbondedPair.C.

References avgPositionBox, bornRadBox, dEdaSumBox, dHdrPrefixBox, intRadBox, ComputePatchPair::patch, pressureProfileData, pressureProfileReduction, psiSumBox, reduction, Patch::unregisterAvgPositionPickup(), Patch::unregisterBornRadPickup(), Patch::unregisterDEdaSumDeposit(), Patch::unregisterDHdrPrefixPickup(), Patch::unregisterIntRadPickup(), Patch::unregisterPsiSumDeposit(), Patch::unregisterVelocityPickup(), and velocityBox.

83 {
84  delete reduction;
86  delete [] pressureProfileData;
87  for (int i=0; i<2; i++) {
88  if (avgPositionBox[i] != NULL) {
90  }
91  // BEGIN LA
92  if (velocityBox[i] != NULL) {
94  }
95  // END LA
96 
97  if (psiSumBox[i] != NULL) {
99  }
100  if (intRadBox[i] != NULL) {
101  patch[i]->unregisterIntRadPickup(this,&intRadBox[i]);
102  }
103  if (bornRadBox[i] != NULL) {
105  }
106  if (dEdaSumBox[i] != NULL) {
108  }
109  if (dHdrPrefixBox[i] != NULL) {
111  }
112  }
113 }
void unregisterAvgPositionPickup(Compute *cid, Box< Patch, CompAtom > **const box)
Definition: Patch.C:139
Box< Patch, Real > * dHdrPrefixBox[2]
void unregisterPsiSumDeposit(Compute *cid, Box< Patch, GBReal > **const box)
Definition: Patch.C:173
Box< Patch, Real > * intRadBox[2]
void unregisterDHdrPrefixPickup(Compute *cid, Box< Patch, Real > **const box)
Definition: Patch.C:221
SubmitReduction * pressureProfileReduction
Box< Patch, CompAtom > * avgPositionBox[2]
Box< Patch, CompAtom > * velocityBox[2]
Box< Patch, GBReal > * psiSumBox[2]
Box< Patch, Real > * bornRadBox[2]
Box< Patch, GBReal > * dEdaSumBox[2]
void unregisterBornRadPickup(Compute *cid, Box< Patch, Real > **const box)
Definition: Patch.C:198
SubmitReduction * reduction
void unregisterIntRadPickup(Compute *cid, Box< Patch, Real > **const box)
Definition: Patch.C:181
void unregisterVelocityPickup(Compute *cid, Box< Patch, CompAtom > **const box)
Definition: Patch.C:153
void unregisterDEdaSumDeposit(Compute *cid, Box< Patch, GBReal > **const box)
Definition: Patch.C:211

Member Function Documentation

◆ doForce()

void ComputeNonbondedPair::doForce ( CompAtom p[2],
CompAtomExt pExt[2],
Results r[2] 
)
protectedvirtual

Reimplemented from ComputePatchPair.

Definition at line 177 of file ComputeNonbondedPair.C.

References GBISParamStruct::a_cut, GBISParamStruct::alpha_max, avgPositionBox, GBISParamStruct::beta, GBISParamStruct::bornRad, bornRadBox, Lattice::c(), ComputeNonbondedUtil::calcFullPair, ComputeNonbondedUtil::calcFullPairEnergy, ComputeNonbondedUtil::calcGBIS(), ComputeNonbondedUtil::calcMergePair, ComputeNonbondedUtil::calcMergePairEnergy, ComputeNonbondedUtil::calcPair, ComputeNonbondedUtil::calcPairEnergy, ComputeNonbondedUtil::calcSlowPair, ComputeNonbondedUtil::calcSlowPairEnergy, PatchMap::center(), Compute::cid, GBISParamStruct::cid, Box< Owner, Data >::close(), ComputeNonbondedUtil::commOnly, GBISParamStruct::cutoff, ComputeNonbondedUtil::cutoff, DebugM, GBISParamStruct::dEdaSum, dEdaSumBox, GBISParamStruct::delta, GBISParamStruct::dHdrPrefix, dHdrPrefixBox, Flags::doEnergy, GBISParamStruct::doEnergy, Flags::doFullElectrostatics, GBISParamStruct::doFullElectrostatics, Flags::doGBIS, GBISParamStruct::doGBIS, Flags::doLoweAndersen, nonbonded::doLoweAndersen, GBISParamStruct::doSmoothing, GBISParamStruct::epsilon_p, GBISParamStruct::epsilon_s, Results::f, nonbonded::ff, Patch::flags, GBISParamStruct::fsMax, nonbonded::fullf, GBISParamStruct::gamma, GBISParamStruct::gbInterEnergy, gbisParams, Compute::gbisPhase, GBISParamStruct::gbisPhase, gbisStepPairlists, GBISParamStruct::gbisStepPairlists, GBISParamStruct::gbSelfEnergy, Patch::getPatchID(), nonbonded::groupplcutoff, GBISParamStruct::intRad, intRadBox, SubmitReduction::item(), GBISParamStruct::kappa, Patch::lattice, Vector::length(), Flags::maxAtomMovement, Flags::maxGroupRadius, GBISParamStruct::maxGroupRadius, maxPart, nonbonded::maxPart, minPart, nonbonded::minPart, ComputePatchPair::numAtoms, nonbonded::numAtoms, numGBISPairlists, numParts, nonbonded::numParts, GBISParamStruct::numPatches, PatchMap::Object(), Node::Object(), nonbonded::offset, Lattice::offset(), nonbonded::offset_f, Box< Owner, Data >::open(), Lattice::origin(), ComputePatchPair::p, nonbonded::p, pairlists, nonbonded::pairlists, pairlistsValid, Flags::pairlistTolerance, pairlistTolerance, ComputeNonbondedUtil::pairlistWarningIndex, params, ComputePatchPair::patch, ComputePatchPair::patchID, GBISParamStruct::patchID, ComputePatchPair::pExt, nonbonded::pExt, nonbonded::plcutoff, ComputeNonbondedUtil::pressureProfileAtomTypes, pressureProfileData, ComputeNonbondedUtil::pressureProfileMin, ComputeNonbondedUtil::pressureProfileOn, pressureProfileReduction, nonbonded::pressureProfileReduction, ComputeNonbondedUtil::pressureProfileSlabs, ComputeNonbondedUtil::pressureProfileThickness, nonbonded::projLineVec, GBISParamStruct::psiSum, psiSumBox, ComputePatchPair::r, reduction, nonbonded::reduction, REDUCTION_ELECT_ENERGY, reductionData, ComputeNonbondedUtil::reductionDataSize, GBISParamStruct::rho_0, nonbonded::savePairlists, Compute::sequence(), GBISParamStruct::sequence, Node::simParameters, simParams, Results::slow, Flags::step, nonbonded::step, SubmitReduction::submit(), ComputeNonbondedUtil::submitPressureProfileData(), ComputeNonbondedUtil::submitReductionData(), TRACE_COMPOBJ_IDOFFSET, ComputePatchPair::trans, Lattice::unscale(), Flags::usePairlists, nonbonded::usePairlists, nonbonded::v, velocityBox, workArrays, nonbonded::workArrays, and Vector::z.

178 {
179  #ifdef NAMD_AVXTILES
180  if (avxTilesMode) {
181  doForceTiles(p, pExt, r);
182  return;
183  }
184  #endif
185 
186  // Inform load balancer.
187  // I assume no threads will suspend until endWork is called
188 
189  //single phase declarations
190  int doEnergy = patch[0]->flags.doEnergy;
191  int a = 0; int b = 1;
192  // swap to place more atoms in inner loop (second patch)
193  if ( numAtoms[0] > numAtoms[1] ) { a = 1; b = 0; }
194  CompAtom* v[2];
195 
196 
197 /*******************************************************************************
198  * Prepare Parameters
199 *******************************************************************************/
200  if (!patch[0]->flags.doGBIS || gbisPhase == 1) {
201 
202 #ifdef TRACE_COMPUTE_OBJECTS
203  double traceObjStartTime = CmiWallTimer();
204 #endif
205 
206  DebugM(2,"doForce() called.\n");
207  DebugM(2, numAtoms[0] << " patch #1 atoms and " <<
208  numAtoms[1] << " patch #2 atoms\n");
209 
210 
211  for ( int i = 0; i < reductionDataSize; ++i )
212  reductionData[i] = 0;
213  if (pressureProfileOn) {
214  int n = pressureProfileAtomTypes;
215  memset(pressureProfileData, 0, 3*n*n*pressureProfileSlabs*sizeof(BigReal));
216  // adjust lattice dimensions to allow constant pressure
217  const Lattice &lattice = patch[0]->lattice;
219  pressureProfileMin = lattice.origin().z - 0.5*lattice.c().z;
220  }
221 
224 
228 
230 
232  params.savePairlists = 0;
233  params.usePairlists = 0;
234  if ( patch[0]->flags.savePairlists ) {
235  params.savePairlists = 1;
236  params.usePairlists = 1;
237  } else if ( patch[0]->flags.usePairlists && patch[1]->flags.usePairlists ) {
238  if ( ! pairlistsValid ||
239  ( patch[0]->flags.maxAtomMovement +
242  } else {
243  params.usePairlists = 1;
244  }
245  }
246  if ( ! params.usePairlists ) {
247  pairlistsValid = 0;
248  }
252  if ( params.savePairlists ) {
253  pairlistsValid = 1;
258  }
259 
260 
261  const Lattice &lattice = patch[0]->lattice;
262  params.offset = lattice.offset(trans[a]) - lattice.offset(trans[b]);
263 
264  PatchMap* patchMap = PatchMap::Object();
265  params.offset_f = params.offset + lattice.unscale(patchMap->center(patchID[a]))
266  - lattice.unscale(patchMap->center(patchID[b]));
267 
268  // Atom Sorting : If we are sorting the atoms along the line connecting
269  // the patch centers, then calculate a normalized vector pointing from
270  // patch a to patch b (i.e. outer loop patch to inner loop patch).
271  #if NAMD_ComputeNonbonded_SortAtoms != 0
272 
274 
275  #endif
276 
277  params.p[0] = p[a];
278  params.p[1] = p[b];
279  params.pExt[0] = pExt[a];
280  params.pExt[1] = pExt[b];
281 #ifdef NAMD_KNL
282  params.pFlt[0] = patch[a]->getCompAtomFlt();
283  params.pFlt[1] = patch[b]->getCompAtomFlt();
284 #endif
285  // BEGIN LA
287  if (params.doLoweAndersen) {
288  DebugM(4, "opening velocity boxes\n");
289  v[0] = velocityBox[0]->open();
290  v[1] = velocityBox[1]->open();
291  params.v[0] = v[a];
292  params.v[1] = v[b];
293  }
294  // END LA
295 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
296  params.ff[0] = r[a]->f[Results::nbond_virial];
297  params.ff[1] = r[b]->f[Results::nbond_virial];
298 #endif
299  params.numAtoms[0] = numAtoms[a];
300  params.numAtoms[1] = numAtoms[b];
301  params.step = patch[0]->flags.step;
302 
303  // DMK - Atom Separation (water vs. non-water)
304  #if NAMD_SeparateWaters != 0
305  params.numWaterAtoms[0] = numWaterAtoms[a];
306  params.numWaterAtoms[1] = numWaterAtoms[b];
307  #endif
308 
309 
310 /*******************************************************************************
311  * Call Nonbonded Functions
312 *******************************************************************************/
313  if (numAtoms[0] && numAtoms[1]) {//only do if has atoms since gbis noWork doesn't account for no atoms
314 
315  //force calculation calls
316  if ( patch[0]->flags.doFullElectrostatics )
317  {
318 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
319  params.fullf[0] = r[a]->f[Results::slow_virial];
320  params.fullf[1] = r[b]->f[Results::slow_virial];
321 #endif
322  if ( patch[0]->flags.doMolly ) {
323  if ( doEnergy )
325  else calcPair(&params);
326  CompAtom *p_avg[2];
327  p_avg[0] = avgPositionBox[0]->open();
328  p_avg[1] = avgPositionBox[1]->open();
329  params.p[0] = p_avg[a];
330  params.p[1] = p_avg[b];
331  if ( doEnergy ) calcSlowPairEnergy(&params);
332  else calcSlowPair(&params);
333  avgPositionBox[0]->close(&p_avg[0]);
334  avgPositionBox[1]->close(&p_avg[1]);
335  } else if ( patch[0]->flags.maxForceMerged == Results::slow ) {
336  if ( doEnergy ) calcMergePairEnergy(&params);
337  else calcMergePair(&params);
338  } else {
339  if ( doEnergy ) calcFullPairEnergy(&params);
340  else calcFullPair(&params);
341  }
342  }
343  else
344  if ( doEnergy ) calcPairEnergy(&params);
345  else calcPair(&params);
346 
347  }//end if has atoms
348 
349  // BEGIN LA
350  if (params.doLoweAndersen) {
351  DebugM(4, "closing velocity boxes\n");
352  velocityBox[0]->close(&v[0]);
353  velocityBox[1]->close(&v[1]);
354  }
355  // END LA
356  }// end not gbis
357 
358 /*******************************************************************************
359  * gbis Loop
360 *******************************************************************************/
361 if (patch[0]->flags.doGBIS) {
365  gbisParams.numPatches = 2;//pair
368  gbisParams.epsilon_s = simParams->solvent_dielectric;
369  gbisParams.epsilon_p = simParams->dielectric;
370  gbisParams.rho_0 = simParams->coulomb_radius_offset;
371  gbisParams.kappa = simParams->kappa;
372  gbisParams.cutoff = simParams->cutoff;
373  gbisParams.doSmoothing = simParams->switchingActive;
374  gbisParams.a_cut = simParams->alpha_cutoff;
375  gbisParams.delta = simParams->gbis_delta;
376  gbisParams.beta = simParams->gbis_beta;
377  gbisParams.gamma = simParams->gbis_gamma;
378  gbisParams.alpha_max = simParams->alpha_max;
379  gbisParams.cid = cid;
380  gbisParams.patchID[0] = patch[a]->getPatchID();
381  gbisParams.patchID[1] = patch[b]->getPatchID();
383  if (patch[1]->flags.maxGroupRadius > gbisParams.maxGroupRadius)
385  gbisParams.doEnergy = doEnergy;
386  gbisParams.fsMax = simParams->fsMax;
387  for (int i = 0; i < numGBISPairlists; i++)
389 
390  //open boxes
391  if (gbisPhase == 1) {
392  gbisParams.intRad[0] = intRadBox[a]->open();
393  gbisParams.intRad[1] = intRadBox[b]->open();
394  gbisParams.psiSum[0] = psiSumBox[a]->open();
395  gbisParams.psiSum[1] = psiSumBox[b]->open();
398 
399  } else if (gbisPhase == 2) {
400  gbisParams.bornRad[0] = bornRadBox[a]->open();
401  gbisParams.bornRad[1] = bornRadBox[b]->open();
402  gbisParams.dEdaSum[0] = dEdaSumBox[a]->open();
403  gbisParams.dEdaSum[1] = dEdaSumBox[b]->open();
404  } else if (gbisPhase == 3) {
407  }
408 
409  //make call to calculate GBIS
412  }
413 
414  //close boxes
415  if (gbisPhase == 1) {
416  psiSumBox[0]->close(&(gbisParams.psiSum[a]));
417  psiSumBox[1]->close(&(gbisParams.psiSum[b]));
418  } else if (gbisPhase == 2) {
419  dEdaSumBox[0]->close(&(gbisParams.dEdaSum[a]));
420  dEdaSumBox[1]->close(&(gbisParams.dEdaSum[b]));
421 
422 
423  } else if (gbisPhase == 3) {
424  bornRadBox[0]->close(&(gbisParams.bornRad[a]));
425  bornRadBox[1]->close(&(gbisParams.bornRad[b]));
428  intRadBox[0]->close(&(gbisParams.intRad[a]));
429  intRadBox[1]->close(&(gbisParams.intRad[b]));
432  }
433 
434 }//end if doGBIS
435 
436  if (!patch[0]->flags.doGBIS || gbisPhase == 3) {
438  if (pressureProfileOn)
440 
441 #ifdef TRACE_COMPUTE_OBJECTS
442  traceUserBracketEvent(TRACE_COMPOBJ_IDOFFSET+cid, traceObjStartTime, CmiWallTimer());
443 #endif
444 
445 
446  reduction->submit();
447  if (pressureProfileOn)
449  }//end gbis end phase
450 
451 }//end do Force
static Node * Object()
Definition: Node.h:86
Pairlists * pairlists
ScaledPosition center(int pid) const
Definition: PatchMap.h:99
int sequence(void)
Definition: Compute.h:64
NAMD_HOST_DEVICE Vector c() const
Definition: Lattice.h:270
Box< Patch, Real > * dHdrPrefixBox[2]
static void submitReductionData(BigReal *, SubmitReduction *)
#define TRACE_COMPOBJ_IDOFFSET
Definition: Compute.h:77
CompAtom * p[2]
Lattice & lattice
Definition: Patch.h:127
static PatchMap * Object()
Definition: PatchMap.h:27
CompAtom * p[2]
void calcGBIS(nonbonded *params, GBISParamStruct *gbisParams)
Definition: ComputeGBIS.C:261
SimParameters * simParameters
Definition: Node.h:181
ComputeNonbondedWorkArrays *const workArrays
NAMD_HOST_DEVICE Position unscale(ScaledPosition s) const
Definition: Lattice.h:77
Box< Patch, Real > * intRadBox[2]
BigReal & item(int i)
Definition: ReductionMgr.h:313
#define DebugM(x, y)
Definition: Debug.h:75
CompAtomExt * pExt[2]
CompAtom * v[2]
BigReal z
Definition: Vector.h:74
int usePairlists
Definition: PatchTypes.h:39
BigReal * reduction
static void submitPressureProfileData(BigReal *, SubmitReduction *)
static BigReal pressureProfileThickness
int doLoweAndersen
Definition: PatchTypes.h:27
static void(* calcMergePair)(nonbonded *)
Pairlists gbisStepPairlists[numGBISPairlists]
static void(* calcMergePairEnergy)(nonbonded *)
static void(* calcSlowPairEnergy)(nonbonded *)
Flags flags
Definition: Patch.h:128
SubmitReduction * pressureProfileReduction
Box< Patch, CompAtom > * avgPositionBox[2]
static void(* calcPair)(nonbonded *)
static void(* calcSlowPair)(nonbonded *)
NAMD_HOST_DEVICE BigReal length(void) const
Definition: Vector.h:202
Pairlists * gbisStepPairlists[4]
Box< Patch, CompAtom > * velocityBox[2]
static BigReal pressureProfileMin
Box< Patch, GBReal > * psiSumBox[2]
int doEnergy
Definition: PatchTypes.h:20
int doFullElectrostatics
Definition: PatchTypes.h:23
Force * f[maxNumForces]
Definition: PatchTypes.h:146
CompAtomExt * pExt[2]
PatchID getPatchID() const
Definition: Patch.h:114
Box< Patch, Real > * bornRadBox[2]
NAMD_HOST_DEVICE Vector offset(int i) const
Definition: Lattice.h:258
BigReal maxAtomMovement
Definition: PatchTypes.h:42
Box< Patch, GBReal > * dEdaSumBox[2]
int gbisPhase
Definition: Compute.h:39
static void(* calcPairEnergy)(nonbonded *)
SubmitReduction * reduction
#define simParams
Definition: Output.C:129
GBISParamStruct gbisParams
static void(* calcFullPair)(nonbonded *)
static const int numGBISPairlists
static void(* calcFullPairEnergy)(nonbonded *)
BigReal pairlistTolerance
Definition: PatchTypes.h:41
int doGBIS
Definition: PatchTypes.h:29
void submit(void)
Definition: ReductionMgr.h:324
Force * fullf[2]
BigReal reductionData[reductionDataSize]
BigReal * pressureProfileReduction
Data * open(void)
Definition: Box.h:39
BigReal maxGroupRadius
Definition: PatchTypes.h:43
const ComputeID cid
Definition: Compute.h:43
NAMD_HOST_DEVICE Vector origin() const
Definition: Lattice.h:278
void close(Data **const t)
Definition: Box.h:49
ComputeNonbondedWorkArrays * workArrays
double BigReal
Definition: common.h:123
int step
Definition: PatchTypes.h:16

◆ initialize()

void ComputeNonbondedPair::initialize ( void  )
protectedvirtual

Reimplemented from ComputePatchPair.

Definition at line 66 of file ComputeNonbondedPair.C.

References avgPositionBox, bornRadBox, dEdaSumBox, dHdrPrefixBox, ComputePatchPair::initialize(), intRadBox, ComputePatchPair::patch, psiSumBox, Patch::registerAvgPositionPickup(), Patch::registerBornRadPickup(), Patch::registerDEdaSumDeposit(), Patch::registerDHdrPrefixPickup(), Patch::registerIntRadPickup(), Patch::registerPsiSumDeposit(), Patch::registerVelocityPickup(), and velocityBox.

66  {
68  for (int i=0; i<2; i++) {
70  // BEGIN LA
72  // END LA
73 
74  psiSumBox[i] = patch[i]->registerPsiSumDeposit(this);
75  intRadBox[i] = patch[i]->registerIntRadPickup(this);
76  bornRadBox[i] = patch[i]->registerBornRadPickup(this);
79  }
80 }
Box< Patch, GBReal > * registerDEdaSumDeposit(Compute *cid)
Definition: Patch.C:203
Box< Patch, CompAtom > * registerAvgPositionPickup(Compute *cid)
Definition: Patch.C:133
Box< Patch, Real > * dHdrPrefixBox[2]
Box< Patch, Real > * intRadBox[2]
Box< Patch, Real > * registerBornRadPickup(Compute *cid)
Definition: Patch.C:195
Box< Patch, CompAtom > * avgPositionBox[2]
Box< Patch, GBReal > * registerPsiSumDeposit(Compute *cid)
Definition: Patch.C:163
virtual void initialize()
Box< Patch, CompAtom > * velocityBox[2]
Box< Patch, GBReal > * psiSumBox[2]
Box< Patch, Real > * registerIntRadPickup(Compute *cid)
Definition: Patch.C:178
Box< Patch, Real > * bornRadBox[2]
Box< Patch, GBReal > * dEdaSumBox[2]
Box< Patch, Real > * registerDHdrPrefixPickup(Compute *cid)
Definition: Patch.C:217
Box< Patch, CompAtom > * registerVelocityPickup(Compute *cid)
Definition: Patch.C:147

◆ noWork()

int ComputeNonbondedPair::noWork ( )
protectedvirtual

Reimplemented from Compute.

Definition at line 115 of file ComputeNonbondedPair.C.

References avgPositionBox, bornRadBox, dEdaSumBox, dHdrPrefixBox, ComputePatchPair::forceBox, Compute::gbisPhase, intRadBox, SubmitReduction::item(), Compute::ldObjHandle, ComputePatchPair::numAtoms, LdbCoordinator::Object(), ComputePatchPair::patch, ComputePatchPair::positionBox, ComputeNonbondedUtil::pressureProfileOn, pressureProfileReduction, psiSumBox, reduction, REDUCTION_COMPUTE_CHECKSUM, Box< Owner, Data >::skip(), LdbCoordinator::skipWork(), SubmitReduction::submit(), and velocityBox.

115  {
116 
117  if (patch[0]->flags.doGBIS) {
118  gbisPhase = 1 + (gbisPhase % 3);//1->2->3->1...
119  }
120 
121 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
122  if ( patch[0]->flags.doNonbonded && (numAtoms[0] && numAtoms[1]) ) {
123  return 0; // work to do, enqueue as usual
124  } else {
125 #else
126  {
127 #endif
128 
129  if (patch[0]->flags.doGBIS) {
130  if (gbisPhase == 1) {
131  for (int i=0; i<2; i++) {
132  psiSumBox[i]->skip();
133  intRadBox[i]->skip();
134  }
135  if (patch[0]->flags.doNonbonded) return 1;
136  else gbisPhase = 2;
137  }
138  if (gbisPhase == 2) {
139  for (int i=0; i<2; i++) {
140  bornRadBox[i]->skip();
141  dEdaSumBox[i]->skip();
142  }
143  if (patch[0]->flags.doNonbonded) return 1;
144  else gbisPhase = 3;
145  }
146  if (gbisPhase == 3) {
147  for (int i=0; i<2; i++) {
148  dHdrPrefixBox[i]->skip();
149  }
150  }
151  }
152 
153  // skip all boxes
154  for (int i=0; i<2; i++) {
155  positionBox[i]->skip();
156  forceBox[i]->skip();
157  if ( patch[0]->flags.doMolly ) avgPositionBox[i]->skip();
158  // BEGIN LA
159  if (patch[0]->flags.doLoweAndersen) velocityBox[i]->skip();
160  // END LA
161  }
162 
164  reduction->submit();
165  if (pressureProfileOn)
167 
168 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
169  // Inform load balancer
171 #endif
172 
173  return 1; // no work to do, do not enqueue
174  }
175 }
Box< Patch, Real > * dHdrPrefixBox[2]
Box< Patch, CompAtom > * positionBox[2]
Box< Patch, Real > * intRadBox[2]
BigReal & item(int i)
Definition: ReductionMgr.h:313
LDObjHandle ldObjHandle
Definition: Compute.h:44
SubmitReduction * pressureProfileReduction
Box< Patch, CompAtom > * avgPositionBox[2]
Box< Patch, Results > * forceBox[2]
Box< Patch, CompAtom > * velocityBox[2]
Box< Patch, GBReal > * psiSumBox[2]
void skipWork(const LDObjHandle &handle)
Box< Patch, Real > * bornRadBox[2]
static LdbCoordinator * Object()
Box< Patch, GBReal > * dEdaSumBox[2]
void skip(void)
Definition: Box.h:63
int gbisPhase
Definition: Compute.h:39
SubmitReduction * reduction
void submit(void)
Definition: ReductionMgr.h:324

Member Data Documentation

◆ avgPositionBox

Box<Patch,CompAtom>* ComputeNonbondedPair::avgPositionBox[2]
protected

Definition at line 35 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ bornRadBox

Box<Patch,Real>* ComputeNonbondedPair::bornRadBox[2]
protected

Definition at line 43 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ dEdaSumBox

Box<Patch,GBReal>* ComputeNonbondedPair::dEdaSumBox[2]
protected

Definition at line 44 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ dHdrPrefixBox

Box<Patch,Real>* ComputeNonbondedPair::dHdrPrefixBox[2]
protected

Definition at line 45 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ gbisParams

GBISParamStruct ComputeNonbondedPair::gbisParams

Definition at line 22 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ gbisStepPairlists

Pairlists ComputeNonbondedPair::gbisStepPairlists[numGBISPairlists]
protected

Definition at line 47 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ intRad

Real* ComputeNonbondedPair::intRad[2]
protected

Definition at line 40 of file ComputeNonbondedPair.h.

◆ intRadBox

Box<Patch,Real>* ComputeNonbondedPair::intRadBox[2]
protected

Definition at line 41 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ maxPart

int ComputeNonbondedPair::maxPart
protected

Definition at line 60 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ minPart

int ComputeNonbondedPair::minPart
protected

Definition at line 60 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ numGBISPairlists

const int ComputeNonbondedPair::numGBISPairlists = 4
staticprotected

Definition at line 46 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ numParts

int ComputeNonbondedPair::numParts
protected

Definition at line 60 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ pairlists

Pairlists ComputeNonbondedPair::pairlists
protected

Definition at line 56 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ pairlistsValid

int ComputeNonbondedPair::pairlistsValid
protected

Definition at line 57 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), and doForce().

◆ pairlistTolerance

BigReal ComputeNonbondedPair::pairlistTolerance
protected

Definition at line 58 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), and doForce().

◆ params

nonbonded ComputeNonbondedPair::params

Definition at line 21 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), and doForce().

◆ pressureProfileData

BigReal* ComputeNonbondedPair::pressureProfileData
protected

Definition at line 52 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), doForce(), and ~ComputeNonbondedPair().

◆ pressureProfileReduction

SubmitReduction* ComputeNonbondedPair::pressureProfileReduction
protected

◆ psiSumBox

Box<Patch,GBReal>* ComputeNonbondedPair::psiSumBox[2]
protected

Definition at line 42 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ reduction

SubmitReduction* ComputeNonbondedPair::reduction
protected

◆ reductionData

BigReal ComputeNonbondedPair::reductionData[reductionDataSize]
protected

Definition at line 49 of file ComputeNonbondedPair.h.

Referenced by doForce().

◆ velocityBox

Box<Patch,CompAtom>* ComputeNonbondedPair::velocityBox[2]
protected

Definition at line 37 of file ComputeNonbondedPair.h.

Referenced by doForce(), initialize(), noWork(), and ~ComputeNonbondedPair().

◆ workArrays

ComputeNonbondedWorkArrays* const ComputeNonbondedPair::workArrays
protected

Definition at line 54 of file ComputeNonbondedPair.h.

Referenced by doForce().


The documentation for this class was generated from the following files: