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 ( 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:178
ComputeNonbondedWorkArrays *const workArrays
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:365
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:278
SimParameters * simParameters
SubmitReduction * pressureProfileReduction
Parameters * parameters
Definition: Node.h:177
SubmitReduction * reduction
Random * rand
Definition: Node.h:172
ComputePatchPair(ComputeID c, PatchID pid[], int t[])
double BigReal
Definition: common.h:112
ComputeNonbondedPair::~ComputeNonbondedPair ( )

Definition at line 85 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.

86 {
87  delete reduction;
89  delete [] pressureProfileData;
90  for (int i=0; i<2; i++) {
91  if (avgPositionBox[i] != NULL) {
93  }
94  // BEGIN LA
95  if (velocityBox[i] != NULL) {
97  }
98  // END LA
99 
100  if (psiSumBox[i] != NULL) {
102  }
103  if (intRadBox[i] != NULL) {
104  patch[i]->unregisterIntRadPickup(this,&intRadBox[i]);
105  }
106  if (bornRadBox[i] != NULL) {
108  }
109  if (dEdaSumBox[i] != NULL) {
111  }
112  if (dHdrPrefixBox[i] != NULL) {
114  }
115  }
116 }
void unregisterAvgPositionPickup(Compute *cid, Box< Patch, CompAtom > **const box)
Definition: Patch.C:140
Box< Patch, Real > * dHdrPrefixBox[2]
void unregisterPsiSumDeposit(Compute *cid, Box< Patch, GBReal > **const box)
Definition: Patch.C:174
Box< Patch, Real > * intRadBox[2]
void unregisterDHdrPrefixPickup(Compute *cid, Box< Patch, Real > **const box)
Definition: Patch.C:222
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:199
SubmitReduction * reduction
void unregisterIntRadPickup(Compute *cid, Box< Patch, Real > **const box)
Definition: Patch.C:182
void unregisterVelocityPickup(Compute *cid, Box< Patch, CompAtom > **const box)
Definition: Patch.C:154
void unregisterDEdaSumDeposit(Compute *cid, Box< Patch, GBReal > **const box)
Definition: Patch.C:212

Member Function Documentation

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

Reimplemented from ComputePatchPair.

Definition at line 180 of file ComputeNonbondedPair.C.

References GBISParamStruct::a_cut, SimParameters::alpha_cutoff, GBISParamStruct::alpha_max, SimParameters::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, SimParameters::coulomb_radius_offset, GBISParamStruct::cutoff, SimParameters::cutoff, ComputeNonbondedUtil::cutoff, DebugM, GBISParamStruct::dEdaSum, dEdaSumBox, GBISParamStruct::delta, GBISParamStruct::dHdrPrefix, dHdrPrefixBox, SimParameters::dielectric, 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, SimParameters::fsMax, nonbonded::fullf, GBISParamStruct::gamma, GBISParamStruct::gbInterEnergy, SimParameters::gbis_beta, SimParameters::gbis_delta, SimParameters::gbis_gamma, gbisParams, Compute::gbisPhase, GBISParamStruct::gbisPhase, gbisStepPairlists, GBISParamStruct::gbisStepPairlists, GBISParamStruct::gbSelfEnergy, Patch::getPatchID(), nonbonded::groupplcutoff, if(), GBISParamStruct::intRad, intRadBox, SubmitReduction::item(), GBISParamStruct::kappa, SimParameters::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(), nonbonded::p, pairlists, nonbonded::pairlists, pairlistsValid, Flags::pairlistTolerance, pairlistTolerance, ComputeNonbondedUtil::pairlistWarningIndex, params, ComputePatchPair::patch, ComputePatchPair::patchID, GBISParamStruct::patchID, nonbonded::pExt, nonbonded::plcutoff, ComputeNonbondedUtil::pressureProfileAtomTypes, pressureProfileData, ComputeNonbondedUtil::pressureProfileMin, ComputeNonbondedUtil::pressureProfileOn, pressureProfileReduction, nonbonded::pressureProfileReduction, ComputeNonbondedUtil::pressureProfileSlabs, ComputeNonbondedUtil::pressureProfileThickness, nonbonded::projLineVec, GBISParamStruct::psiSum, psiSumBox, reduction, nonbonded::reduction, REDUCTION_ELECT_ENERGY, reductionData, ComputeNonbondedUtil::reductionDataSize, GBISParamStruct::rho_0, nonbonded::savePairlists, Compute::sequence(), GBISParamStruct::sequence, Node::simParameters, simParams, Results::slow, SimParameters::solvent_dielectric, Flags::step, nonbonded::step, SubmitReduction::submit(), ComputeNonbondedUtil::submitPressureProfileData(), ComputeNonbondedUtil::submitReductionData(), SimParameters::switchingActive, TRACE_COMPOBJ_IDOFFSET, ComputePatchPair::trans, Lattice::unscale(), Flags::usePairlists, nonbonded::usePairlists, nonbonded::v, velocityBox, workArrays, nonbonded::workArrays, and Vector::z.

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

Reimplemented from ComputePatchPair.

Definition at line 66 of file ComputeNonbondedPair.C.

References avgPositionBox, bornRadBox, Compute::cid, dEdaSumBox, dHdrPrefixBox, ComputePatchPair::initialize(), intRadBox, ComputePatchPair::patch, ComputePatchPair::patchID, psiSumBox, register_cuda_compute_pair(), Patch::registerAvgPositionPickup(), Patch::registerBornRadPickup(), Patch::registerDEdaSumDeposit(), Patch::registerDHdrPrefixPickup(), Patch::registerIntRadPickup(), Patch::registerPsiSumDeposit(), Patch::registerVelocityPickup(), ComputePatchPair::trans, 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 #ifdef NAMD_CUDA
82 #endif
83 }
Box< Patch, GBReal > * registerDEdaSumDeposit(Compute *cid)
Definition: Patch.C:204
Box< Patch, CompAtom > * registerAvgPositionPickup(Compute *cid)
Definition: Patch.C:134
Box< Patch, Real > * dHdrPrefixBox[2]
Box< Patch, Real > * intRadBox[2]
Box< Patch, Real > * registerBornRadPickup(Compute *cid)
Definition: Patch.C:196
Box< Patch, CompAtom > * avgPositionBox[2]
Box< Patch, GBReal > * registerPsiSumDeposit(Compute *cid)
Definition: Patch.C:164
virtual void initialize()
Box< Patch, CompAtom > * velocityBox[2]
Box< Patch, GBReal > * psiSumBox[2]
Box< Patch, Real > * registerIntRadPickup(Compute *cid)
Definition: Patch.C:179
Box< Patch, Real > * bornRadBox[2]
Box< Patch, GBReal > * dEdaSumBox[2]
Box< Patch, Real > * registerDHdrPrefixPickup(Compute *cid)
Definition: Patch.C:218
const ComputeID cid
Definition: Compute.h:43
Box< Patch, CompAtom > * registerVelocityPickup(Compute *cid)
Definition: Patch.C:148
void register_cuda_compute_pair(ComputeID c, PatchID pid[], int t[])
int ComputeNonbondedPair::noWork ( )
protectedvirtual

