NAMD
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Patch Class Referenceabstract

#include <Patch.h>

Inheritance diagram for Patch:
HomePatch ProxyPatch

Public Member Functions

 Patch (PatchID pd)
 
int hasNewAtoms ()
 
virtual ~Patch ()
 
Box< Patch, CompAtom > * registerPositionPickup (Compute *cid)
 
void unregisterPositionPickup (Compute *cid, Box< Patch, CompAtom > **const box)
 
Box< Patch, CompAtom > * registerAvgPositionPickup (Compute *cid)
 
void unregisterAvgPositionPickup (Compute *cid, Box< Patch, CompAtom > **const box)
 
Box< Patch, CompAtom > * registerVelocityPickup (Compute *cid)
 
void unregisterVelocityPickup (Compute *cid, Box< Patch, CompAtom > **const box)
 
Box< Patch, Real > * registerIntRadPickup (Compute *cid)
 
void unregisterIntRadPickup (Compute *cid, Box< Patch, Real > **const box)
 
Box< Patch, GBReal > * registerPsiSumDeposit (Compute *cid)
 
void unregisterPsiSumDeposit (Compute *cid, Box< Patch, GBReal > **const box)
 
Box< Patch, Real > * registerBornRadPickup (Compute *cid)
 
void unregisterBornRadPickup (Compute *cid, Box< Patch, Real > **const box)
 
Box< Patch, GBReal > * registerDEdaSumDeposit (Compute *cid)
 
void unregisterDEdaSumDeposit (Compute *cid, Box< Patch, GBReal > **const box)
 
Box< Patch, Real > * registerDHdrPrefixPickup (Compute *cid)
 
void unregisterDHdrPrefixPickup (Compute *cid, Box< Patch, Real > **const box)
 
Box< Patch, int > * registerLcpoTypePickup (Compute *cid)
 
void unregisterLcpoTypePickup (Compute *cid, Box< Patch, int > **const box)
 
Box< Patch, Results > * registerForceDeposit (Compute *cid)
 
void unregisterForceDeposit (Compute *cid, Box< Patch, Results > **const box)
 
void positionsReady (int n=0, int startup=1)
 
void positionBoxClosed (void)
 
void forceBoxClosed (void)
 
void avgPositionBoxClosed (void)
 
void velocityBoxClosed (void)
 
void intRadBoxClosed (void)
 
void psiSumBoxClosed (void)
 
void bornRadBoxClosed (void)
 
void dEdaSumBoxClosed (void)
 
void dHdrPrefixBoxClosed (void)
 
void gbisP2Ready ()
 
void gbisP3Ready ()
 
void lcpoTypeBoxClosed (void)
 
int getNumAtoms () const
 
int getNumFixedAtoms () const
 
void setNumFixedAtoms (int numFixed)
 
PatchID getPatchID () const
 
int getNumComputes () const
 
CompAtomExtgetCompAtomExtInfo ()
 
CompAtomgetCompAtomInfo ()
 
CudaAtomgetCudaAtomList ()
 

Public Attributes

Latticelattice
 
Flags flags
 

Protected Member Functions

virtual void boxClosed (int)=0
 

Protected Attributes

const PatchID patchID
 
int numAtoms
 
int numFixedAtoms
 
CompAtomList p
 
CompAtomList p_avg
 
CompAtomList v
 
AtomMapperatomMapper
 
RealList intRad
 
GBRealList psiSum
 
GBRealList psiFin
 
RealList bornRad
 
RealList dHdrPrefix
 
GBRealList dEdaSum
 
IntList lcpoType
 
CompAtomExtList pExt
 
CompAtomavgPositionPtrBegin
 
CompAtomavgPositionPtrEnd
 
CompAtomvelocityPtrBegin
 
CompAtomvelocityPtrEnd
 
CudaAtomcudaAtomPtr
 
ForceList f [Results::maxNumForces]
 
Results results
 
int computesSortedByPriority
 
int firstHoldableCompute
 
OwnerBox< Patch, CompAtompositionBox
 
ComputePtrList positionComputeList
 
OwnerBox< Patch, CompAtomavgPositionBox
 
ComputePtrList avgPositionComputeList
 
OwnerBox< Patch, CompAtomvelocityBox
 
ComputePtrList velocityComputeList
 
OwnerBox< Patch, RealintRadBox
 
ComputePtrList intRadComputeList
 
OwnerBox< Patch, GBRealpsiSumBox
 
ComputePtrList psiSumComputeList
 
OwnerBox< Patch, RealbornRadBox
 
ComputePtrList bornRadComputeList
 
OwnerBox< Patch, GBRealdEdaSumBox
 
ComputePtrList dEdaSumComputeList
 
OwnerBox< Patch, RealdHdrPrefixBox
 
ComputePtrList dHdrPrefixComputeList
 
OwnerBox< Patch, int > lcpoTypeBox
 
ComputePtrList lcpoTypeComputeList
 
OwnerBox< Patch, ResultsforceBox
 
ComputePtrList forceComputeList
 
int boxesOpen
 
int _hasNewAtoms
 
int * child
 
int nChild
 

Detailed Description

Definition at line 35 of file Patch.h.

Constructor & Destructor Documentation

◆ Patch()

Patch::Patch ( PatchID  pd)

Definition at line 44 of file Patch.C.

References atomMapper, child, cudaAtomPtr, lattice, SimParameters::lattice, nChild, Node::Object(), ReductionMgr::Object(), REDUCTIONS_BASIC, Node::simParameters, and ReductionMgr::willSubmit().

44  :
46  patchID(pd), numAtoms(0), numFixedAtoms(0),
48  velocityPtrBegin(0), velocityPtrEnd(0), // BEGIN LA, END LA
51  velocityBox(this,&Patch::velocityBoxClosed,pd,4), // BEGIN LA, END LA
52  psiSumBox(this,&Patch::psiSumBoxClosed,pd,5), // begin gbis
56  dHdrPrefixBox(this,&Patch::dHdrPrefixBoxClosed,pd,9), //end gbis
58  forceBox(this,&Patch::forceBoxClosed,pd,1),
59  boxesOpen(0), _hasNewAtoms(0),
61 
62  // DMK - Atom Separation (water vs. non-water)
63  #if NAMD_SeparateWaters != 0
64  ,numWaterAtoms(-1)
65  #endif
66 {
67  //CkPrintf("GBIS: PatchCreated\n");
68 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
69  positionPtrBegin = 0;
70  positionPtrEnd = 0;
71 #endif
72 
73  nChild = 0;
74  child = NULL;
75 #ifdef NODEAWARE_PROXY_SPANNINGTREE
76  #ifdef USE_NODEPATCHMGR
77  nodeChildren = NULL;
78  numNodeChild = 0;
79  #endif
80 #endif
81 
83  atomMapper = new AtomMapper(pd);
84 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
86 #endif
87 
88  // DMK
89  #if defined(NAMD_MIC)
90  cudaAtomPtr = NULL;
91  #if MIC_SUBMIT_ATOMS_ON_ARRIVAL != 0
92  pthread_mutex_init(&mic_atomData_mutex, NULL);
93  mic_atomData = NULL;
94  mic_atomData_seq = -1;
95  mic_atomData_allocSize_host = 0;
96  for (int i = 0; i < MIC_MAX_DEVICES_PER_NODE; i++) {
97  mic_atomData_prev[i] = NULL;
98  mic_atomData_deviceSeq[i] = -1;
99  mic_atomData_devicePtr[i] = 0;
100  mic_atomData_allocSize_device[i] = 0;
101  }
102  #endif
103  #endif
104 }
static Node * Object()
Definition: Node.h:86
int firstHoldableCompute
Definition: Patch.h:218
int computesSortedByPriority
Definition: Patch.h:217
OwnerBox< Patch, Results > forceBox
Definition: Patch.h:246
void dHdrPrefixBoxClosed(void)
Definition: Patch.C:392
Lattice & lattice
Definition: Patch.h:127
CompAtom * velocityPtrEnd
Definition: Patch.h:209
SimParameters * simParameters
Definition: Node.h:181
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:234
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:243
CompAtom * avgPositionPtrEnd
Definition: Patch.h:205
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:366
void dEdaSumBoxClosed(void)
Definition: Patch.C:388
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:279
CudaAtom * cudaAtomPtr
Definition: Patch.h:212
void forceBoxClosed(void)
Definition: Patch.C:252
AtomMapper * atomMapper
Definition: Patch.h:159
Flags flags
Definition: Patch.h:128
int boxesOpen
Definition: Patch.h:250
OwnerBox< Patch, CompAtom > avgPositionBox
Definition: Patch.h:222
int numFixedAtoms
Definition: Patch.h:152
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:220
int numAtoms
Definition: Patch.h:151
void lcpoTypeBoxClosed(void)
Definition: Patch.C:399
CompAtom * avgPositionPtrBegin
Definition: Patch.h:204
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:225
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:230
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:238
const PatchID patchID
Definition: Patch.h:150
int _hasNewAtoms
Definition: Patch.h:252
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:236
Lattice lattice
Definition: PatchTypes.h:45
int * child
Definition: Patch.h:269
void bornRadBoxClosed(void)
Definition: Patch.C:384
void positionBoxClosed(void)
Definition: Patch.C:246
void avgPositionBoxClosed(void)
Definition: Patch.C:359
void velocityBoxClosed(void)
Definition: Patch.C:366
int nChild
Definition: Patch.h:270
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:232
void intRadBoxClosed(void)
Definition: Patch.C:380
void psiSumBoxClosed(void)
Definition: Patch.C:377
CompAtom * velocityPtrBegin
Definition: Patch.h:208

◆ ~Patch()

Patch::~Patch ( )
virtual

Definition at line 37 of file Patch.C.

References atomMapper.

37  {
38  delete atomMapper;
39 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
40  delete reduction;
41 #endif
42 }
AtomMapper * atomMapper
Definition: Patch.h:159

Member Function Documentation

◆ avgPositionBoxClosed()

void Patch::avgPositionBoxClosed ( void  )

Definition at line 359 of file Patch.C.

References avgPositionPtrBegin, and boxClosed().

360 {
362  this->boxClosed(3);
363 }
CompAtom * avgPositionPtrBegin
Definition: Patch.h:204
virtual void boxClosed(int)=0

◆ bornRadBoxClosed()

void Patch::bornRadBoxClosed ( void  )

Definition at line 384 of file Patch.C.

References boxClosed().

384  {
385  //bornRadPtr = 0;
386  this->boxClosed(7);
387 }
virtual void boxClosed(int)=0

◆ boxClosed()

virtual void Patch::boxClosed ( int  )
protectedpure virtual

◆ dEdaSumBoxClosed()

void Patch::dEdaSumBoxClosed ( void  )

Definition at line 388 of file Patch.C.

References boxClosed().

388  {
389  //dEdaSumPtr = 0;
390  this->boxClosed(8);
391 }
virtual void boxClosed(int)=0

◆ dHdrPrefixBoxClosed()

void Patch::dHdrPrefixBoxClosed ( void  )

Definition at line 392 of file Patch.C.

References boxClosed().

392  {
393  //dHdrPrefixPtr = 0;
394  this->boxClosed(9);
395 }
virtual void boxClosed(int)=0

◆ forceBoxClosed()

void Patch::forceBoxClosed ( void  )

Definition at line 252 of file Patch.C.

References ResizeArray< Elem >::begin(), boxClosed(), DebugM, Flags::doFullElectrostatics, Flags::doVirial, Results::f, f, flags, SubmitReduction::item(), lattice, Results::maxNumForces, Results::nbond, numAtoms, PatchMap::Object(), Node::Object(), p, patchID, ResizeArray< Elem >::resize(), results, Results::slow, SubmitReduction::submit(), Lattice::unscale(), virial_xx, virial_xy, virial_xz, virial_yy, virial_yz, virial_zz, Vector::x, Vector::y, and Vector::z.

253 {
254  DebugM(4, "patchID("<<patchID<<") forceBoxClosed! call\n");
255 
256 #if ! ( defined(NAMD_CUDA) || defined(NAMD_HIP))
257  // calculate direct nonbonded virial from segregated forces and aggregate forces
258  const Vector center = lattice.unscale( PatchMap::Object()->center(patchID) );
259 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
260  const CompAtom * const __restrict pd = positionPtrBegin;
261 #else
262  const CompAtom * const __restrict pd = p.begin();
263 #endif
264  const int n = numAtoms;
265  int roff = 0;
266 
267 #ifdef NAMD_AVXTILES
268  // If "Tiles" algorithm is active, perform same reduction and virial calc
269  // in BigReal precision, but add in forces stored in tiles data structures
270  // if they were touched on this patch.
271  if (Node::Object()->simParameters->useAVXTiles) {
272  double virialHold[6], virialSlowHold[6];
273  tiles.nativeForceVirialUpdate(flags.doFullElectrostatics, flags.doVirial,
274  pd, center, results.f[Results::nbond],
276  results.f[Results::nbond_virial],
277  results.f[Results::slow_virial],
278  virialHold, virialSlowHold);
279  f[Results::nbond_virial].resize(0);
280  f[Results::slow_virial].resize(0);
281  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XX) += virialHold[0];
282  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XY) += virialHold[1];
283  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XZ) += virialHold[2];
284  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YX) += virialHold[1];
285  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YY) += virialHold[3];
286  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YZ) += virialHold[4];
287  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZX) += virialHold[2];
288  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZY) += virialHold[4];
289  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZZ) += virialHold[5];
291  roff += REDUCTION_VIRIAL_SLOW_XX - REDUCTION_VIRIAL_NBOND_XX;
292  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XX) += virialSlowHold[0];
293  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XY) += virialSlowHold[1];
294  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XZ) += virialSlowHold[2];
295  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YX) += virialSlowHold[1];
296  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YY) += virialSlowHold[3];
297  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YZ) += virialSlowHold[4];
298  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZX) += virialSlowHold[2];
299  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZY) += virialSlowHold[4];
300  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZZ) += virialSlowHold[5];
301  }
302  reduction->submit();
303  for (int j = 0; j < Results::maxNumForces; ++j ) results.f[j] = 0;
304  this->boxClosed(1);
305  return;
306  }
307 #endif
308 
309  for ( int j1 = Results::nbond; j1 <= Results::slow; ++j1, roff += REDUCTION_VIRIAL_SLOW_XX - REDUCTION_VIRIAL_NBOND_XX ) {
310  int j2 = j1 + ( Results::nbond_virial - Results::nbond );
311  Force * __restrict f1 = results.f[j1];
312  Force * __restrict f2 = results.f[j2];
313  BigReal virial_xx = 0.;
314  BigReal virial_xy = 0.;
315  BigReal virial_xz = 0.;
316  BigReal virial_yy = 0.;
317  BigReal virial_yz = 0.;
318  BigReal virial_zz = 0.;
319 #pragma omp simd reduction(+:virial_xx,virial_xy,virial_xz,virial_yy,virial_yz,virial_zz)
320 #pragma ivdep
321  for ( int i=0; i<n; ++i ) {
322  BigReal p_x = pd[i].position.x - center.x;
323  BigReal p_y = pd[i].position.y - center.y;
324  BigReal p_z = pd[i].position.z - center.z;
325  BigReal f_x = f2[i].x;
326  BigReal f_y = f2[i].y;
327  BigReal f_z = f2[i].z;
328  virial_xx += f_x * p_x;
329  virial_xy += f_x * p_y;
330  virial_xz += f_x * p_z;
331  virial_yy += f_y * p_y;
332  virial_yz += f_y * p_z;
333  virial_zz += f_z * p_z;
334  f1[i].x += f_x;
335  f1[i].y += f_y;
336  f1[i].z += f_z;
337  }
338  f[j2].resize(0);
339  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XX) += virial_xx;
340  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XY) += virial_xy;
341  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XZ) += virial_xz;
342  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YX) += virial_xy;
343  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YY) += virial_yy;
344  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YZ) += virial_yz;
345  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZX) += virial_xz;
346  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZY) += virial_yz;
347  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZZ) += virial_zz;
348  }
349  reduction->submit();
350 #endif
351 
352  for (int j = 0; j < Results::maxNumForces; ++j )
353  {
354  results.f[j] = 0;
355  }
356  this->boxClosed(1);
357 }
static Node * Object()
Definition: Node.h:86
register BigReal virial_xy
register BigReal virial_xz
register BigReal virial_yz
Lattice & lattice
Definition: Patch.h:127
static PatchMap * Object()
Definition: PatchMap.h:27
Definition: Vector.h:72
NAMD_HOST_DEVICE Position unscale(ScaledPosition s) const
Definition: Lattice.h:77
BigReal & item(int i)
Definition: ReductionMgr.h:313
#define DebugM(x, y)
Definition: Debug.h:75
BigReal z
Definition: Vector.h:74
Flags flags
Definition: Patch.h:128
void resize(int i)
Definition: ResizeArray.h:84
register BigReal virial_yy
int doFullElectrostatics
Definition: PatchTypes.h:23
Force * f[maxNumForces]
Definition: PatchTypes.h:146
CompAtomList p
Definition: Patch.h:153
int numAtoms
Definition: Patch.h:151
register BigReal virial_zz
BigReal x
Definition: Vector.h:74
iterator begin(void)
Definition: ResizeArray.h:36
const PatchID patchID
Definition: Patch.h:150
int doVirial
Definition: PatchTypes.h:21
BigReal y
Definition: Vector.h:74
register BigReal virial_xx
Results results
Definition: Patch.h:215
void submit(void)
Definition: ReductionMgr.h:324
ForceList f[Results::maxNumForces]
Definition: Patch.h:214
virtual void boxClosed(int)=0
double BigReal
Definition: common.h:123

◆ gbisP2Ready()

void Patch::gbisP2Ready ( )

Definition at line 598 of file Patch.C.

References ResizeArrayPrimIter< T >::begin(), computeNonbondedCUDA2Type, computeNonbondedPairType, computeNonbondedSelfType, ResizeArrayPrimIter< T >::end(), flags, patchID, positionComputeList, and Flags::sequence.

Referenced by HomePatch::gbisP2Ready(), and ProxyPatch::receiveData().

598  {
600 
601  int seq = flags.sequence;
602  for(cid = cid.begin(); cid != cid.end(); cid++) {
603  if ( (*cid)->type() == computeNonbondedSelfType ||
604  (*cid)->type() == computeNonbondedPairType
605 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
606  || (*cid)->type() == computeNonbondedCUDA2Type
607 #endif
608  ) {
609  (*cid)->gbisP2PatchReady(patchID,seq);
610  }
611  }
612 }
Flags flags
Definition: Patch.h:128
int sequence
Definition: PatchTypes.h:18
ComputePtrList positionComputeList
Definition: Patch.h:221
const PatchID patchID
Definition: Patch.h:150

◆ gbisP3Ready()

void Patch::gbisP3Ready ( )

Definition at line 614 of file Patch.C.

References ResizeArrayPrimIter< T >::begin(), computeNonbondedCUDA2Type, computeNonbondedPairType, computeNonbondedSelfType, ResizeArrayPrimIter< T >::end(), flags, patchID, positionComputeList, and Flags::sequence.

Referenced by HomePatch::gbisP3Ready(), and ProxyPatch::receiveData().

614  {
615 
617 
618  int seq = flags.sequence;
619  for(cid = cid.begin(); cid != cid.end(); cid++) {
620  if ( (*cid)->type() == computeNonbondedSelfType ||
621  (*cid)->type() == computeNonbondedPairType
622 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
623  || (*cid)->type() == computeNonbondedCUDA2Type
624 #endif
625  ) {
626  (*cid)->gbisP3PatchReady(patchID,seq);
627  }
628  }
629 }
Flags flags
Definition: Patch.h:128
int sequence
Definition: PatchTypes.h:18
ComputePtrList positionComputeList
Definition: Patch.h:221
const PatchID patchID
Definition: Patch.h:150

◆ getCompAtomExtInfo()

CompAtomExt* Patch::getCompAtomExtInfo ( )
inline

◆ getCompAtomInfo()

CompAtom* Patch::getCompAtomInfo ( )
inline

Definition at line 118 of file Patch.h.

References ResizeArray< Elem >::begin(), and p.

118 {return p.begin(); }
CompAtomList p
Definition: Patch.h:153
iterator begin(void)
Definition: ResizeArray.h:36

◆ getCudaAtomList()

CudaAtom* Patch::getCudaAtomList ( )
inline

Definition at line 125 of file Patch.h.

References cudaAtomPtr.

125 { return cudaAtomPtr; }
CudaAtom * cudaAtomPtr
Definition: Patch.h:212

◆ getNumAtoms()

int Patch::getNumAtoms ( ) const
inline

◆ getNumComputes()

int Patch::getNumComputes ( ) const
inline

Definition at line 115 of file Patch.h.

References positionComputeList, and ResizeArray< Elem >::size().

115 { return positionComputeList.size(); }
int size(void) const
Definition: ResizeArray.h:131
ComputePtrList positionComputeList
Definition: Patch.h:221

◆ getNumFixedAtoms()

int Patch::getNumFixedAtoms ( ) const
inline

Definition at line 112 of file Patch.h.

References numFixedAtoms.

112 { return numFixedAtoms; } // not updated
int numFixedAtoms
Definition: Patch.h:152

◆ getPatchID()

PatchID Patch::getPatchID ( ) const
inline

◆ hasNewAtoms()

int Patch::hasNewAtoms ( )
inline

Definition at line 40 of file Patch.h.

References _hasNewAtoms.

40 { return _hasNewAtoms; }
int _hasNewAtoms
Definition: Patch.h:252

◆ intRadBoxClosed()

void Patch::intRadBoxClosed ( void  )

Definition at line 380 of file Patch.C.

References boxClosed().

380  {
381  //dHdrPrefixPtr = 0;
382  this->boxClosed(6);
383 }
virtual void boxClosed(int)=0

◆ lcpoTypeBoxClosed()

void Patch::lcpoTypeBoxClosed ( void  )

Definition at line 399 of file Patch.C.

References boxClosed().

399  {
400  this->boxClosed(10);
401 }
virtual void boxClosed(int)=0

◆ positionBoxClosed()

void Patch::positionBoxClosed ( void  )

Definition at line 246 of file Patch.C.

References boxClosed().

247 {
248  //positionPtrBegin = 0;
249  this->boxClosed(0);
250 }
virtual void boxClosed(int)=0

◆ positionsReady()

void Patch::positionsReady ( int  n = 0,
int  startup = 1 
)

Definition at line 403 of file Patch.C.

References _hasNewAtoms, atomMapper, avgPositionBox, avgPositionPtrBegin, ResizeArray< Elem >::begin(), bornRad, bornRadBox, boxesOpen, computesSortedByPriority, DebugM, dEdaSum, dEdaSumBox, dHdrPrefix, dHdrPrefixBox, Flags::doFullElectrostatics, Flags::doGBIS, Flags::doLCPO, Flags::doLoweAndersen, Flags::doMolly, ResizeArray< Elem >::end(), endi(), Results::f, f, firstHoldableCompute, flags, forceBox, getCompAtomExtInfo(), iINFO(), intRad, intRadBox, iout, lattice, lcpoType, lcpoTypeBox, Results::maxNumForces, PatchMap::node(), numAtoms, PatchMap::Object(), Sync::Object(), Node::Object(), OwnerBox< Owner, Data >::open(), p, patchID, pExt, PME_PRIORITY, CompAtom::position, positionBox, positionComputeList, psiFin, psiSum, psiSumBox, AtomMapper::registerIDsCompAtomExt(), ResizeArray< Elem >::resize(), results, Flags::sequence, ResizeArray< Elem >::setall(), Node::simParameters, simParams, ResizeArray< Elem >::size(), Lattice::unscale(), SimParameters::useAVXTiles, CompAtom::vdwType, velocityBox, velocityPtrBegin, Vector::x, Vector::y, and Vector::z.

Referenced by HomePatch::positionsReady(), HomePatch::positionsReady_SOA(), ProxyPatch::receiveAll(), and ProxyPatch::receiveData().

404 {
405  DebugM(4,"Patch::positionsReady() - patchID(" << patchID <<")"<<std::endl );
407 
408  // The atom map needs to be updated for host migration, device migration startup and
409  // device migration + some advanced features
410  const bool updateAtomMap = (startup ||
411  !simParams->useDeviceMigration ||
412  simParams->updateAtomMap);
413  if (doneMigration && updateAtomMap) {
414 // #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
415 // AtomMap::Object()->registerIDs(patchID,positionPtrBegin,positionPtrEnd);
416 // #else
418 // #endif
419 
420  #ifdef NAMD_AVXTILES
422  #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
423  const CompAtom * const pd = positionPtrBegin;
424  #else
425  const CompAtom * const pd = p.begin();
426  #endif
427  tiles.atomUpdate(pd, getCompAtomExtInfo());
428  }
429  #endif
430  }
431 
432 #ifdef NAMD_KNL
433  #if defined(NAMD_AVXTILES)
434  if (!Node::Object()->simParameters->useAVXTiles)
435  #endif
436  {
437  const Vector center = lattice.unscale( PatchMap::Object()->center(patchID) );
438  const int n = numAtoms;
439  pFlt.resize(n);
440  CompAtomFlt * const pf = pFlt.begin();
441 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
442  const CompAtom * const pd = positionPtrBegin;
443 #else
444  const CompAtom * const pd = p.begin();
445 #endif
446  for ( int i=0; i<n; ++i ) {
447  // need to subtract center in double precision, then assign to float
448  pf[i].position.x = pd[i].position.x - center.x;
449  pf[i].position.y = pd[i].position.y - center.y;
450  pf[i].position.z = pd[i].position.z - center.z;
451  pf[i].vdwType = pd[i].vdwType;
452  }
453  }
454 #endif
455  boxesOpen = 2;
456  if ( flags.doMolly ) boxesOpen++;
457  // BEGIN LA
458  if (flags.doLoweAndersen) {
459  DebugM(4, "Patch::positionsReady, flags.doMolly = " << flags.doMolly << "\n");
460  boxesOpen++;
461  }
462  // END LA
463  _hasNewAtoms = (doneMigration != 0);
464 
465 #if CMK_BLUEGENEL
466  CmiNetworkProgressAfter (0);
467 #endif
468 
469  // Give all position pickup boxes access to positions
470  //positionPtrBegin = p.begin();
471 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
472  positionBox.open(positionPtrBegin);
473 #else
474  positionBox.open(p.begin());
475 #endif
476  if ( flags.doMolly ) {
477  //avgPositionPtrBegin = p_avg.begin();
479  }
480 
481  // BEGIN LA
482  if (flags.doLoweAndersen) {
484  }
485  // END LA
486  // begin gbis
487  if (flags.doGBIS) {
488  boxesOpen += 5;
489  //intRad should already be taken care of
491  psiSum.resize(numAtoms);//resize array
492  psiSum.setall(0);
494  psiFin.resize(numAtoms);//has no box
495  psiFin.setall(0);
497  bornRad.setall(0);
499  dEdaSum.resize(numAtoms);//resize array
500  dEdaSum.setall(0);
503  dHdrPrefix.setall(0);
505  }
506  // end gbis
507 
508  //LCPO
509  if (flags.doLCPO) {
510  boxesOpen++;
512  }
513 
514 #if CMK_BLUEGENEL
515  CmiNetworkProgressAfter (0);
516 #endif
517 
518  // Give all force deposit boxes access to forces
519  Force *forcePtr;
520 #ifdef NODEGROUP_FORCE_REGISTER
521 //#if 0
522  // Clear forces if GPU-offload or GPU-resident without device migration
523  const bool clearForces = (!simParams->CUDASOAintegrate ||
524  (doneMigration && !simParams->useDeviceMigration) );
525  for ( int j = 0; j < Results::maxNumForces; ++j )
526  {
527  f[j].resize(numAtoms);
528  forcePtr = f[j].begin();
529  if(clearForces) memset (forcePtr, 0, sizeof (Force) * numAtoms);
530  results.f[j] = forcePtr;
531  }
532 #else
533  for ( int j = 0; j < Results::maxNumForces; ++j )
534  {
535  f[j].resize(numAtoms);
536  forcePtr = f[j].begin();
537  memset (forcePtr, 0, sizeof (Force) * numAtoms);
538  results.f[j] = forcePtr;
539  }
540 #ifdef DEBUG_MINIMIZE
541  Force *pf = results.f[1];
542  int k=0;
543  printf("%s, line %d\n", __FILE__, __LINE__);
544  printf(" initial: pf[%d] = %f %f %f\n", k, pf[k].x, pf[k].y, pf[k].z);
545 #endif
546 #endif
547  // fprintf(stderr, "(Pe[%d] tstep %d) opening box on patch %d\n",
548  // CkMyPe(), this->flags.step, this->patchID);
550 
551  #ifdef NAMD_AVXTILES
552  // Zero data in arrays in "Tiles" data structures if they have been touched
553  if (Node::Object()->simParameters->useAVXTiles)
554  tiles.zeroForces(flags.doFullElectrostatics);
555  #endif
556 
557  if ( ! computesSortedByPriority ) {
558  if (positionComputeList.size() == 0 && PatchMap::Object()->node(patchID) != CkMyPe()) {
559  iout << iINFO << "PATCH_COUNT: Patch " << patchID
560  << " on PE " << CkMyPe() <<" home patch "
562  << " does not have any computes\n"
563  << endi;
564  }
565 
566  // XXX TODO: Maybe get rid of this sorting and see what happens
568  std::sort(positionComputeList.begin(), positionComputeList.end(), so);
570  int i;
571  for ( i=0; i<positionComputeList.size(); ++i ) {
572  if ( positionComputeList[i]->priority() > PME_PRIORITY ) break;
573  }
575  }
576 
577  int seq = flags.sequence;
578 
579  // Iterate over compute objects that need to be informed we are ready
581  for ( int i=0; i < firstHoldableCompute; ++i, ++cid ) {
582  (*cid)->patchReady(patchID,doneMigration,seq);
583  }
584  Compute **cend = positionComputeList.end();
585  // gzheng
586  if (Sync::Object()->holdComputes(patchID, cid, cend, doneMigration, seq)) {
587  return;
588  }
589 
590  for( ; cid != cend; cid++ ) {
591  (*cid)->patchReady(patchID,doneMigration,seq);
592  }
593 
594 }
static Node * Object()
Definition: Node.h:86
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:81
int firstHoldableCompute
Definition: Patch.h:218
int size(void) const
Definition: ResizeArray.h:131
RealList intRad
Definition: Patch.h:162
int computesSortedByPriority
Definition: Patch.h:217
OwnerBox< Patch, Results > forceBox
Definition: Patch.h:246
Lattice & lattice
Definition: Patch.h:127
static PatchMap * Object()
Definition: PatchMap.h:27
Definition: Vector.h:72
SimParameters * simParameters
Definition: Node.h:181
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:234
NAMD_HOST_DEVICE Position unscale(ScaledPosition s) const
Definition: Lattice.h:77
#define DebugM(x, y)
Definition: Debug.h:75
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:243
std::ostream & endi(std::ostream &s)
Definition: InfoStream.C:54
BigReal z
Definition: Vector.h:74
RealList dHdrPrefix
Definition: Patch.h:166
Position position
Definition: NamdTypes.h:77
GBRealList psiFin
Definition: Patch.h:164
void registerIDsCompAtomExt(const CompAtomExt *begin, const CompAtomExt *end)
Definition: AtomMap.C:24
#define iout
Definition: InfoStream.h:51
int doLoweAndersen
Definition: PatchTypes.h:27
AtomMapper * atomMapper
Definition: Patch.h:159
GBRealList dEdaSum
Definition: Patch.h:167
void open(Data *d)
Definition: OwnerBox.h:39
Flags flags
Definition: Patch.h:128
void resize(int i)
Definition: ResizeArray.h:84
void setall(const Elem &elem)
Definition: ResizeArray.h:94
#define PME_PRIORITY
Definition: Priorities.h:29
int boxesOpen
Definition: Patch.h:250
OwnerBox< Patch, CompAtom > avgPositionBox
Definition: Patch.h:222
IntList lcpoType
Definition: Patch.h:171
GBRealList psiSum
Definition: Patch.h:163
int doFullElectrostatics
Definition: PatchTypes.h:23
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:220
int16 vdwType
Definition: NamdTypes.h:79
Force * f[maxNumForces]
Definition: PatchTypes.h:146
CompAtomList p
Definition: Patch.h:153
static Sync * Object()
Definition: Sync.h:52
int numAtoms
Definition: Patch.h:151
BigReal x
Definition: Vector.h:74
int sequence
Definition: PatchTypes.h:18
CompAtom * avgPositionPtrBegin
Definition: Patch.h:204
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:225
ComputePtrList positionComputeList
Definition: Patch.h:221
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:230
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:238
#define simParams
Definition: Output.C:129
RealList bornRad
Definition: Patch.h:165
iterator begin(void)
Definition: ResizeArray.h:36
const PatchID patchID
Definition: Patch.h:150
int _hasNewAtoms
Definition: Patch.h:252
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:236
iterator end(void)
Definition: ResizeArray.h:37
BigReal y
Definition: Vector.h:74
int doLCPO
Definition: PatchTypes.h:30
int doGBIS
Definition: PatchTypes.h:29
Results results
Definition: Patch.h:215
int node(int pid) const
Definition: PatchMap.h:114
ForceList f[Results::maxNumForces]
Definition: Patch.h:214
CompAtomExtList pExt
Definition: Patch.h:181
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:232
int doMolly
Definition: PatchTypes.h:24
CompAtom * velocityPtrBegin
Definition: Patch.h:208
CompAtomExt * getCompAtomExtInfo()
Definition: Patch.h:117

