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)
 
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 ()
 
int getNumFixedAtoms ()
 
void setNumFixedAtoms (int numFixed)
 
PatchID getPatchID ()
 
int getNumComputes ()
 
CompAtomExtgetCompAtomExtInfo ()
 
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 ( PatchID  pd)

Definition at line 45 of file Patch.C.

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

45  :
47  patchID(pd), numAtoms(0), numFixedAtoms(0),
49  velocityPtrBegin(0), velocityPtrEnd(0), // BEGIN LA, END LA
52  velocityBox(this,&Patch::velocityBoxClosed,pd,4), // BEGIN LA, END LA
53  psiSumBox(this,&Patch::psiSumBoxClosed,pd,5), // begin gbis
57  dHdrPrefixBox(this,&Patch::dHdrPrefixBoxClosed,pd,9), //end gbis
59  forceBox(this,&Patch::forceBoxClosed,pd,1),
60  boxesOpen(0), _hasNewAtoms(0),
62 
63  // DMK - Atom Separation (water vs. non-water)
64  #if NAMD_SeparateWaters != 0
65  ,numWaterAtoms(-1)
66  #endif
67 {
68  //CkPrintf("GBIS: PatchCreated\n");
69 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
70  positionPtrBegin = 0;
71  positionPtrEnd = 0;
72 #endif
73 
74  nChild = 0;
75  child = NULL;
76 #ifdef NODEAWARE_PROXY_SPANNINGTREE
77  #ifdef USE_NODEPATCHMGR
78  nodeChildren = NULL;
79  numNodeChild = 0;
80  #endif
81 #endif
82 
84  atomMapper = new AtomMapper(pd);
85 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
87 #endif
88 
89  // DMK
90  #if defined(NAMD_MIC)
91  cudaAtomPtr = NULL;
92  #if MIC_SUBMIT_ATOMS_ON_ARRIVAL != 0
93  pthread_mutex_init(&mic_atomData_mutex, NULL);
94  mic_atomData = NULL;
95  mic_atomData_seq = -1;
96  mic_atomData_allocSize_host = 0;
97  for (int i = 0; i < MIC_MAX_DEVICES_PER_NODE; i++) {
98  mic_atomData_prev[i] = NULL;
99  mic_atomData_deviceSeq[i] = -1;
100  mic_atomData_devicePtr[i] = 0;
101  mic_atomData_allocSize_device[i] = 0;
102  }
103  #endif
104  #endif
105 }
static Node * Object()
Definition: Node.h:86
int firstHoldableCompute
Definition: Patch.h:211
int computesSortedByPriority
Definition: Patch.h:210
OwnerBox< Patch, Results > forceBox
Definition: Patch.h:239
void dHdrPrefixBoxClosed(void)
Definition: Patch.C:392
Lattice & lattice
Definition: Patch.h:126
CompAtom * velocityPtrEnd
Definition: Patch.h:202
SimParameters * simParameters
Definition: Node.h:178
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:227
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:236
CompAtom * avgPositionPtrEnd
Definition: Patch.h:198
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:365
void dEdaSumBoxClosed(void)
Definition: Patch.C:388
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:278
CudaAtom * cudaAtomPtr
Definition: Patch.h:205
void forceBoxClosed(void)
Definition: Patch.C:253
AtomMapper * atomMapper
Definition: Patch.h:152
Flags flags
Definition: Patch.h:127
int boxesOpen
Definition: Patch.h:243
OwnerBox< Patch, CompAtom > avgPositionBox
Definition: Patch.h:215
int numFixedAtoms
Definition: Patch.h:145
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:213
int numAtoms
Definition: Patch.h:144
void lcpoTypeBoxClosed(void)
Definition: Patch.C:399
CompAtom * avgPositionPtrBegin
Definition: Patch.h:197
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:218
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:223
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:231
const PatchID patchID
Definition: Patch.h:143
int _hasNewAtoms
Definition: Patch.h:245
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:229
Lattice lattice
Definition: PatchTypes.h:44
int * child
Definition: Patch.h:262
void bornRadBoxClosed(void)
Definition: Patch.C:384
void positionBoxClosed(void)
Definition: Patch.C:247
void avgPositionBoxClosed(void)
Definition: Patch.C:359
void velocityBoxClosed(void)
Definition: Patch.C:366
int nChild
Definition: Patch.h:263
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:225
void intRadBoxClosed(void)
Definition: Patch.C:380
void psiSumBoxClosed(void)
Definition: Patch.C:377
CompAtom * velocityPtrBegin
Definition: Patch.h:201
Patch::~Patch ( )
virtual

Definition at line 38 of file Patch.C.

References atomMapper.

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

Member Function Documentation

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:197
virtual void boxClosed(int)=0
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
virtual void Patch::boxClosed ( int  )
protectedpure virtual
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
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
void Patch::forceBoxClosed ( void  )

Definition at line 253 of file Patch.C.

References ResizeArray< T >::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< T >::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.

254 {
255  DebugM(4, "patchID("<<patchID<<") forceBoxClosed! call\n");
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:126
static PatchMap * Object()
Definition: PatchMap.h:27
Definition: Vector.h:64
BigReal & item(int i)
Definition: ReductionMgr.h:312
#define DebugM(x, y)
Definition: Debug.h:59
BigReal z
Definition: Vector.h:66
Flags flags
Definition: Patch.h:127
register BigReal virial_yy
int doFullElectrostatics
Definition: PatchTypes.h:23
Force * f[maxNumForces]
Definition: PatchTypes.h:67
CompAtomList p
Definition: Patch.h:146
int numAtoms
Definition: Patch.h:144
register BigReal virial_zz
BigReal x
Definition: Vector.h:66
void resize(int i)
Definition: ResizeArray.h:84
Position unscale(ScaledPosition s) const
Definition: Lattice.h:77
const PatchID patchID
Definition: Patch.h:143
int doVirial
Definition: PatchTypes.h:21
BigReal y
Definition: Vector.h:66
register BigReal virial_xx
Results results
Definition: Patch.h:208
void submit(void)
Definition: ReductionMgr.h:323
ForceList f[Results::maxNumForces]
Definition: Patch.h:207
virtual void boxClosed(int)=0
double BigReal
Definition: common.h:114
iterator begin(void)
Definition: ResizeArray.h:36
void Patch::gbisP2Ready ( )

Definition at line 570 of file Patch.C.

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

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

570  {
572 
573  int seq = flags.sequence;
574  for(cid = cid.begin(); cid != cid.end(); cid++) {
575  if ( (*cid)->type() == computeNonbondedSelfType ||
576  (*cid)->type() == computeNonbondedPairType ||
577  (*cid)->type() == computeNonbondedCUDAType
578 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
579  || (*cid)->type() == computeNonbondedCUDA2Type
580 #endif
581  ) {
582  (*cid)->gbisP2PatchReady(patchID,seq);
583  }
584  }
585 }
Flags flags
Definition: Patch.h:127
int sequence
Definition: PatchTypes.h:18
ComputePtrList positionComputeList
Definition: Patch.h:214
const PatchID patchID
Definition: Patch.h:143
void Patch::gbisP3Ready ( )

Definition at line 587 of file Patch.C.

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

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

587  {
588 
590 
591  int seq = flags.sequence;
592  for(cid = cid.begin(); cid != cid.end(); cid++) {
593  if ( (*cid)->type() == computeNonbondedSelfType ||
594  (*cid)->type() == computeNonbondedPairType ||
595  (*cid)->type() == computeNonbondedCUDAType
596 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
597  || (*cid)->type() == computeNonbondedCUDA2Type
598 #endif
599  ) {
600  (*cid)->gbisP3PatchReady(patchID,seq);
601  }
602  }
603 }
Flags flags
Definition: Patch.h:127
int sequence
Definition: PatchTypes.h:18
ComputePtrList positionComputeList
Definition: Patch.h:214
const PatchID patchID
Definition: Patch.h:143
CompAtomExt* Patch::getCompAtomExtInfo ( )
inline

Definition at line 117 of file Patch.h.

References ResizeArray< T >::begin(), and pExt.

Referenced by ComputePme::doQMWork(), ComputePatch::doWork(), ComputePatchPair::doWork(), ComputeLCPO::doWork(), ComputeNonbondedCUDA::noWork(), and positionsReady().

117 { return pExt.begin(); }
CompAtomExtList pExt
Definition: Patch.h:174
iterator begin(void)
Definition: ResizeArray.h:36
CudaAtom* Patch::getCudaAtomList ( )
inline

Definition at line 124 of file Patch.h.

References cudaAtomPtr.

Referenced by ComputeNonbondedCUDA::doWork().

124 { return cudaAtomPtr; }
CudaAtom * cudaAtomPtr
Definition: Patch.h:205
int Patch::getNumAtoms ( )
inline
int Patch::getNumComputes ( )
inline

Definition at line 115 of file Patch.h.

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

115 { return positionComputeList.size(); }
ComputePtrList positionComputeList
Definition: Patch.h:214
int size(void) const
Definition: ResizeArray.h:127
int Patch::getNumFixedAtoms ( )
inline

Definition at line 112 of file Patch.h.

References numFixedAtoms.

112 { return numFixedAtoms; } // not updated
int numFixedAtoms
Definition: Patch.h:145
PatchID Patch::getPatchID ( )
inline
int Patch::hasNewAtoms ( )
inline

Definition at line 40 of file Patch.h.

References _hasNewAtoms.

40 { return _hasNewAtoms; }
int _hasNewAtoms
Definition: Patch.h:245
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
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
void Patch::positionBoxClosed ( void  )

Definition at line 247 of file Patch.C.

References boxClosed().

248 {
249  //positionPtrBegin = 0;
250  this->boxClosed(0);
251 }
virtual void boxClosed(int)=0
void Patch::positionsReady ( int  n = 0)

Definition at line 403 of file Patch.C.

References _hasNewAtoms, atomMapper, avgPositionBox, avgPositionPtrBegin, ResizeArray< T >::begin(), bornRad, bornRadBox, boxesOpen, computesSortedByPriority, DebugM, dEdaSum, dEdaSumBox, dHdrPrefix, dHdrPrefixBox, Flags::doFullElectrostatics, Flags::doGBIS, Flags::doLCPO, Flags::doLoweAndersen, Flags::doMolly, ResizeArray< T >::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< T >::resize(), results, Flags::sequence, ResizeArray< T >::setall(), Node::simParameters, ResizeArray< T >::size(), sort, Lattice::unscale(), SimParameters::useAVXTiles, CompAtom::vdwType, velocityBox, velocityPtrBegin, Vector::x, Vector::y, and Vector::z.

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

404 {
405  DebugM(4,"Patch::positionsReady() - patchID(" << patchID <<")"<<std::endl );
406 
407  if ( doneMigration ){
408 // #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
409 // AtomMap::Object()->registerIDs(patchID,positionPtrBegin,positionPtrEnd);
410 // #else
412 // #endif
413 
414  #ifdef NAMD_AVXTILES
416  #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
417  const CompAtom * const pd = positionPtrBegin;
418  #else
419  const CompAtom * const pd = p.begin();
420  #endif
421  tiles.atomUpdate(pd, getCompAtomExtInfo());
422  }
423  #endif
424  }
425 
426 #ifdef NAMD_KNL
427  #if defined(NAMD_AVXTILES)
428  if (!Node::Object()->simParameters->useAVXTiles)
429  #endif
430  {
431  const Vector center = lattice.unscale( PatchMap::Object()->center(patchID) );
432  const int n = numAtoms;
433  pFlt.resize(n);
434  CompAtomFlt * const pf = pFlt.begin();
435 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
436  const CompAtom * const pd = positionPtrBegin;
437 #else
438  const CompAtom * const pd = p.begin();
439 #endif
440  for ( int i=0; i<n; ++i ) {
441  // need to subtract center in double precision, then assign to float
442  pf[i].position.x = pd[i].position.x - center.x;
443  pf[i].position.y = pd[i].position.y - center.y;
444  pf[i].position.z = pd[i].position.z - center.z;
445  pf[i].vdwType = pd[i].vdwType;
446  }
447  }
448 #endif
449  boxesOpen = 2;
450  if ( flags.doMolly ) boxesOpen++;
451  // BEGIN LA
452  if (flags.doLoweAndersen) {
453  DebugM(4, "Patch::positionsReady, flags.doMolly = " << flags.doMolly << "\n");
454  boxesOpen++;
455  }
456  // END LA
457  _hasNewAtoms = (doneMigration != 0);
458 
459 #if CMK_BLUEGENEL
460  CmiNetworkProgressAfter (0);
461 #endif
462 
463  // Give all position pickup boxes access to positions
464  //positionPtrBegin = p.begin();
465 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
466  positionBox.open(positionPtrBegin);
467 #else
468  positionBox.open(p.begin());
469 #endif
470  if ( flags.doMolly ) {
471  //avgPositionPtrBegin = p_avg.begin();
473  }
474 
475  // BEGIN LA
476  if (flags.doLoweAndersen) {
478  }
479  // END LA
480  // begin gbis
481  if (flags.doGBIS) {
482  boxesOpen += 5;
483  //intRad should already be taken care of
485  psiSum.resize(numAtoms);//resize array
486  psiSum.setall(0);
488  psiFin.resize(numAtoms);//has no box
489  psiFin.setall(0);
491  bornRad.setall(0);
493  dEdaSum.resize(numAtoms);//resize array
494  dEdaSum.setall(0);
497  dHdrPrefix.setall(0);
499  }
500  // end gbis
501 
502  //LCPO
503  if (flags.doLCPO) {
504  boxesOpen++;
506  }
507 
508 #if CMK_BLUEGENEL
509  CmiNetworkProgressAfter (0);
510 #endif
511 
512  // Give all force deposit boxes access to forces
513  Force *forcePtr;
514  for ( int j = 0; j < Results::maxNumForces; ++j )
515  {
516  f[j].resize(numAtoms);
517  forcePtr = f[j].begin();
518  memset (forcePtr, 0, sizeof (Force) * numAtoms);
519  results.f[j] = forcePtr;
520  }
522 
523  #ifdef NAMD_AVXTILES
524  // Zero data in arrays in "Tiles" data structures if they have been touched
525  if (Node::Object()->simParameters->useAVXTiles)
526  tiles.zeroForces(flags.doFullElectrostatics);
527  #endif
528 
529 
530  if ( ! computesSortedByPriority ) {
531  if (positionComputeList.size() == 0 && PatchMap::Object()->node(patchID) != CkMyPe()) {
532  iout << iINFO << "PATCH_COUNT: Patch " << patchID
533  << " on PE " << CkMyPe() <<" home patch "
535  << " does not have any computes\n"
536  << endi;
537  }
538 
542  int i;
543  for ( i=0; i<positionComputeList.size(); ++i ) {
544  if ( positionComputeList[i]->priority() > PME_PRIORITY ) break;
545  }
547  }
548 
549  int seq = flags.sequence;
550 
551  // Iterate over compute objects that need to be informed we are ready
553  for ( int i=0; i < firstHoldableCompute; ++i, ++cid ) {
554  (*cid)->patchReady(patchID,doneMigration,seq);
555  }
556  Compute **cend = positionComputeList.end();
557 
558  // gzheng
559  if (Sync::Object()->holdComputes(patchID, cid, cend, doneMigration, seq)) {
560  return;
561  }
562 
563  for( ; cid != cend; cid++ ) {
564  (*cid)->patchReady(patchID,doneMigration,seq);
565  }
566 }
static Node * Object()
Definition: Node.h:86
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:107
int firstHoldableCompute
Definition: Patch.h:211
RealList intRad
Definition: Patch.h:155
int computesSortedByPriority
Definition: Patch.h:210
OwnerBox< Patch, Results > forceBox
Definition: Patch.h:239
Lattice & lattice
Definition: Patch.h:126
static PatchMap * Object()
Definition: PatchMap.h:27
Definition: Vector.h:64
SimParameters * simParameters
Definition: Node.h:178
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:227
#define DebugM(x, y)
Definition: Debug.h:59
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:236
BigReal z
Definition: Vector.h:66
RealList dHdrPrefix
Definition: Patch.h:159
Position position
Definition: NamdTypes.h:53
GBRealList psiFin
Definition: Patch.h:157
void registerIDsCompAtomExt(const CompAtomExt *begin, const CompAtomExt *end)
Definition: AtomMap.C:24
#define iout
Definition: InfoStream.h:87
int doLoweAndersen
Definition: PatchTypes.h:26
AtomMapper * atomMapper
Definition: Patch.h:152
GBRealList dEdaSum
Definition: Patch.h:160
void open(Data *d)
Definition: OwnerBox.h:39
Flags flags
Definition: Patch.h:127
#define PME_PRIORITY
Definition: Priorities.h:29
int boxesOpen
Definition: Patch.h:243
OwnerBox< Patch, CompAtom > avgPositionBox
Definition: Patch.h:215
IntList lcpoType
Definition: Patch.h:164
GBRealList psiSum
Definition: Patch.h:156
int doFullElectrostatics
Definition: PatchTypes.h:23
iterator end(void)
Definition: ResizeArray.h:37
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:213
Force * f[maxNumForces]
Definition: PatchTypes.h:67
CompAtomList p
Definition: Patch.h:146
static Sync * Object()
Definition: Sync.h:50
int numAtoms
Definition: Patch.h:144
void setall(const Elem &elem)
Definition: ResizeArray.h:90
BigReal x
Definition: Vector.h:66
int sequence
Definition: PatchTypes.h:18
CompAtom * avgPositionPtrBegin
Definition: Patch.h:197
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:218
ComputePtrList positionComputeList
Definition: Patch.h:214
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:223
BlockRadixSort::TempStorage sort
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:231
short vdwType
Definition: NamdTypes.h:55
RealList bornRad
Definition: Patch.h:158
void resize(int i)
Definition: ResizeArray.h:84
int node(int pid) const
Definition: PatchMap.h:114
Position unscale(ScaledPosition s) const
Definition: Lattice.h:77
const PatchID patchID
Definition: Patch.h:143
int _hasNewAtoms
Definition: Patch.h:245
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:229
BigReal y
Definition: Vector.h:66
int doLCPO
Definition: PatchTypes.h:29
int doGBIS
Definition: PatchTypes.h:28
Results results
Definition: Patch.h:208
int size(void) const
Definition: ResizeArray.h:127
infostream & endi(infostream &s)
Definition: InfoStream.C:38
ForceList f[Results::maxNumForces]
Definition: Patch.h:207
CompAtomExtList pExt
Definition: Patch.h:174
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:225
int doMolly
Definition: PatchTypes.h:24
CompAtom * velocityPtrBegin
Definition: Patch.h:201
CompAtomExt * getCompAtomExtInfo()
Definition: Patch.h:117
iterator begin(void)
Definition: ResizeArray.h:36
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
Box< Patch, CompAtom > * Patch::registerAvgPositionPickup ( Compute cid)

Definition at line 134 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().

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

Definition at line 196 of file Patch.C.

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

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

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

Definition at line 204 of file Patch.C.

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

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

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

Definition at line 218 of file Patch.C.

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

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

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

Definition at line 228 of file Patch.C.

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

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

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

Definition at line 179 of file Patch.C.

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

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

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

Definition at line 188 of file Patch.C.

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

Referenced by ComputeLCPO::initialize().

188  {
189  return lcpoTypeBox.checkOut(cid->cid);
190 }
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:236
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:82
const ComputeID cid
Definition: Compute.h:43
Box< Patch, CompAtom > * Patch::registerPositionPickup ( Compute cid)

Definition at line 107 of file Patch.C.

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

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

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

Definition at line 164 of file Patch.C.

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

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

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

Definition at line 148 of file Patch.C.

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

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

149 {
150  //DebugM(4, "registerVelocityPickup("<<patchID<<") from " << cid->cid << "\n");
151  return velocityBox.checkOut(cid->cid);
152 }
Box< Owner, Data > * checkOut(int id)
Definition: OwnerBox.h:82
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:218
const ComputeID cid
Definition: Compute.h:43
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:145
void Patch::unregisterAvgPositionPickup ( Compute cid,
Box< Patch, CompAtom > **const  box 
)