Reimplemented from Compute.

Definition at line 118 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.

118  {
119 
120  if (patch[0]->flags.doGBIS) {
121  gbisPhase = 1 + (gbisPhase % 3);//1->2->3->1...
122  }
123 
124 #ifndef NAMD_CUDA
125  if ( patch[0]->flags.doNonbonded && (numAtoms[0] && numAtoms[1]) ) {
126  return 0; // work to do, enqueue as usual
127  } else {
128 #else
129  {
130 #endif
131 
132  if (patch[0]->flags.doGBIS) {
133  if (gbisPhase == 1) {
134  for (int i=0; i<2; i++) {
135  psiSumBox[i]->skip();
136  intRadBox[i]->skip();
137  }
138  if (patch[0]->flags.doNonbonded) return 1;
139  else gbisPhase = 2;
140  }
141  if (gbisPhase == 2) {
142  for (int i=0; i<2; i++) {
143  bornRadBox[i]->skip();
144  dEdaSumBox[i]->skip();
145  }
146  if (patch[0]->flags.doNonbonded) return 1;
147  else gbisPhase = 3;
148  }
149  if (gbisPhase == 3) {
150  for (int i=0; i<2; i++) {
151  dHdrPrefixBox[i]->skip();
152  }
153  }
154  }
155 
156  // skip all boxes
157  for (int i=0; i<2; i++) {
158  positionBox[i]->skip();
159  forceBox[i]->skip();
160  if ( patch[0]->flags.doMolly ) avgPositionBox[i]->skip();
161  // BEGIN LA
162  if (patch[0]->flags.doLoweAndersen) velocityBox[i]->skip();
163  // END LA
164  }
165 
167  reduction->submit();
168  if (pressureProfileOn)
170 
171 #ifndef NAMD_CUDA
172  // Inform load balancer
174 #endif
175 
176  return 1; // no work to do, do not enqueue
177  }
178 }
Box< Patch, Real > * dHdrPrefixBox[2]
Box< Patch, CompAtom > * positionBox[2]
Box< Patch, Real > * intRadBox[2]
BigReal & item(int i)
Definition: ReductionMgr.h:312
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:323

Member Data Documentation

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

Definition at line 35 of file ComputeNonbondedPair.h.

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

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

Definition at line 43 of file ComputeNonbondedPair.h.

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

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

Definition at line 44 of file ComputeNonbondedPair.h.

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

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

Definition at line 45 of file ComputeNonbondedPair.h.

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

GBISParamStruct ComputeNonbondedPair::gbisParams

Definition at line 22 of file ComputeNonbondedPair.h.

Referenced by doForce().

Pairlists ComputeNonbondedPair::gbisStepPairlists[numGBISPairlists]
protected

Definition at line 47 of file ComputeNonbondedPair.h.

Referenced by doForce().

Real* ComputeNonbondedPair::intRad[2]
protected

Definition at line 40 of file ComputeNonbondedPair.h.

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

Definition at line 41 of file ComputeNonbondedPair.h.

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

int ComputeNonbondedPair::maxPart
protected

Definition at line 60 of file ComputeNonbondedPair.h.

Referenced by doForce().

int ComputeNonbondedPair::minPart
protected

Definition at line 60 of file ComputeNonbondedPair.h.

Referenced by doForce().

const int ComputeNonbondedPair::numGBISPairlists = 4
staticprotected

Definition at line 46 of file ComputeNonbondedPair.h.

Referenced by doForce().

int ComputeNonbondedPair::numParts
protected

Definition at line 60 of file ComputeNonbondedPair.h.

Referenced by doForce().

Pairlists ComputeNonbondedPair::pairlists
protected

Definition at line 56 of file ComputeNonbondedPair.h.

Referenced by doForce().

int ComputeNonbondedPair::pairlistsValid
protected

Definition at line 57 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), and doForce().

BigReal ComputeNonbondedPair::pairlistTolerance
protected

Definition at line 58 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), and doForce().

nonbonded ComputeNonbondedPair::params

Definition at line 21 of file ComputeNonbondedPair.h.

Referenced by ComputeNonbondedPair(), and doForce().

BigReal* ComputeNonbondedPair::pressureProfileData
protected

Definition at line 52 of file ComputeNonbondedPair.h.

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

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

Definition at line 42 of file ComputeNonbondedPair.h.

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

SubmitReduction* ComputeNonbondedPair::reduction
protected
BigReal ComputeNonbondedPair::reductionData[reductionDataSize]
protected

Definition at line 49 of file ComputeNonbondedPair.h.

Referenced by doForce().

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

Definition at line 37 of file ComputeNonbondedPair.h.

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

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: