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 #ifndef NAMD_CUDA
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:391
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:387
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:398
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:383
void positionBoxClosed(void)
Definition: Patch.C:247
void avgPositionBoxClosed(void)
Definition: Patch.C:358
void velocityBoxClosed(void)
Definition: Patch.C:365
int nChild
Definition: Patch.h:263
OwnerBox< Patch, GBReal > psiSumBox
Definition: Patch.h:225
void intRadBoxClosed(void)
Definition: Patch.C:379
void psiSumBoxClosed(void)
Definition: Patch.C:376
CompAtom * velocityPtrBegin
Definition: Patch.h:201
Patch::~Patch ( )
virtual

Definition at line 38 of file Patch.C.

References atomMapper.

38  {
39  delete atomMapper;
40 #ifndef NAMD_CUDA
41  delete reduction;
42 #endif
43 }
AtomMapper * atomMapper
Definition: Patch.h:152

Member Function Documentation

void Patch::avgPositionBoxClosed ( void  )

Definition at line 358 of file Patch.C.

References avgPositionPtrBegin, and boxClosed().

359 {
361  this->boxClosed(3);
362 }
CompAtom * avgPositionPtrBegin
Definition: Patch.h:197
virtual void boxClosed(int)=0
void Patch::bornRadBoxClosed ( void  )

Definition at line 383 of file Patch.C.

References boxClosed().

383  {
384  //bornRadPtr = 0;
385  this->boxClosed(7);
386 }
virtual void boxClosed(int)=0
virtual void Patch::boxClosed ( int  )
protectedpure virtual
void Patch::dEdaSumBoxClosed ( void  )

Definition at line 387 of file Patch.C.

References boxClosed().

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

Definition at line 391 of file Patch.C.

References boxClosed().

391  {
392  //dHdrPrefixPtr = 0;
393  this->boxClosed(9);
394 }
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 
257 #ifndef NAMD_CUDA
258  // calculate direct nonbonded virial from segregated forces and aggregate forces
259  const Vector center = lattice.unscale( PatchMap::Object()->center(patchID) );
260 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
261  const CompAtom * const __restrict pd = positionPtrBegin;
262 #else
263  const CompAtom * const __restrict pd = p.begin();
264 #endif
265  const int n = numAtoms;
266  int roff = 0;
267 
268 #ifdef NAMD_AVXTILES
269  // If "Tiles" algorithm is active, perform same reduction and virial calc
270  // in BigReal precision, but add in forces stored in tiles data structures
271  // if they were touched on this patch.
272  if (Node::Object()->simParameters->useAVXTiles) {
273  double virialHold[6], virialSlowHold[6];
274  tiles.nativeForceVirialUpdate(flags.doFullElectrostatics, flags.doVirial,
275  pd, center, results.f[Results::nbond],
277  results.f[Results::nbond_virial],
278  results.f[Results::slow_virial],
279  virialHold, virialSlowHold);
280  f[Results::nbond_virial].resize(0);
281  f[Results::slow_virial].resize(0);
282  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XX) += virialHold[0];
283  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XY) += virialHold[1];
284  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XZ) += virialHold[2];
285  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YX) += virialHold[1];
286  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YY) += virialHold[3];
287  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YZ) += virialHold[4];
288  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZX) += virialHold[2];
289  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZY) += virialHold[4];
290  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  reduction->submit();
302  for (int j = 0; j < Results::maxNumForces; ++j ) results.f[j] = 0;
303  this->boxClosed(1);
304  return;
305  }
306 #endif
307 
308  for ( int j1 = Results::nbond; j1 <= Results::slow; ++j1, roff += REDUCTION_VIRIAL_SLOW_XX - REDUCTION_VIRIAL_NBOND_XX ) {
309  int j2 = j1 + ( Results::nbond_virial - Results::nbond );
310  Force * __restrict f1 = results.f[j1];
311  Force * __restrict f2 = results.f[j2];
312  BigReal virial_xx = 0.;
313  BigReal virial_xy = 0.;
314  BigReal virial_xz = 0.;
315  BigReal virial_yy = 0.;
316  BigReal virial_yz = 0.;
317  BigReal virial_zz = 0.;
318 #pragma omp simd reduction(+:virial_xx,virial_xy,virial_xz,virial_yy,virial_yz,virial_zz)
319 #pragma ivdep
320  for ( int i=0; i<n; ++i ) {
321  BigReal p_x = pd[i].position.x - center.x;
322  BigReal p_y = pd[i].position.y - center.y;
323  BigReal p_z = pd[i].position.z - center.z;
324  BigReal f_x = f2[i].x;
325  BigReal f_y = f2[i].y;
326  BigReal f_z = f2[i].z;
327  virial_xx += f_x * p_x;
328  virial_xy += f_x * p_y;
329  virial_xz += f_x * p_z;
330  virial_yy += f_y * p_y;
331  virial_yz += f_y * p_z;
332  virial_zz += f_z * p_z;
333  f1[i].x += f_x;
334  f1[i].y += f_y;
335  f1[i].z += f_z;
336  }
337  f[j2].resize(0);
338  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XX) += virial_xx;
339  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XY) += virial_xy;
340  reduction->item(roff + REDUCTION_VIRIAL_NBOND_XZ) += virial_xz;
341  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YX) += virial_xy;
342  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YY) += virial_yy;
343  reduction->item(roff + REDUCTION_VIRIAL_NBOND_YZ) += virial_yz;
344  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZX) += virial_xz;
345  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZY) += virial_yz;
346  reduction->item(roff + REDUCTION_VIRIAL_NBOND_ZZ) += virial_zz;
347  }
348  reduction->submit();
349 #endif
350 
351  for (int j = 0; j < Results::maxNumForces; ++j )
352  {
353  results.f[j] = 0;
354  }
355  this->boxClosed(1);
356 }
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:112
iterator begin(void)
Definition: ResizeArray.h:36
void Patch::gbisP2Ready ( )

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