◆ psiSumBoxClosed()

void Patch::psiSumBoxClosed ( void  )

Definition at line 377 of file Patch.C.

References boxClosed().

377  {
378  this->boxClosed(5);
379 }
virtual void boxClosed(int)=0

◆ registerAvgPositionPickup()

Box< Patch, CompAtom > * Patch::registerAvgPositionPickup ( Compute cid)

Definition at line 133 of file Patch.C.

References avgPositionBox, OwnerBox< Owner, Data >::checkOut(), and Compute::cid.

Referenced by ComputeNonbondedPair::initialize(), ComputeNonbondedSelf::initialize(), ComputePme::initialize(), PatchElem::PatchElem(), and TuplePatchElem::TuplePatchElem().

134 {
135  //DebugM(4, "registerAvgPositionPickup("<<patchID<<") from " << cid->cid << "\n");
136  return avgPositionBox.checkOut(cid->cid);
137 }
OwnerBox< Patch, CompAtom > avgPositionBox
Definition: Patch.h:222
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
const ComputeID cid
Definition: Compute.h:43

◆ registerBornRadPickup()

Box< Patch, Real > * Patch::registerBornRadPickup ( Compute cid)

Definition at line 195 of file Patch.C.

References bornRadBox, OwnerBox< Owner, Data >::checkOut(), and Compute::cid.

Referenced by ComputeNonbondedPair::initialize(), and ComputeNonbondedSelf::initialize().

195  {
196  return bornRadBox.checkOut(cid->cid);
197 }
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:234
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
const ComputeID cid
Definition: Compute.h:43

◆ registerDEdaSumDeposit()

Box< Patch, GBReal > * Patch::registerDEdaSumDeposit ( Compute cid)

Definition at line 203 of file Patch.C.

References SortedArray< Elem >::add(), OwnerBox< Owner, Data >::checkOut(), Compute::cid, DebugM, dEdaSumBox, dEdaSumComputeList, and ResizeArray< Elem >::size().

Referenced by ComputeNonbondedPair::initialize(), and ComputeNonbondedSelf::initialize().

203  {
204  if (dEdaSumComputeList.add(cid) < 0) {
205  DebugM(7, "registerDEdaSumDeposit() failed for cid " << cid->cid << std::endl);
206  DebugM(7, " size of dEdaSumCompueList " << dEdaSumComputeList.size() << std::endl);
207  return NULL;
208  }
209  return dEdaSumBox.checkOut(cid->cid);
210 }
int size(void) const
Definition: ResizeArray.h:131
ComputePtrList dEdaSumComputeList
Definition: Patch.h:237
#define DebugM(x, y)
Definition: Debug.h:75
int add(const Elem &elem)
Definition: SortedArray.h:55
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:236
const ComputeID cid
Definition: Compute.h:43

◆ registerDHdrPrefixPickup()

Box< Patch, Real > * Patch::registerDHdrPrefixPickup ( Compute cid)

Definition at line 217 of file Patch.C.

References OwnerBox< Owner, Data >::checkOut(), Compute::cid, and dHdrPrefixBox.

Referenced by ComputeNonbondedPair::initialize(), and ComputeNonbondedSelf::initialize().

218 {
219  return dHdrPrefixBox.checkOut(cid->cid);
220 }
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:238
const ComputeID cid
Definition: Compute.h:43

◆ registerForceDeposit()

Box< Patch, Results > * Patch::registerForceDeposit ( Compute cid)

Definition at line 227 of file Patch.C.

References SortedArray< Elem >::add(), OwnerBox< Owner, Data >::checkOut(), Compute::cid, DebugM, forceBox, forceComputeList, and ResizeArray< Elem >::size().

Referenced by ComputePatch::initialize(), ComputeHomePatch::initialize(), ComputePatchPair::initialize(), ComputePme::initialize(), ComputeLCPO::initialize(), PatchElem::PatchElem(), and TuplePatchElem::TuplePatchElem().

228 {
229  if (forceComputeList.add(cid) < 0)
230  {
231  DebugM(7, "registerForceDeposit() failed for cid " << cid->cid << std::endl);
232  DebugM(7, " size of forceCompueList " << forceComputeList.size() << std::endl);
233  return NULL;
234  }
235  return forceBox.checkOut(cid->cid);
236 }
ComputePtrList forceComputeList
Definition: Patch.h:247
int size(void) const
Definition: ResizeArray.h:131
OwnerBox< Patch, Results > forceBox
Definition: Patch.h:246
#define DebugM(x, y)
Definition: Debug.h:75
int add(const Elem &elem)
Definition: SortedArray.h:55
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
const ComputeID cid
Definition: Compute.h:43

◆ registerIntRadPickup()

Box< Patch, Real > * Patch::registerIntRadPickup ( Compute cid)

Definition at line 178 of file Patch.C.

References OwnerBox< Owner, Data >::checkOut(), Compute::cid, and intRadBox.

Referenced by ComputeNonbondedPair::initialize(), and ComputeNonbondedSelf::initialize().

178  {
179  return intRadBox.checkOut(cid->cid);
180 }
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:230
const ComputeID cid
Definition: Compute.h:43

◆ registerLcpoTypePickup()

Box< Patch, int > * Patch::registerLcpoTypePickup ( Compute cid)

Definition at line 187 of file Patch.C.

References OwnerBox< Owner, Data >::checkOut(), Compute::cid, and lcpoTypeBox.

Referenced by ComputeLCPO::initialize().

187  {
188  return lcpoTypeBox.checkOut(cid->cid);
189 }
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:243
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
const ComputeID cid
Definition: Compute.h:43

◆ registerPositionPickup()

Box< Patch, CompAtom > * Patch::registerPositionPickup ( Compute cid)

Definition at line 106 of file Patch.C.

References SortedArray< Elem >::add(), OwnerBox< Owner, Data >::checkOut(), Compute::cid, computesSortedByPriority, DebugM, positionBox, positionComputeList, and SortedArray< Elem >::sort().

