35 #define MIN_DEBUG_LEVEL 4
40 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
46 lattice(flags.lattice),
47 patchID(pd), numAtoms(0), numFixedAtoms(0),
48 avgPositionPtrBegin(0), avgPositionPtrEnd(0),
49 velocityPtrBegin(0), velocityPtrEnd(0),
50 positionBox(this,&
Patch::positionBoxClosed,pd,0),
51 avgPositionBox(this,&
Patch::avgPositionBoxClosed,pd,3),
52 velocityBox(this,&
Patch::velocityBoxClosed,pd,4),
53 psiSumBox(this,&
Patch::psiSumBoxClosed,pd,5),
54 intRadBox(this,&
Patch::intRadBoxClosed,pd,6),
55 bornRadBox(this,&
Patch::bornRadBoxClosed,pd,7),
56 dEdaSumBox(this,&
Patch::dEdaSumBoxClosed,pd,8),
57 dHdrPrefixBox(this,&
Patch::dHdrPrefixBoxClosed,pd,9),
58 lcpoTypeBox(this,&
Patch::lcpoTypeBoxClosed,pd,10),
59 forceBox(this,&
Patch::forceBoxClosed,pd,1),
60 boxesOpen(0), _hasNewAtoms(0),
61 computesSortedByPriority(0), firstHoldableCompute(0)
69 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
76 #ifdef NODEAWARE_PROXY_SPANNINGTREE
77 #ifdef USE_NODEPATCHMGR
85 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
92 #if MIC_SUBMIT_ATOMS_ON_ARRIVAL != 0
93 pthread_mutex_init(&mic_atomData_mutex, 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;
116 DebugM(7,
"registerPositionPickup() failed for cid " << cid->
cid << std::endl);
128 DebugM(4,
"UnregisterPositionPickup from " << cid->
cid <<
"\n");
142 DebugM(4,
"UnregisterAvgPositionPickup from " << cid->
cid <<
"\n");
156 DebugM(4,
"UnregisterVelocityPickup from " << cid->
cid <<
"\n");
167 DebugM(7,
"registerPsiSumDeposit() failed for cid " << cid->
cid << std::endl);
206 DebugM(7,
"registerDEdaSumDeposit() failed for cid " << cid->
cid << std::endl);
232 DebugM(7,
"registerForceDeposit() failed for cid " << cid->
cid << std::endl);
241 DebugM(4,
"unregisterForceDeposit() computeID("<<cid<<
")"<<std::endl);
256 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
259 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
260 const CompAtom *
const __restrict pd = positionPtrBegin;
272 double virialHold[6], virialSlowHold[6];
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];
319 #pragma omp simd reduction(+:virial_xx,virial_xy,virial_xz,virial_yy,virial_yz,virial_zz)
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;
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;
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;
368 DebugM(4,
"patchID("<<
patchID<<
") velocityBoxClosed! call\n");
405 DebugM(4,
"Patch::positionsReady() - patchID(" <<
patchID <<
")"<<std::endl );
407 if ( doneMigration ){
416 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
417 const CompAtom *
const pd = positionPtrBegin;
427 #if defined(NAMD_AVXTILES)
434 CompAtomFlt *
const pf = pFlt.begin();
435 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
436 const CompAtom *
const pd = positionPtrBegin;
440 for (
int i=0; i<n; ++i ) {
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;
460 CmiNetworkProgressAfter (0);
465 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
509 CmiNetworkProgressAfter (0);
533 <<
" on PE " << CkMyPe() <<
" home patch "
535 <<
" does not have any computes\n"
554 (*cid)->patchReady(
patchID,doneMigration,seq);
563 for( ; cid != cend; cid++ ) {
564 (*cid)->patchReady(
patchID,doneMigration,seq);
574 for(cid = cid.
begin(); cid != cid.
end(); cid++) {
578 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
582 (*cid)->gbisP2PatchReady(
patchID,seq);
592 for(cid = cid.
begin(); cid != cid.
end(); cid++) {
596 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
600 (*cid)->gbisP3PatchReady(
patchID,seq);
ComputePtrList forceComputeList
register BigReal virial_xy
Box< Patch, GBReal > * registerDEdaSumDeposit(Compute *cid)
register BigReal virial_xz
std::ostream & iINFO(std::ostream &s)
Box< Patch, CompAtom > * registerAvgPositionPickup(Compute *cid)
register BigReal virial_yz
int computesSortedByPriority
void unregisterAvgPositionPickup(Compute *cid, Box< Patch, CompAtom > **const box)
ComputePtrList dEdaSumComputeList
OwnerBox< Patch, Results > forceBox
ComputePtrList psiSumComputeList
void unregisterPsiSumDeposit(Compute *cid, Box< Patch, GBReal > **const box)
void dHdrPrefixBoxClosed(void)
void checkIn(Box< Owner, Data > *box)
static PatchMap * Object()
int add(const Elem &elem)
#define NAMD_SeparateWaters
SimParameters * simParameters
OwnerBox< Patch, Real > bornRadBox
void unregisterForceDeposit(Compute *cid, Box< Patch, Results > **const box)
OwnerBox< Patch, int > lcpoTypeBox
std::ostream & endi(std::ostream &s)
void unregisterDHdrPrefixPickup(Compute *cid, Box< Patch, Real > **const box)
void positionsReady(int n=0)
SubmitReduction * willSubmit(int setID, int size=-1)
Box< Patch, Real > * registerBornRadPickup(Compute *cid)
if(ComputeNonbondedUtil::goMethod==2)
void dEdaSumBoxClosed(void)
void registerIDsCompAtomExt(const CompAtomExt *begin, const CompAtomExt *end)
static ReductionMgr * Object(void)
Box< Patch, int > * registerLcpoTypePickup(Compute *cid)
ResizeArrayPrimIter< Compute * > ComputePtrListIter
void forceBoxClosed(void)
register BigReal virial_yy
Box< Patch, GBReal > * registerPsiSumDeposit(Compute *cid)
OwnerBox< Patch, CompAtom > avgPositionBox
Box< Patch, Real > * registerIntRadPickup(Compute *cid)
OwnerBox< Patch, CompAtom > positionBox
void setall(const Elem &elem)
register BigReal virial_zz
bool operator()(Compute *i, Compute *j) const
ResizeArrayPrimIter< T > begin(void) const
void lcpoTypeBoxClosed(void)
Box< Owner, Data > * checkOut(int id)
CompAtom * avgPositionPtrBegin
OwnerBox< Patch, CompAtom > velocityBox
void unregisterBornRadPickup(Compute *cid, Box< Patch, Real > **const box)
ComputePtrList positionComputeList
OwnerBox< Patch, Real > intRadBox
void unregisterPositionPickup(Compute *cid, Box< Patch, CompAtom > **const box)
BlockRadixSort::TempStorage sort
OwnerBox< Patch, Real > dHdrPrefixBox
Position unscale(ScaledPosition s) const
OwnerBox< Patch, GBReal > dEdaSumBox
void unregisterIntRadPickup(Compute *cid, Box< Patch, Real > **const box)
Box< Patch, Real > * registerDHdrPrefixPickup(Compute *cid)
register BigReal virial_xx
void del(const Elem &elem)
void bornRadBoxClosed(void)
void positionBoxClosed(void)
ResizeArrayPrimIter< T > end(void) const
void unregisterVelocityPickup(Compute *cid, Box< Patch, CompAtom > **const box)
void avgPositionBoxClosed(void)
ForceList f[Results::maxNumForces]
void velocityBoxClosed(void)
void unregisterDEdaSumDeposit(Compute *cid, Box< Patch, GBReal > **const box)
OwnerBox< Patch, GBReal > psiSumBox
void intRadBoxClosed(void)
void psiSumBoxClosed(void)
Box< Patch, CompAtom > * registerVelocityPickup(Compute *cid)
void unregisterLcpoTypePickup(Compute *cid, Box< Patch, int > **const box)
virtual void boxClosed(int)=0
Box< Patch, CompAtom > * registerPositionPickup(Compute *cid)
CompAtom * velocityPtrBegin
CompAtomExt * getCompAtomExtInfo()
Box< Patch, Results > * registerForceDeposit(Compute *cid)