569  {
571 
572  int seq = flags.sequence;
573  for(cid = cid.begin(); cid != cid.end(); cid++) {
574  if ( (*cid)->type() == computeNonbondedSelfType ||
575  (*cid)->type() == computeNonbondedPairType ||
576  (*cid)->type() == computeNonbondedCUDAType
577 #ifdef NAMD_CUDA
578  || (*cid)->type() == computeNonbondedCUDA2Type
579 #endif
580  ) {
581  (*cid)->gbisP2PatchReady(patchID,seq);
582  }
583  }
584 }
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 586 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().

586  {
587 
589 
590  int seq = flags.sequence;
591  for(cid = cid.begin(); cid != cid.end(); cid++) {
592  if ( (*cid)->type() == computeNonbondedSelfType ||
593  (*cid)->type() == computeNonbondedPairType ||
594  (*cid)->type() == computeNonbondedCUDAType
595 #ifdef NAMD_CUDA
596  || (*cid)->type() == computeNonbondedCUDA2Type
597 #endif
598  ) {
599  (*cid)->gbisP3PatchReady(patchID,seq);
600  }
601  }
602 }
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 379 of file Patch.C.

References boxClosed().

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

Definition at line 398 of file Patch.C.

References boxClosed().

398  {
399  this->boxClosed(10);
400 }
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 402 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().