Referenced by ComputePatch::initialize(), ComputeHomePatch::initialize(), ComputePatchPair::initialize(), ComputePme::initialize(), ComputeLCPO::initialize(), PatchElem::PatchElem(), and TuplePatchElem::TuplePatchElem().

107 {
108  if ( computesSortedByPriority ) {
111  }
112  //DebugM(4, "registerPositionPickupa("<<patchID<<") from " << cid->cid << "\n");
113  if (positionComputeList.add(cid) < 0)
114  {
115  DebugM(7, "registerPositionPickup() failed for cid " << cid->cid << std::endl);
116  return NULL;
117  }
118  return positionBox.checkOut(cid->cid);
119 }
int computesSortedByPriority
Definition: Patch.h:217
void sort(void)
Definition: SortedArray.h:66
#define DebugM(x, y)
Definition: Debug.h:75
int add(const Elem &elem)
Definition: SortedArray.h:55
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:220
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
ComputePtrList positionComputeList
Definition: Patch.h:221
const ComputeID cid
Definition: Compute.h:43

◆ registerPsiSumDeposit()

Box< Patch, GBReal > * Patch::registerPsiSumDeposit ( Compute cid)

Definition at line 163 of file Patch.C.

References SortedArray< Elem >::add(), OwnerBox< Owner, Data >::checkOut(), Compute::cid, DebugM, psiSumBox, psiSumComputeList, and ResizeArray< Elem >::size().

Referenced by ComputeNonbondedPair::initialize(), and ComputeNonbondedSelf::initialize().

163  {
164 
165  if (psiSumComputeList.add(cid) < 0) {
166  DebugM(7, "registerPsiSumDeposit() failed for cid " << cid->cid << std::endl);
167  DebugM(7, " size of psiSumCompueList " << psiSumComputeList.size() << std::endl);
168  return NULL;
169  }
170  return psiSumBox.checkOut(cid->cid);
171 }
int size(void) const
Definition: ResizeArray.h:131
ComputePtrList psiSumComputeList
Definition: Patch.h:233
#define DebugM(x, y)
Definition: Debug.h:75
int add(const Elem &elem)
Definition: SortedArray.h:55
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
const ComputeID cid
Definition: Compute.h:43
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:232

◆ registerVelocityPickup()

Box< Patch, CompAtom > * Patch::registerVelocityPickup ( Compute cid)

Definition at line 147 of file Patch.C.

References OwnerBox< Owner, Data >::checkOut(), Compute::cid, and velocityBox.

Referenced by ComputeNonbondedPair::initialize(), and ComputeNonbondedSelf::initialize().

148 {
149  //DebugM(4, "registerVelocityPickup("<<patchID<<") from " << cid->cid << "\n");
150  return velocityBox.checkOut(cid->cid);
151 }
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:85
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:225
const ComputeID cid
Definition: Compute.h:43

◆ setNumFixedAtoms()

void Patch::setNumFixedAtoms ( int  numFixed)
inline

Definition at line 113 of file Patch.h.

References numFixedAtoms.

Referenced by PatchMgr::setHomePatchFixedAtomNum().

113 { numFixedAtoms=numFixed; } // not updated
int numFixedAtoms
Definition: Patch.h:152

◆ unregisterAvgPositionPickup()

void Patch::unregisterAvgPositionPickup ( Compute cid,
Box< Patch, CompAtom > **const  box 
)

Definition at line 139 of file Patch.C.

References avgPositionBox, OwnerBox< Owner, Data >::checkIn(), Compute::cid, and DebugM.

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), ComputeNonbondedSelf::~ComputeNonbondedSelf(), ComputePmeCUDA::~ComputePmeCUDA(), and ComputeSelfTuples< TholeElem, Thole, TholeValue >::~ComputeSelfTuples().

140 {
141  DebugM(4, "UnregisterAvgPositionPickup from " << cid->cid << "\n");
142  avgPositionBox.checkIn(*box);
143  *box = 0;
144 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
#define DebugM(x, y)
Definition: Debug.h:75
OwnerBox< Patch, CompAtom > avgPositionBox
Definition: Patch.h:222
const ComputeID cid
Definition: Compute.h:43

◆ unregisterBornRadPickup()

void Patch::unregisterBornRadPickup ( Compute cid,
Box< Patch, Real > **const  box 
)

Definition at line 198 of file Patch.C.

References bornRadBox, and OwnerBox< Owner, Data >::checkIn().

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), and ComputeNonbondedSelf::~ComputeNonbondedSelf().

198  {
199  bornRadBox.checkIn(*box);
200  *box = 0;
201 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:234

◆ unregisterDEdaSumDeposit()

void Patch::unregisterDEdaSumDeposit ( Compute cid,
Box< Patch, GBReal > **const  box 
)

Definition at line 211 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), dEdaSumBox, dEdaSumComputeList, and SortedArray< Elem >::del().

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), and ComputeNonbondedSelf::~ComputeNonbondedSelf().

211  {
212  dEdaSumComputeList.del(cid);
213  dEdaSumBox.checkIn(*box);
214  *box = 0;
215 }
ComputePtrList dEdaSumComputeList
Definition: Patch.h:237
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
void del(const Elem &elem)
Definition: SortedArray.h:59
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:236

◆ unregisterDHdrPrefixPickup()

void Patch::unregisterDHdrPrefixPickup ( Compute cid,
Box< Patch, Real > **const  box 
)

Definition at line 221 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), and dHdrPrefixBox.

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), and ComputeNonbondedSelf::~ComputeNonbondedSelf().

221  {
222  dHdrPrefixBox.checkIn(*box);
223  *box = 0;
224 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:238

◆ unregisterForceDeposit()

void Patch::unregisterForceDeposit ( Compute cid,
Box< Patch, Results > **const  box 
)

Definition at line 238 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), DebugM, SortedArray< Elem >::del(), forceBox, and forceComputeList.

Referenced by ComputeHomePatch::~ComputeHomePatch(), ComputeLCPO::~ComputeLCPO(), ComputePatch::~ComputePatch(), ComputePatchPair::~ComputePatchPair(), ComputePmeCUDA::~ComputePmeCUDA(), and ComputeSelfTuples< TholeElem, Thole, TholeValue >::~ComputeSelfTuples().

239 {
240  DebugM(4, "unregisterForceDeposit() computeID("<<cid<<")"<<std::endl);
241  forceComputeList.del(cid);
242  forceBox.checkIn(*box);
243  *box = 0;
244 }
ComputePtrList forceComputeList
Definition: Patch.h:247
OwnerBox< Patch, Results > forceBox
Definition: Patch.h:246
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
#define DebugM(x, y)
Definition: Debug.h:75
void del(const Elem &elem)
Definition: SortedArray.h:59

◆ unregisterIntRadPickup()

void Patch::unregisterIntRadPickup ( Compute cid,
Box< Patch, Real > **const  box 
)

Definition at line 181 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), and intRadBox.

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), and ComputeNonbondedSelf::~ComputeNonbondedSelf().

181  {
182  intRadBox.checkIn(*box);
183  *box = 0;
184 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:230

◆ unregisterLcpoTypePickup()

void Patch::unregisterLcpoTypePickup ( Compute cid,
Box< Patch, int > **const  box 
)

Definition at line 190 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), and lcpoTypeBox.

Referenced by ComputeLCPO::~ComputeLCPO().

190  {
191  lcpoTypeBox.checkIn(*box);
192  *box = 0;
193 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:243

◆ unregisterPositionPickup()

void Patch::unregisterPositionPickup ( Compute cid,
Box< Patch, CompAtom > **const  box 
)

Definition at line 121 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), Compute::cid, computesSortedByPriority, DebugM, SortedArray< Elem >::del(), positionBox, positionComputeList, and SortedArray< Elem >::sort().

Referenced by ComputeHomePatch::~ComputeHomePatch(), ComputeLCPO::~ComputeLCPO(), ComputePatch::~ComputePatch(), ComputePatchPair::~ComputePatchPair(), ComputePmeCUDA::~ComputePmeCUDA(), and ComputeSelfTuples< TholeElem, Thole, TholeValue >::~ComputeSelfTuples().

122 {
123  if ( computesSortedByPriority ) {
126  }
127  DebugM(4, "UnregisterPositionPickup from " << cid->cid << "\n");
129  positionBox.checkIn(*box);
130  *box = 0;
131 }
int computesSortedByPriority
Definition: Patch.h:217
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
void sort(void)
Definition: SortedArray.h:66
#define DebugM(x, y)
Definition: Debug.h:75
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:220
void del(const Elem &elem)
Definition: SortedArray.h:59
ComputePtrList positionComputeList
Definition: Patch.h:221
const ComputeID cid
Definition: Compute.h:43

◆ unregisterPsiSumDeposit()

void Patch::unregisterPsiSumDeposit ( Compute cid,
Box< Patch, GBReal > **const  box 
)

Definition at line 173 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), SortedArray< Elem >::del(), psiSumBox, and psiSumComputeList.

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), and ComputeNonbondedSelf::~ComputeNonbondedSelf().

173  {
174  psiSumComputeList.del(cid);
175  psiSumBox.checkIn(*box);
176  *box = 0;
177 }
ComputePtrList psiSumComputeList
Definition: Patch.h:233
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
void del(const Elem &elem)
Definition: SortedArray.h:59
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:232

◆ unregisterVelocityPickup()

void Patch::unregisterVelocityPickup ( Compute cid,
Box< Patch, CompAtom > **const  box 
)

Definition at line 153 of file Patch.C.

References OwnerBox< Owner, Data >::checkIn(), Compute::cid, DebugM, and velocityBox.

Referenced by ComputeNonbondedPair::~ComputeNonbondedPair(), and ComputeNonbondedSelf::~ComputeNonbondedSelf().

154 {
155  DebugM(4, "UnregisterVelocityPickup from " << cid->cid << "\n");
156  velocityBox.checkIn(*box);
157  *box = 0;
158 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:104
#define DebugM(x, y)
Definition: Debug.h:75
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:225
const ComputeID cid
Definition: Compute.h:43

◆ velocityBoxClosed()

void Patch::velocityBoxClosed ( void  )

Definition at line 366 of file Patch.C.

References boxClosed(), DebugM, patchID, and velocityPtrBegin.

367 {
368  DebugM(4, "patchID("<<patchID<<") velocityBoxClosed! call\n");
369  velocityPtrBegin = 0;
370  this->boxClosed(4); // ?? Don't know about number
371 }
#define DebugM(x, y)
Definition: Debug.h:75
const PatchID patchID
Definition: Patch.h:150
virtual void boxClosed(int)=0
CompAtom * velocityPtrBegin
Definition: Patch.h:208

Member Data Documentation

◆ _hasNewAtoms

int Patch::_hasNewAtoms
protected

Definition at line 252 of file Patch.h.

Referenced by hasNewAtoms(), and positionsReady().

◆ atomMapper

AtomMapper* Patch::atomMapper
protected

◆ avgPositionBox

OwnerBox<Patch,CompAtom> Patch::avgPositionBox
protected

Definition at line 222 of file Patch.h.

Referenced by positionsReady(), registerAvgPositionPickup(), and unregisterAvgPositionPickup().

◆ avgPositionComputeList

ComputePtrList Patch::avgPositionComputeList
protected

Definition at line 223 of file Patch.h.

◆ avgPositionPtrBegin

CompAtom* Patch::avgPositionPtrBegin
protected

◆ avgPositionPtrEnd

CompAtom* Patch::avgPositionPtrEnd
protected

◆ bornRad

RealList Patch::bornRad
protected

◆ bornRadBox

OwnerBox<Patch,Real> Patch::bornRadBox
protected

Definition at line 234 of file Patch.h.

Referenced by positionsReady(), registerBornRadPickup(), and unregisterBornRadPickup().

◆ bornRadComputeList

ComputePtrList Patch::bornRadComputeList
protected

Definition at line 235 of file Patch.h.

◆ boxesOpen

int Patch::boxesOpen
protected

◆ child

int* Patch::child
protected

◆ computesSortedByPriority

int Patch::computesSortedByPriority
protected

Definition at line 217 of file Patch.h.

Referenced by positionsReady(), registerPositionPickup(), and unregisterPositionPickup().

◆ cudaAtomPtr

CudaAtom* Patch::cudaAtomPtr
protected

◆ dEdaSum

GBRealList Patch::dEdaSum
protected

Definition at line 167 of file Patch.h.

Referenced by ProxyPatch::boxClosed(), HomePatch::gbisComputeAfterP2(), and positionsReady().

◆ dEdaSumBox

OwnerBox<Patch,GBReal> Patch::dEdaSumBox
protected

◆ dEdaSumComputeList

ComputePtrList Patch::dEdaSumComputeList
protected

Definition at line 237 of file Patch.h.

Referenced by registerDEdaSumDeposit(), and unregisterDEdaSumDeposit().

◆ dHdrPrefix

RealList Patch::dHdrPrefix
protected

◆ dHdrPrefixBox

OwnerBox<Patch,Real> Patch::dHdrPrefixBox
protected

Definition at line 238 of file Patch.h.

Referenced by positionsReady(), registerDHdrPrefixPickup(), and unregisterDHdrPrefixPickup().

◆ dHdrPrefixComputeList

ComputePtrList Patch::dHdrPrefixComputeList
protected

Definition at line 239 of file Patch.h.

◆ f

ForceList Patch::f[Results::maxNumForces]
protected

◆ firstHoldableCompute

int Patch::firstHoldableCompute
protected

Definition at line 218 of file Patch.h.

Referenced by positionsReady().

◆ flags

Flags Patch::flags

Definition at line 128 of file Patch.h.

Referenced by Sequencer::addForceToMomentum(), Sequencer::addForceToMomentum3(), Sequencer::addForceToMomentum_SOA(), Sequencer::addVelocityToPosition(), Sequencer::addVelocityToPosition_SOA(), ProxyPatch::boxClosed(), HomePatch::boxClosed(), HomePatch::buildRattleList(), HomePatch::buildRattleList_SOA(), AngleElem::computeForce(), DihedralElem::computeForce(), ImproperElem::computeForce(), CrosstermElem::computeForce(), AnisoElem::computeForce(), TholeElem::computeForce(), BondElem::computeForce(), ExclElem::computeForce(), ComputeGridForce::do_calc(), ComputeEField::doForce(), ComputeStir::doForce(), ComputeNonbondedPair::doForce(), ComputeGridForce::doForce(), ComputeNonbondedSelf::doForce(), ComputeRestraints::doForce(), ComputeLCPO::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doGroupSizeCheck_SOA(), HomePatch::doPairlistCheck(), ComputePatch::doWork(), ComputePme::doWork(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), forceBoxClosed(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), gbisP2Ready(), HomePatch::gbisP2Ready(), gbisP3Ready(), HomePatch::gbisP3Ready(), Sequencer::integrate(), Sequencer::integrate_SOA(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK1_SOA(), Sequencer::langevinVelocitiesBBK2(), Sequencer::langevinVelocitiesBBK2_SOA(), CudaComputeNonbonded::launchWork(), Sequencer::maximumMove(), Sequencer::maximumMove_SOA(), Sequencer::minimize(), Sequencer::multigratorPressure(), Sequencer::newtonianVelocities(), ComputeNonbondedSelf::noWork(), ComputePme::noWork(), positionsReady(), HomePatch::positionsReady(), HomePatch::positionsReady_SOA(), Sequencer::rattle1(), Sequencer::rattle1_SOA(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), HomePatch::receiveResult(), Sequencer::runComputeObjects(), Sequencer::runComputeObjects_SOA(), Sequencer::submitCollections(), Sequencer::submitCollections_SOA(), Sequencer::submitHalfstep(), Sequencer::submitHalfstep_SOA(), Sequencer::submitMinimizeReductions(), Sequencer::submitReductions(), Sequencer::submitReductions_SOA(), and ComputePme::ungridForces().

◆ forceBox

OwnerBox<Patch,Results> Patch::forceBox
protected

◆ forceComputeList

ComputePtrList Patch::forceComputeList
protected

Definition at line 247 of file Patch.h.

Referenced by registerForceDeposit(), and unregisterForceDeposit().

◆ intRad

RealList Patch::intRad
protected

◆ intRadBox

OwnerBox<Patch,Real> Patch::intRadBox
protected

Definition at line 230 of file Patch.h.

Referenced by positionsReady(), registerIntRadPickup(), and unregisterIntRadPickup().

◆ intRadComputeList

ComputePtrList Patch::intRadComputeList
protected

Definition at line 231 of file Patch.h.

◆ lattice

Lattice& Patch::lattice

Definition at line 127 of file Patch.h.

Referenced by Sequencer::berendsenPressure(), Sequencer::berendsenPressure_SOA(), HomePatch::checkpoint(), AngleElem::computeForce(), CrosstermElem::computeForce(), ImproperElem::computeForce(), DihedralElem::computeForce(), TholeElem::computeForce(), AnisoElem::computeForce(), BondElem::computeForce(), ExclElem::computeForce(), GromacsPairElem::computeForce(), HomePatch::depositMigration(), ComputeGridForce::do_calc(), HomePatch::doAtomMigration(), ComputeConsForce::doForce(), ComputeEField::doForce(), ComputeConsTorque::doForce(), ComputeStir::doForce(), ComputeNonbondedPair::doForce(), ComputeNonbondedSelf::doForce(), ComputeGridForce::doForce(), ComputeRestraints::doForce(), HomePatch::doMarginCheck(), HomePatch::doMarginCheck_SOA(), HomePatch::doPairlistCheck(), ComputeHomeTuples< TholeElem, Thole, TholeValue >::doWork(), HomePatch::exchangeAtoms(), forceBoxClosed(), HomePatch::hardWallDrude(), Sequencer::langevinPiston(), Sequencer::langevinPiston_SOA(), PatchMgr::moveAllBy(), PatchMgr::moveAtom(), Sequencer::multigratorPressure(), Patch(), positionsReady(), HomePatch::positionsReady(), HomePatch::positionsReady_SOA(), HomePatch::rattle1old(), HomePatch::recvCheckpointLoad(), HomePatch::recvExchangeMsg(), HomePatch::revert(), Sequencer::scalePositionsVelocities(), PatchMgr::setLattice(), Sequencer::submitCollections(), Sequencer::submitCollections_SOA(), Sequencer::submitHalfstep(), Sequencer::submitReductions(), and Sequencer::submitReductions_SOA().

◆ lcpoType

IntList Patch::lcpoType
protected

◆ lcpoTypeBox

OwnerBox<Patch,int> Patch::lcpoTypeBox
protected

Definition at line 243 of file Patch.h.

Referenced by positionsReady(), registerLcpoTypePickup(), and unregisterLcpoTypePickup().

◆ lcpoTypeComputeList

ComputePtrList Patch::lcpoTypeComputeList
protected

Definition at line 244 of file Patch.h.

◆ nChild

int Patch::nChild
protected

◆ numAtoms

int Patch::numAtoms
protected

Definition at line 151 of file Patch.h.

Referenced by Sequencer::addForceToMomentum(), Sequencer::addForceToMomentum3(), Sequencer::addMovDragToPosition(), HomePatch::addRattleForce(), Sequencer::addRotDragToPosition(), Sequencer::addVelocityToPosition(), Sequencer::berendsenPressure(), ProxyPatch::boxClosed(), HomePatch::boxClosed(), HomePatch::buildRattleList(), HomePatch::buildRattleList_SOA(), Sequencer::calcFixVirial(), Sequencer::calcKineticEnergy(), Sequencer::correctMomentum(), HomePatch::depositMigration(), HomePatch::doAtomMigration(), HomePatch::doGroupSizeCheck_SOA(), HomePatch::doMarginCheck_SOA(), HomePatch::doPairlistCheck(), HomePatch::exchangeAtoms(), forceBoxClosed(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), HomePatch::gbisP2Ready(), HomePatch::gbisP3Ready(), getNumAtoms(), HomePatch::hardWallDrude(), Sequencer::langevinPiston(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), HomePatch::loweAndersenVelocities(), Sequencer::maximumMove(), Sequencer::minimizationQuenchVelocity(), HomePatch::minimize_rattle2(), Sequencer::minimizeMoveDownhill(), HomePatch::mollyAverage(), HomePatch::mollyMollify(), Sequencer::multigratorPressure(), Sequencer::multigratorTemperature(), Sequencer::newMinimizeDirection(), Sequencer::newMinimizePosition(), positionsReady(), HomePatch::positionsReady(), HomePatch::positionsReady_SOA(), ProxyPatch::ProxyPatch(), HomePatch::qmSwapAtoms(), Sequencer::quenchVelocities(), Sequencer::rattle1(), HomePatch::rattle1(), HomePatch::rattle1_SOA(), HomePatch::rattle1old(), HomePatch::rattle2(), Sequencer::reassignVelocities(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), HomePatch::recvCheckpointLoad(), HomePatch::recvExchangeMsg(), Sequencer::reinitVelocities(), Sequencer::reloadCharges(), Sequencer::rescaleaccelMD(), Sequencer::rescaleSoluteCharges(), Sequencer::rescaleVelocities(), Sequencer::rescaleVelocitiesByFactor(), HomePatch::revert(), Sequencer::runComputeObjects(), Sequencer::runComputeObjects_SOA(), HomePatch::saveForce(), ComputeGlobal::saveTotalForces(), Sequencer::scalePositionsVelocities(), Sequencer::scaleVelocities(), HomePatch::setGBISIntrinsicRadii(), HomePatch::setLcpoType(), Sequencer::stochRescaleVelocities(), Sequencer::submitHalfstep(), HomePatch::submitLoadStats(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), Sequencer::submitReductions(), and Sequencer::tcoupleVelocities().

◆ numFixedAtoms

int Patch::numFixedAtoms
protected

Definition at line 152 of file Patch.h.

Referenced by getNumFixedAtoms(), and setNumFixedAtoms().

◆ p

CompAtomList Patch::p
protected

◆ p_avg

CompAtomList Patch::p_avg
protected

◆ patchID

const PatchID Patch::patchID
protected

◆ pExt

CompAtomExtList Patch::pExt
protected

◆ positionBox

OwnerBox<Patch,CompAtom> Patch::positionBox
protected

Definition at line 220 of file Patch.h.

Referenced by positionsReady(), registerPositionPickup(), and unregisterPositionPickup().

◆ positionComputeList

ComputePtrList Patch::positionComputeList
protected

◆ psiFin

GBRealList Patch::psiFin
protected

◆ psiSum

GBRealList Patch::psiSum
protected

Definition at line 163 of file Patch.h.

Referenced by ProxyPatch::boxClosed(), HomePatch::gbisComputeAfterP1(), and positionsReady().

◆ psiSumBox

OwnerBox<Patch,GBReal> Patch::psiSumBox
protected

◆ psiSumComputeList

ComputePtrList Patch::psiSumComputeList
protected

Definition at line 233 of file Patch.h.

Referenced by registerPsiSumDeposit(), and unregisterPsiSumDeposit().

◆ results

Results Patch::results
protected

Definition at line 215 of file Patch.h.

Referenced by forceBoxClosed(), and positionsReady().

◆ v

CompAtomList Patch::v
protected

◆ velocityBox

OwnerBox<Patch,CompAtom> Patch::velocityBox
protected

Definition at line 225 of file Patch.h.

Referenced by positionsReady(), registerVelocityPickup(), and unregisterVelocityPickup().

◆ velocityComputeList

ComputePtrList Patch::velocityComputeList
protected

Definition at line 226 of file Patch.h.

◆ velocityPtrBegin

CompAtom* Patch::velocityPtrBegin
protected

◆ velocityPtrEnd

CompAtom* Patch::velocityPtrEnd
protected

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