#include <ComputeNonbondedSelf.h>
Inheritance diagram for ComputeNonbondedSelf:

Public Member Functions | |
| ComputeNonbondedSelf (ComputeID c, PatchID pid, ComputeNonbondedWorkArrays *_workArrays, int minPartition=0, int maxPartition=1, int numPartitions=1) | |
| virtual | ~ComputeNonbondedSelf () |
Protected Member Functions | |
| virtual void | initialize () |
| virtual void | doForce (CompAtom *p, CompAtomExt *pExt, Results *r) |
Protected Attributes | |
| Box< Patch, CompAtom > * | avgPositionBox |
| SubmitReduction * | reduction |
| SubmitReduction * | pressureProfileReduction |
| BigReal * | pressureProfileData |
| ComputeNonbondedWorkArrays *const | workArrays |
| Pairlists | pairlists |
| int | pairlistsValid |
| BigReal | pairlistTolerance |
| int | minPart |
| int | maxPart |
| int | numParts |
Definition at line 13 of file ComputeNonbondedSelf.h.
|
||||||||||||||||||||||||||||
|
Definition at line 16 of file ComputeNonbondedSelf.C. References BigReal, ReductionMgr::Object(), pairlistsValid, pairlistTolerance, pressureProfileData, pressureProfileReduction, reduction, REDUCTIONS_BASIC, REDUCTIONS_PPROF_NONBONDED, and ReductionMgr::willSubmit(). 00019 : ComputePatch(c,pid), workArrays(_workArrays), 00020 minPart(minPartition), maxPart(maxPartition), numParts(numPartitions) 00021 { 00022 reduction = ReductionMgr::Object()->willSubmit(REDUCTIONS_BASIC); 00023 if (pressureProfileOn) { 00024 int n = pressureProfileAtomTypes; 00025 pressureProfileData = new BigReal[3*n*n*pressureProfileSlabs]; 00026 pressureProfileReduction = ReductionMgr::Object()->willSubmit( 00027 REDUCTIONS_PPROF_NONBONDED, 3*pressureProfileSlabs*((n*(n+1))/2)); 00028 } else { 00029 pressureProfileReduction = NULL; 00030 pressureProfileData = NULL; 00031 } 00032 pairlistsValid = 0; 00033 pairlistTolerance = 0.; 00034 }
|
|
|
Definition at line 44 of file ComputeNonbondedSelf.C. References avgPositionBox, and Patch::unregisterAvgPositionPickup(). 00045 {
00046 delete reduction;
00047 delete pressureProfileReduction;
00048 delete [] pressureProfileData;
00049 if (avgPositionBox != NULL) {
00050 patch->unregisterAvgPositionPickup(cid,&avgPositionBox);
00051 }
00052 }
|
|
||||||||||||||||
|
Implements ComputePatch. Definition at line 55 of file ComputeNonbondedSelf.C. References avgPositionBox, BigReal, Lattice::c(), ComputeNonbondedUtil::calcFullSelf, ComputeNonbondedUtil::calcFullSelfEnergy, ComputeNonbondedUtil::calcMergeSelf, ComputeNonbondedUtil::calcMergeSelfEnergy, ComputeNonbondedUtil::calcSelf, ComputeNonbondedUtil::calcSelfEnergy, ComputeNonbondedUtil::calcSlowSelf, ComputeNonbondedUtil::calcSlowSelfEnergy, Box< Owner, Data >::close(), DebugM, Flags::doEnergy, Flags::doFullElectrostatics, Flags::doMolly, Flags::doNonbonded, LdbCoordinator::endWork(), Results::f, nonbonded::ff, Patch::flags, nonbonded::fullf, nonbonded::groupplcutoff, Patch::lattice, Flags::maxAtomMovement, Flags::maxForceMerged, Flags::maxGroupRadius, nonbonded::maxPart, nonbonded::minPart, NAMD_die(), nonbonded::numAtoms, nonbonded::numParts, LdbCoordinator::Object(), nonbonded::offset, Box< Owner, Data >::open(), Lattice::origin(), nonbonded::p, nonbonded::pairlists, pairlistsValid, Flags::pairlistTolerance, pairlistTolerance, nonbonded::pExt, nonbonded::plcutoff, plint, pressureProfileData, pressureProfileReduction, nonbonded::pressureProfileReduction, reduction, nonbonded::reduction, Flags::savePairlists, nonbonded::savePairlists, LdbCoordinator::startWork(), SubmitReduction::submit(), ComputeNonbondedUtil::submitPressureProfileData(), ComputeNonbondedUtil::submitReductionData(), TRACE_COMPOBJ_IDOFFSET, Flags::usePairlists, nonbonded::usePairlists, nonbonded::workArrays, and Vector::z. 00056 {
00057 // Inform load balancer.
00058 // I assume no threads will suspend until endWork is called
00059 #ifndef NAMD_CUDA
00060 LdbCoordinator::Object()->startWork(cid,0); // Timestep not used
00061 #endif
00062
00063 #ifdef TRACE_COMPUTE_OBJECTS
00064 double traceObjStartTime = CmiWallTimer();
00065 #endif
00066
00067 DebugM(2,"doForce() called.\n");
00068 DebugM(1,numAtoms << " patch 1 atoms\n");
00069 DebugM(3, "NUMATOMSxNUMATOMS = " << numAtoms*numAtoms << "\n");
00070
00071 BigReal reductionData[reductionDataSize];
00072 for ( int i = 0; i < reductionDataSize; ++i ) reductionData[i] = 0;
00073 if (pressureProfileOn) {
00074 int n = pressureProfileAtomTypes;
00075 memset(pressureProfileData, 0, 3*n*n*pressureProfileSlabs*sizeof(BigReal));
00076 // adjust lattice dimensions to allow constant pressure
00077 const Lattice &lattice = patch->lattice;
00078 pressureProfileThickness = lattice.c().z / pressureProfileSlabs;
00079 pressureProfileMin = lattice.origin().z - 0.5*lattice.c().z;
00080 }
00081 if ( patch->flags.doNonbonded )
00082 {
00083 plint maxa = (plint)(-1);
00084 if ( numAtoms > maxa ) {
00085 char estr[1024];
00086 sprintf(estr,"patch has %d atoms, maximum allowed is %d",numAtoms,maxa);
00087 NAMD_die(estr);
00088 }
00089
00090 int doEnergy = patch->flags.doEnergy;
00091 nonbonded params;
00092 params.offset = 0.;
00093 params.p[0] = p;
00094 params.p[1] = p;
00095 params.pExt[0] = pExt;
00096 params.pExt[1] = pExt;
00097 params.ff[0] = r->f[Results::nbond];
00098 params.ff[1] = r->f[Results::nbond];
00099 params.numAtoms[0] = numAtoms;
00100 params.numAtoms[1] = numAtoms;
00101
00102 // DMK - Atom Separation (water vs. non-water)
00103 #if NAMD_SeparateWaters != 0
00104 params.numWaterAtoms[0] = numWaterAtoms;
00105 params.numWaterAtoms[1] = numWaterAtoms;
00106 #endif
00107
00108 params.reduction = reductionData;
00109 params.pressureProfileReduction = pressureProfileData;
00110
00111 params.minPart = minPart;
00112 params.maxPart = maxPart;
00113 params.numParts = numParts;
00114
00115 params.workArrays = workArrays;
00116
00117 params.pairlists = &pairlists;
00118 params.savePairlists = 0;
00119 params.usePairlists = 0;
00120 if ( patch->flags.savePairlists ) {
00121 params.savePairlists = 1;
00122 params.usePairlists = 1;
00123 } else if ( patch->flags.usePairlists ) {
00124 if ( ! pairlistsValid ||
00125 ( 2. * patch->flags.maxAtomMovement > pairlistTolerance ) ) {
00126 reductionData[pairlistWarningIndex] += 1;
00127 } else {
00128 params.usePairlists = 1;
00129 }
00130 }
00131 if ( ! params.usePairlists ) {
00132 pairlistsValid = 0;
00133 }
00134 params.plcutoff = cutoff;
00135 params.groupplcutoff = cutoff + 2. * patch->flags.maxGroupRadius;
00136 if ( params.savePairlists ) {
00137 pairlistsValid = 1;
00138 pairlistTolerance = 2. * patch->flags.pairlistTolerance;
00139 params.plcutoff += pairlistTolerance;
00140 params.groupplcutoff += pairlistTolerance;
00141 }
00142
00143 if ( patch->flags.doFullElectrostatics )
00144 {
00145 params.fullf[0] = r->f[Results::slow];
00146 params.fullf[1] = r->f[Results::slow];
00147 if ( patch->flags.doMolly ) {
00148 if ( doEnergy ) calcSelfEnergy(¶ms);
00149 else calcSelf(¶ms);
00150 CompAtom *p_avg = avgPositionBox->open();
00151 params.p[0] = p_avg;
00152 params.p[1] = p_avg;
00153 if ( doEnergy ) calcSlowSelfEnergy(¶ms);
00154 else calcSlowSelf(¶ms);
00155 avgPositionBox->close(&p_avg);
00156 } else if ( patch->flags.maxForceMerged == Results::slow ) {
00157 if ( doEnergy ) calcMergeSelfEnergy(¶ms);
00158 else calcMergeSelf(¶ms);
00159 } else {
00160 if ( doEnergy ) calcFullSelfEnergy(¶ms);
00161 else calcFullSelf(¶ms);
00162 }
00163 }
00164 else
00165 if ( doEnergy ) calcSelfEnergy(¶ms);
00166 else calcSelf(¶ms);
00167 }
00168
00169 submitReductionData(reductionData,reduction);
00170 if (pressureProfileOn)
00171 submitPressureProfileData(pressureProfileData, pressureProfileReduction);
00172
00173 #ifdef TRACE_COMPUTE_OBJECTS
00174 traceUserBracketEvent(TRACE_COMPOBJ_IDOFFSET+cid, traceObjStartTime, CmiWallTimer());
00175 #endif
00176
00177 // Inform load balancer
00178 #ifndef NAMD_CUDA
00179 LdbCoordinator::Object()->endWork(cid,0); // Timestep not used
00180 #endif
00181
00182 reduction->submit();
00183 if (pressureProfileOn)
00184 pressureProfileReduction->submit();
00185 }
|
|
|
Reimplemented from ComputePatch. Definition at line 36 of file ComputeNonbondedSelf.C. References avgPositionBox, ComputePatch::initialize(), register_cuda_compute_self(), and Patch::registerAvgPositionPickup(). 00036 {
00037 ComputePatch::initialize();
00038 avgPositionBox = patch->registerAvgPositionPickup(cid);
00039 #ifdef NAMD_CUDA
00040 register_cuda_compute_self(cid, patchID);
00041 #endif
00042 }
|
|
|
Definition at line 24 of file ComputeNonbondedSelf.h. Referenced by doForce(), initialize(), and ~ComputeNonbondedSelf(). |
|
|
Definition at line 36 of file ComputeNonbondedSelf.h. |
|
|
Definition at line 36 of file ComputeNonbondedSelf.h. |
|
|
Definition at line 36 of file ComputeNonbondedSelf.h. |
|
|
Definition at line 32 of file ComputeNonbondedSelf.h. |
|
|
Definition at line 33 of file ComputeNonbondedSelf.h. Referenced by ComputeNonbondedSelf(), and doForce(). |
|
|
Definition at line 34 of file ComputeNonbondedSelf.h. Referenced by ComputeNonbondedSelf(), and doForce(). |
|
|
Definition at line 28 of file ComputeNonbondedSelf.h. Referenced by ComputeNonbondedSelf(), and doForce(). |
|
|
Definition at line 27 of file ComputeNonbondedSelf.h. Referenced by ComputeNonbondedSelf(), and doForce(). |
|
|
Definition at line 26 of file ComputeNonbondedSelf.h. Referenced by ComputeNonbondedSelf(), and doForce(). |
|
|
Definition at line 30 of file ComputeNonbondedSelf.h. |
1.3.9.1