34 #define MIN_DEBUG_LEVEL 4 39 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP)) 45 lattice(flags.lattice),
46 patchID(pd), numAtoms(0), numFixedAtoms(0),
47 avgPositionPtrBegin(0), avgPositionPtrEnd(0),
48 velocityPtrBegin(0), velocityPtrEnd(0),
49 positionBox(this,&
Patch::positionBoxClosed,pd,0),
50 avgPositionBox(this,&
Patch::avgPositionBoxClosed,pd,3),
51 velocityBox(this,&
Patch::velocityBoxClosed,pd,4),
52 psiSumBox(this,&
Patch::psiSumBoxClosed,pd,5),
53 intRadBox(this,&
Patch::intRadBoxClosed,pd,6),
54 bornRadBox(this,&
Patch::bornRadBoxClosed,pd,7),
55 dEdaSumBox(this,&
Patch::dEdaSumBoxClosed,pd,8),
56 dHdrPrefixBox(this,&
Patch::dHdrPrefixBoxClosed,pd,9),
57 lcpoTypeBox(this,&
Patch::lcpoTypeBoxClosed,pd,10),
58 forceBox(this,&
Patch::forceBoxClosed,pd,1),
59 boxesOpen(0), _hasNewAtoms(0),
60 computesSortedByPriority(0), firstHoldableCompute(0)
68 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY 75 #ifdef NODEAWARE_PROXY_SPANNINGTREE 76 #ifdef USE_NODEPATCHMGR 84 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP)) 91 #if MIC_SUBMIT_ATOMS_ON_ARRIVAL != 0 92 pthread_mutex_init(&mic_atomData_mutex, NULL);
94 mic_atomData_seq = -1;
95 mic_atomData_allocSize_host = 0;
96 for (
int i = 0; i < MIC_MAX_DEVICES_PER_NODE; i++) {
97 mic_atomData_prev[i] = NULL;
98 mic_atomData_deviceSeq[i] = -1;
99 mic_atomData_devicePtr[i] = 0;
100 mic_atomData_allocSize_device[i] = 0;
115 DebugM(7,
"registerPositionPickup() failed for cid " << cid->
cid << std::endl);
127 DebugM(4,
"UnregisterPositionPickup from " << cid->
cid <<
"\n");
141 DebugM(4,
"UnregisterAvgPositionPickup from " << cid->
cid <<
"\n");
155 DebugM(4,
"UnregisterVelocityPickup from " << cid->
cid <<
"\n");
166 DebugM(7,
"registerPsiSumDeposit() failed for cid " << cid->
cid << std::endl);
205 DebugM(7,
"registerDEdaSumDeposit() failed for cid " << cid->
cid << std::endl);
231 DebugM(7,
"registerForceDeposit() failed for cid " << cid->
cid << std::endl);
240 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;
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 );
410 const bool updateAtomMap = (startup ||
413 if (doneMigration && updateAtomMap) {
422 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY 423 const CompAtom *
const pd = positionPtrBegin;
433 #if defined(NAMD_AVXTILES) 440 CompAtomFlt *
const pf = pFlt.begin();
441 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY 442 const CompAtom *
const pd = positionPtrBegin;
446 for (
int i=0; i<n; ++i ) {
449 pf[i].position.y = pd[i].
position.
y - center.
y;
450 pf[i].position.z = pd[i].
position.
z - center.
z;
466 CmiNetworkProgressAfter (0);
471 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY 515 CmiNetworkProgressAfter (0);
520 #ifdef NODEGROUP_FORCE_REGISTER 523 const bool clearForces = (!
simParams->CUDASOAintegrate ||
524 (doneMigration && !
simParams->useDeviceMigration) );
529 if(clearForces) memset (forcePtr, 0,
sizeof (
Force) *
numAtoms);
540 #ifdef DEBUG_MINIMIZE 543 printf(
"%s, line %d\n", __FILE__, __LINE__);
544 printf(
" initial: pf[%d] = %f %f %f\n", k, pf[k].x, pf[k].y, pf[k].z);
560 <<
" on PE " << CkMyPe() <<
" home patch " 562 <<
" does not have any computes\n" 582 (*cid)->patchReady(
patchID,doneMigration,seq);
590 for( ; cid != cend; cid++ ) {
591 (*cid)->patchReady(
patchID,doneMigration,seq);
602 for(cid = cid.
begin(); cid != cid.
end(); cid++) {
605 #if defined(NAMD_CUDA) || defined(NAMD_HIP) 609 (*cid)->gbisP2PatchReady(
patchID,seq);
619 for(cid = cid.
begin(); cid != cid.
end(); cid++) {
622 #if defined(NAMD_CUDA) || defined(NAMD_HIP) 626 (*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)
bool operator()(Compute *i, Compute *j) const
void checkIn(Box< Owner, Data > *box)
static PatchMap * Object()
#define NAMD_SeparateWaters
DMK - Atom Separation (water vs. non-water)
SimParameters * simParameters
OwnerBox< Patch, Real > bornRadBox
NAMD_HOST_DEVICE Position unscale(ScaledPosition s) const
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)
SubmitReduction * willSubmit(int setID, int size=-1)
Box< Patch, Real > * registerBornRadPickup(Compute *cid)
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)
void setall(const Elem &elem)
register BigReal virial_yy
Box< Patch, GBReal > * registerPsiSumDeposit(Compute *cid)
int add(const Elem &elem)
OwnerBox< Patch, CompAtom > avgPositionBox
ResizeArrayPrimIter< T > end(void) const
Box< Patch, Real > * registerIntRadPickup(Compute *cid)
OwnerBox< Patch, CompAtom > positionBox
register BigReal virial_zz
void lcpoTypeBoxClosed(void)
void del(const Elem &elem)
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)
ResizeArrayPrimIter< T > begin(void) const
OwnerBox< Patch, Real > dHdrPrefixBox
OwnerBox< Patch, GBReal > dEdaSumBox
void unregisterIntRadPickup(Compute *cid, Box< Patch, Real > **const box)
Box< Patch, Real > * registerDHdrPrefixPickup(Compute *cid)
register BigReal virial_xx
void bornRadBoxClosed(void)
void positionBoxClosed(void)
void unregisterVelocityPickup(Compute *cid, Box< Patch, CompAtom > **const box)
void avgPositionBoxClosed(void)
ForceList f[Results::maxNumForces]
void velocityBoxClosed(void)
void positionsReady(int n=0, int startup=1)
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)