Definition at line 140 of file Patch.C.

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

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

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

Definition at line 199 of file Patch.C.

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

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

199  {
200  bornRadBox.checkIn(*box);
201  *box = 0;
202 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
OwnerBox< Patch, Real > bornRadBox
Definition: Patch.h:227
void Patch::unregisterDEdaSumDeposit ( Compute cid,
Box< Patch, GBReal > **const  box 
)

Definition at line 212 of file Patch.C.

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

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

212  {
213  dEdaSumComputeList.del(cid);
214  dEdaSumBox.checkIn(*box);
215  *box = 0;
216 }
ComputePtrList dEdaSumComputeList
Definition: Patch.h:230
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
OwnerBox< Patch, GBReal > dEdaSumBox
Definition: Patch.h:229
void del(const Elem &elem)
Definition: SortedArray.h:59
void Patch::unregisterDHdrPrefixPickup ( Compute cid,
Box< Patch, Real > **const  box 
)

Definition at line 222 of file Patch.C.

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

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

222  {
223  dHdrPrefixBox.checkIn(*box);
224  *box = 0;
225 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
OwnerBox< Patch, Real > dHdrPrefixBox
Definition: Patch.h:231
void Patch::unregisterForceDeposit ( Compute cid,
Box< Patch, Results > **const  box 
)

Definition at line 239 of file Patch.C.

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

Referenced by ComputeHomePatch::~ComputeHomePatch(), ComputeLCPO::~ComputeLCPO(), ComputePatch::~ComputePatch(), ComputePatchPair::~ComputePatchPair(), and ComputePmeCUDA::~ComputePmeCUDA().

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

Definition at line 182 of file Patch.C.

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

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

182  {
183  intRadBox.checkIn(*box);
184  *box = 0;
185 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
OwnerBox< Patch, Real > intRadBox
Definition: Patch.h:223
void Patch::unregisterLcpoTypePickup ( Compute cid,
Box< Patch, int > **const  box 
)

Definition at line 191 of file Patch.C.

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

Referenced by ComputeLCPO::~ComputeLCPO().

191  {
192  lcpoTypeBox.checkIn(*box);
193  *box = 0;
194 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
OwnerBox< Patch, int > lcpoTypeBox
Definition: Patch.h:236
void Patch::unregisterPositionPickup ( Compute cid,
Box< Patch, CompAtom > **const  box 
)

Definition at line 122 of file Patch.C.

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

Referenced by ComputeHomePatch::~ComputeHomePatch(), ComputeLCPO::~ComputeLCPO(), ComputePatch::~ComputePatch(), ComputePatchPair::~ComputePatchPair(), and ComputePmeCUDA::~ComputePmeCUDA().

123 {
124  if ( computesSortedByPriority ) {
127  }
128  DebugM(4, "UnregisterPositionPickup from " << cid->cid << "\n");
130  positionBox.checkIn(*box);
131  *box = 0;
132 }
int computesSortedByPriority
Definition: Patch.h:210
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
#define DebugM(x, y)
Definition: Debug.h:59
void sort(void)
Definition: SortedArray.h:66
OwnerBox< Patch, CompAtom > positionBox
Definition: Patch.h:213
ComputePtrList positionComputeList
Definition: Patch.h:214
void del(const Elem &elem)
Definition: SortedArray.h:59
const ComputeID cid
Definition: Compute.h:43
void Patch::unregisterPsiSumDeposit ( Compute cid,
Box< Patch, GBReal > **const  box 
)

Definition at line 174 of file Patch.C.

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

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

174  {
175  psiSumComputeList.del(cid);
176  psiSumBox.checkIn(*box);
177  *box = 0;
178 }
ComputePtrList psiSumComputeList
Definition: Patch.h:226
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
void del(const Elem &elem)
Definition: SortedArray.h:59
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:225
void Patch::unregisterVelocityPickup ( Compute cid,
Box< Patch, CompAtom > **const  box 
)

Definition at line 154 of file Patch.C.

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

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

155 {
156  DebugM(4, "UnregisterVelocityPickup from " << cid->cid << "\n");
157  velocityBox.checkIn(*box);
158  *box = 0;
159 }
void checkIn(Box< Owner, Data > *box)
Definition: OwnerBox.h:101
#define DebugM(x, y)
Definition: Debug.h:59
OwnerBox< Patch, CompAtom > velocityBox
Definition: Patch.h:218
const ComputeID cid
Definition: Compute.h:43
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:59
const PatchID patchID
Definition: Patch.h:143
virtual void boxClosed(int)=0
CompAtom * velocityPtrBegin
Definition: Patch.h:201

Member Data Documentation

int Patch::_hasNewAtoms
protected

Definition at line 245 of file Patch.h.

Referenced by hasNewAtoms(), and positionsReady().

AtomMapper* Patch::atomMapper
protected
OwnerBox<Patch,CompAtom> Patch::avgPositionBox
protected

Definition at line 215 of file Patch.h.

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

ComputePtrList Patch::avgPositionComputeList
protected

Definition at line 216 of file Patch.h.

CompAtom* Patch::avgPositionPtrBegin
protected
CompAtom* Patch::avgPositionPtrEnd
protected
RealList Patch::bornRad
protected
OwnerBox<Patch,Real> Patch::bornRadBox
protected

Definition at line 227 of file Patch.h.

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

ComputePtrList Patch::bornRadComputeList
protected

Definition at line 228 of file Patch.h.

int Patch::boxesOpen
protected
int* Patch::child
protected
int Patch::computesSortedByPriority
protected

Definition at line 210 of file Patch.h.

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

CudaAtom* Patch::cudaAtomPtr
protected
GBRealList Patch::dEdaSum
protected

Definition at line 160 of file Patch.h.

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

OwnerBox<Patch,GBReal> Patch::dEdaSumBox
protected
ComputePtrList Patch::dEdaSumComputeList
protected

Definition at line 230 of file Patch.h.

Referenced by registerDEdaSumDeposit(), and unregisterDEdaSumDeposit().

RealList Patch::dHdrPrefix
protected
OwnerBox<Patch,Real> Patch::dHdrPrefixBox
protected

Definition at line 231 of file Patch.h.

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

ComputePtrList Patch::dHdrPrefixComputeList
protected

Definition at line 232 of file Patch.h.

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

Definition at line 211 of file Patch.h.

Referenced by positionsReady().

Flags Patch::flags

Definition at line 127 of file Patch.h.

Referenced by Sequencer::addForceToMomentum(), Sequencer::addForceToMomentum3(), Sequencer::addVelocityToPosition(), ProxyPatch::boxClosed(), HomePatch::boxClosed(), AngleElem::computeForce(), ImproperElem::computeForce(), DihedralElem::computeForce(), CrosstermElem::computeForce(), AnisoElem::computeForce(), TholeElem::computeForce(), BondElem::computeForce(), ExclElem::computeForce(), ComputeGridForce::do_calc(), ComputeEField::doForce(), ComputeStir::doForce(), ComputeGridForce::doForce(), ComputeNonbondedPair::doForce(), ComputeNonbondedSelf::doForce(), ComputeRestraints::doForce(), ComputeLCPO::doForce(), HomePatch::doGroupSizeCheck(), HomePatch::doPairlistCheck(), ComputePatch::doWork(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), forceBoxClosed(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), gbisP2Ready(), HomePatch::gbisP2Ready(), gbisP3Ready(), HomePatch::gbisP3Ready(), Sequencer::integrate(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Sequencer::maximumMove(), Sequencer::minimize(), Sequencer::multigratorPressure(), Sequencer::newtonianVelocities(), ComputeNonbondedSelf::noWork(), ComputePme::noWork(), positionsReady(), HomePatch::positionsReady(), Sequencer::rattle1(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), HomePatch::receiveResult(), Sequencer::runComputeObjects(), Sequencer::submitCollections(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitReductions(), and ComputePme::ungridForces().

OwnerBox<Patch,Results> Patch::forceBox
protected
ComputePtrList Patch::forceComputeList
protected

Definition at line 240 of file Patch.h.

Referenced by registerForceDeposit(), and unregisterForceDeposit().

RealList Patch::intRad
protected
OwnerBox<Patch,Real> Patch::intRadBox
protected

Definition at line 223 of file Patch.h.

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

ComputePtrList Patch::intRadComputeList
protected

Definition at line 224 of file Patch.h.

Lattice& Patch::lattice
IntList Patch::lcpoType
protected
OwnerBox<Patch,int> Patch::lcpoTypeBox
protected

Definition at line 236 of file Patch.h.

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

ComputePtrList Patch::lcpoTypeComputeList
protected

Definition at line 237 of file Patch.h.

int Patch::nChild
protected
int Patch::numAtoms
protected

Definition at line 144 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(), Sequencer::calcFixVirial(), Sequencer::calcKineticEnergy(), Sequencer::correctMomentum(), HomePatch::doPairlistCheck(), HomePatch::exchangeAtoms(), forceBoxClosed(), HomePatch::gbisComputeAfterP1(), HomePatch::gbisComputeAfterP2(), HomePatch::gbisP2Ready(), 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(), ProxyPatch::ProxyPatch(), HomePatch::qmSwapAtoms(), Sequencer::quenchVelocities(), Sequencer::rattle1(), HomePatch::rattle1(), HomePatch::rattle1old(), HomePatch::rattle2(), Sequencer::reassignVelocities(), ProxyPatch::receiveAll(), ProxyPatch::receiveData(), HomePatch::recvCheckpointLoad(), Sequencer::reinitVelocities(), Sequencer::reloadCharges(), Sequencer::rescaleaccelMD(), Sequencer::rescaleSoluteCharges(), Sequencer::rescaleVelocities(), Sequencer::rescaleVelocitiesByFactor(), HomePatch::saveForce(), ComputeGlobal::saveTotalForces(), Sequencer::scalePositionsVelocities(), Sequencer::scaleVelocities(), HomePatch::setGBISIntrinsicRadii(), HomePatch::setLcpoType(), Sequencer::stochRescaleVelocities(), Sequencer::submitHalfstep(), Sequencer::submitMinimizeReductions(), Sequencer::submitMomentum(), Sequencer::submitReductions(), and Sequencer::tcoupleVelocities().

int Patch::numFixedAtoms
protected

Definition at line 145 of file Patch.h.

Referenced by getNumFixedAtoms(), and setNumFixedAtoms().

CompAtomList Patch::p
protected
CompAtomList Patch::p_avg
protected
const PatchID Patch::patchID
protected
CompAtomExtList Patch::pExt
protected
OwnerBox<Patch,CompAtom> Patch::positionBox
protected

Definition at line 213 of file Patch.h.

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

ComputePtrList Patch::positionComputeList
protected
GBRealList Patch::psiFin
protected
GBRealList Patch::psiSum
protected

Definition at line 156 of file Patch.h.

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

OwnerBox<Patch,GBReal> Patch::psiSumBox
protected
ComputePtrList Patch::psiSumComputeList
protected

Definition at line 226 of file Patch.h.

Referenced by registerPsiSumDeposit(), and unregisterPsiSumDeposit().

Results Patch::results
protected

Definition at line 208 of file Patch.h.

Referenced by forceBoxClosed(), and positionsReady().

CompAtomList Patch::v
protected

Definition at line 149 of file Patch.h.

Referenced by HomePatch::positionsReady().

OwnerBox<Patch,CompAtom> Patch::velocityBox
protected

Definition at line 218 of file Patch.h.

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

ComputePtrList Patch::velocityComputeList
protected

Definition at line 219 of file Patch.h.

CompAtom* Patch::velocityPtrBegin
protected
CompAtom* Patch::velocityPtrEnd
protected

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