403 {
404  DebugM(4,"Patch::positionsReady() - patchID(" << patchID <<")"<<std::endl );
405 
406  if ( doneMigration ){
407 // #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
408 // AtomMap::Object()->registerIDs(patchID,positionPtrBegin,positionPtrEnd);
409 // #else
411 // #endif
412 
413  #ifdef NAMD_AVXTILES
415  #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
416  const CompAtom * const pd = positionPtrBegin;
417  #else
418  const CompAtom * const pd = p.begin();
419  #endif
420  tiles.atomUpdate(pd, getCompAtomExtInfo());
421  }
422  #endif
423  }
424 
425 #ifdef NAMD_KNL
426  #if defined(NAMD_AVXTILES)
427  if (!Node::Object()->simParameters->useAVXTiles)
428  #endif
429  {
430  const Vector center = lattice.unscale( PatchMap::Object()->center(patchID) );
431  const int n = numAtoms;
432  pFlt.resize(n);
433  CompAtomFlt * const pf = pFlt.begin();
434 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
435  const CompAtom * const pd = positionPtrBegin;
436 #else
437  const CompAtom * const pd = p.begin();
438 #endif
439  for ( int i=0; i<n; ++i ) {
440  // need to subtract center in double precision, then assign to float
441  pf[i].position.x = pd[i].position.x - center.x;
442  pf[i].position.y = pd[i].position.y - center.y;
443  pf[i].position.z = pd[i].position.z - center.z;
444  pf[i].vdwType = pd[i].vdwType;
445  }
446  }
447 #endif
448  boxesOpen = 2;
449  if ( flags.doMolly ) boxesOpen++;
450  // BEGIN LA
451  if (flags.doLoweAndersen) {
452  DebugM(4, "Patch::positionsReady, flags.doMolly = " << flags.doMolly << "\n");
453  boxesOpen++;
454  }
455  // END LA
456  _hasNewAtoms = (doneMigration != 0);
457 
458 #if CMK_BLUEGENEL
459  CmiNetworkProgressAfter (0);
460 #endif
461 
462  // Give all position pickup boxes access to positions
463  //positionPtrBegin = p.begin();
464 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
465  positionBox.open(positionPtrBegin);
466 #else
467  positionBox.open(p.begin());
468 #endif
469  if ( flags.doMolly ) {
470  //avgPositionPtrBegin = p_avg.begin();
472  }
473 
474  // BEGIN LA
475  if (flags.doLoweAndersen) {
477  }
478  // END LA
479  // begin gbis
480  if (flags.doGBIS) {
481  boxesOpen += 5;
482  //intRad should already be taken care of
484  psiSum.resize(numAtoms);//resize array
485  psiSum.setall(0);
487  psiFin.resize(numAtoms);//has no box
488  psiFin.setall(0);
490  bornRad.setall(0);
492  dEdaSum.resize(numAtoms);//resize array
493  dEdaSum.setall(0);
496  dHdrPrefix.setall(0);
498  }
499  // end gbis
500 
501  //LCPO
502  if (flags.doLCPO) {
503  boxesOpen++;
505  }
506 
507 #if CMK_BLUEGENEL
508  CmiNetworkProgressAfter (0);
509 #endif
510 
511  // Give all force deposit boxes access to forces
512  Force *forcePtr;
513  for ( int j = 0; j < Results::maxNumForces; ++j )
514  {
515  f[j].resize(numAtoms);
516  forcePtr = f[j].begin();
517  memset (forcePtr, 0, sizeof (Force) * numAtoms);
518  results.f[j] = forcePtr;
519  }
521 
522  #ifdef NAMD_AVXTILES
523  // Zero data in arrays in "Tiles" data structures if they have been touched
524  if (Node::Object()->simParameters->useAVXTiles)
525  tiles.zeroForces(flags.doFullElectrostatics);
526  #endif
527 
528 
529  if ( ! computesSortedByPriority ) {
530  if (positionComputeList.size() == 0 && PatchMap::Object()->node(patchID) != CkMyPe()) {
531  iout << iINFO << "PATCH_COUNT: Patch " << patchID
532  << " on PE " << CkMyPe() <<" home patch "
534  << " does not have any computes\n"
535  << endi;
536  }
537 
541  int i;
542  for ( i=0; i<positionComputeList.size(); ++i ) {
543  if ( positionComputeList[i]->priority() > PME_PRIORITY ) break;
544  }
546  }
547 
548  int seq = flags.sequence;
549 
550  // Iterate over compute objects that need to be informed we are ready
552  for ( int i=0; i < firstHoldableCompute; ++i, ++cid ) {
553  (*cid)->patchReady(patchID,doneMigration,seq);
554  }
555  Compute **cend = positionComputeList.end();
556 
557  // gzheng
558  if (Sync::Object()->holdComputes(patchID, cid, cend, doneMigration, seq)) {
559  return;
560  }
561 
562  for( ; cid != cend; cid++ ) {
563  (*cid)->patchReady(patchID,doneMigration,seq);
564  }
565 }
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 376 of file Patch.C.

References boxClosed().

376  {
377  this->boxClosed(5);
378 }
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 365 of file Patch.C.

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

366 {
367  DebugM(4, "patchID("<<patchID<<") velocityBoxClosed! call\n");
368  velocityPtrBegin = 0;
369  this->boxClosed(4); // ?? Don't know about number
370 }
#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: