Compute Class Reference

#include <Compute.h>

Inheritance diagram for Compute:

ComputeHomePatch ComputeHomePatches ComputeHomeTuples< T, S, P > ComputeHomeTuples< AngleElem, angle, AngleValue > ComputeHomeTuples< AnisoElem, aniso, aniso > ComputeHomeTuples< BondElem, bond, BondValue > ComputeHomeTuples< CrosstermElem, crossterm, CrosstermValue > ComputeHomeTuples< DihedralElem, dihedral, DihedralValue > ComputeHomeTuples< ExclElem, Exclusion, int > ComputeHomeTuples< GromacsPairElem, gromacsPair, GromacsPairValue > ComputeHomeTuples< ImproperElem, improper, ImproperValue > ComputeHomeTuples< TholeElem, thole, thole > ComputeLCPO ComputeNonbondedCUDA ComputeNonbondedMIC ComputePatch ComputePatchPair ComputePme ComputePmeCUDA CudaComputeNonbonded List of all members.

Public Member Functions

 Compute (ComputeID)
int type ()
virtual ~Compute ()
void setNumPatches (int n)
int getNumPatches ()
virtual void initialize ()
virtual void atomUpdate ()
virtual void patchReady (PatchID, int doneMigration, int seq)
virtual int noWork ()
virtual void doWork ()
virtual void finishPatch (int)
int sequence (void)
int priority (void)
int getGBISPhase (void)
virtual void gbisP2PatchReady (PatchID, int seq)
virtual void gbisP3PatchReady (PatchID, int seq)

Public Attributes

const ComputeID cid
LDObjHandle ldObjHandle
LocalWorkMsg *const localWorkMsg

Protected Member Functions

void enqueueWork ()

Protected Attributes

int computeType
int basePriority
int gbisPhase
int gbisPhasePriority [3]

Detailed Description

Definition at line 28 of file Compute.h.


Constructor & Destructor Documentation

Compute::Compute ( ComputeID   ) 

Definition at line 31 of file Compute.C.

References computeType, gbisPhasePriority, ldObjHandle, ComputeMap::Object(), and ComputeMap::type().

00031                             : gbisPhase(1),basePriority(0), cid(c),
00032         localWorkMsg(new (PRIORITY_SIZE) LocalWorkMsg) { 
00033   gbisPhasePriority[0] = 0;
00034   gbisPhasePriority[1] = 0;
00035   gbisPhasePriority[2] = 0;
00036   doAtomUpdate = false;
00037   computeType = ComputeMap::Object()->type(c);
00038   ldObjHandle.id.id[0] = -1;
00039 }

Compute::~Compute (  )  [virtual]

Definition at line 41 of file Compute.C.

References localWorkMsg.

00041                   {
00042   delete localWorkMsg;
00043 }


Member Function Documentation

virtual void Compute::atomUpdate ( void   )  [inline, virtual]

Reimplemented in ComputeHomePatch, ComputeHomePatches, ComputeHomeTuples< T, S, P >, ComputeLCPO, ComputeNonbondedCUDA, ComputeNonbondedMIC, ComputePatch, ComputePatchPair, ComputePme, ComputePmeCUDA, CudaComputeNonbonded, ComputeHomeTuples< GromacsPairElem, gromacsPair, GromacsPairValue >, ComputeHomeTuples< AngleElem, angle, AngleValue >, ComputeHomeTuples< ExclElem, Exclusion, int >, ComputeHomeTuples< ImproperElem, improper, ImproperValue >, ComputeHomeTuples< BondElem, bond, BondValue >, ComputeHomeTuples< TholeElem, thole, thole >, ComputeHomeTuples< CrosstermElem, crossterm, CrosstermValue >, ComputeHomeTuples< DihedralElem, dihedral, DihedralValue >, and ComputeHomeTuples< AnisoElem, aniso, aniso >.

Definition at line 59 of file Compute.h.

Referenced by ComputeHomePatches::atomUpdate(), and patchReady().

00059 {};

void Compute::doWork (  )  [virtual]

Reimplemented in ComputeEwald, ComputeExt, ComputeFmmSerial, ComputeFullDirect, ComputeGBISser, ComputeGlobal, ComputeHomePatch, ComputeHomeTuples< T, S, P >, ComputeLCPO, ComputeMoa, ComputeMsm, ComputeMsmSerial, ComputeNonbondedCUDA, ComputeNonbondedMIC, ComputePatch, ComputePatchPair, ComputePme, ComputePmeCUDA, ComputeQM, ComputeSelfTuples< T, S, P >, ComputeTclBC, CudaComputeNonbonded, OptPmeCompute, ComputeHomeTuples< GromacsPairElem, gromacsPair, GromacsPairValue >, ComputeHomeTuples< AngleElem, angle, AngleValue >, ComputeHomeTuples< ExclElem, Exclusion, int >, ComputeHomeTuples< ImproperElem, improper, ImproperValue >, ComputeHomeTuples< BondElem, bond, BondValue >, ComputeHomeTuples< TholeElem, thole, thole >, ComputeHomeTuples< CrosstermElem, crossterm, CrosstermValue >, ComputeHomeTuples< DihedralElem, dihedral, DihedralValue >, ComputeHomeTuples< AnisoElem, aniso, aniso >, ComputeSelfTuples< GromacsPairElem, gromacsPair, GromacsPairValue >, ComputeSelfTuples< AngleElem, angle, AngleValue >, ComputeSelfTuples< ExclElem, Exclusion, int >, ComputeSelfTuples< ImproperElem, improper, ImproperValue >, ComputeSelfTuples< BondElem, bond, BondValue >, ComputeSelfTuples< TholeElem, thole, thole >, ComputeSelfTuples< DihedralElem, dihedral, DihedralValue >, ComputeSelfTuples< CrosstermElem, crossterm, CrosstermValue >, and ComputeSelfTuples< AnisoElem, aniso, aniso >.

Definition at line 106 of file Compute.C.

References DebugM.

Referenced by WorkDistrib::enqueueAngles(), WorkDistrib::enqueueAniso(), WorkDistrib::enqueueBonds(), WorkDistrib::enqueueCrossterms(), WorkDistrib::enqueueCUDA(), WorkDistrib::enqueueCUDAP2(), WorkDistrib::enqueueCUDAP3(), WorkDistrib::enqueueDihedrals(), WorkDistrib::enqueueExcls(), WorkDistrib::enqueueGromacsPair(), WorkDistrib::enqueueImpropers(), WorkDistrib::enqueueLCPO(), WorkDistrib::enqueueMIC(), WorkDistrib::enqueuePme(), WorkDistrib::enqueueSelfA1(), WorkDistrib::enqueueSelfA2(), WorkDistrib::enqueueSelfA3(), WorkDistrib::enqueueSelfB1(), WorkDistrib::enqueueSelfB2(), WorkDistrib::enqueueSelfB3(), WorkDistrib::enqueueThole(), WorkDistrib::enqueueWork(), WorkDistrib::enqueueWorkA1(), WorkDistrib::enqueueWorkA2(), WorkDistrib::enqueueWorkA3(), WorkDistrib::enqueueWorkB1(), WorkDistrib::enqueueWorkB2(), WorkDistrib::enqueueWorkB3(), WorkDistrib::enqueueWorkC(), WorkDistrib::finishCUDA(), WorkDistrib::finishCUDAP2(), WorkDistrib::finishCUDAP3(), WorkDistrib::finishMIC(), WorkDistrib::messageEnqueueWork(), WorkDistrib::messageFinishCUDA(), and WorkDistrib::messageFinishMIC().

00106                      {
00107     DebugM(5,"Default Compute::doWork() called.\n");
00108 }

void Compute::enqueueWork (  )  [protected]

Definition at line 45 of file Compute.C.

References DebugM, WorkDistrib::messageEnqueueWork(), and noWork().

Referenced by gbisP2PatchReady(), gbisP3PatchReady(), and patchReady().

00045                           {
00046   if (!this) { DebugM(4,"This Compute is NULL!!!\n"); }
00047   if ( ! noWork() ) {
00048     //gbisPhase = 1; //first phase - this should already be 1
00049     WorkDistrib::messageEnqueueWork(this);  // should be in ComputeMgr?
00050   } else {
00051     //don't enqueue work
00052   }
00053 }

void Compute::finishPatch ( int   )  [virtual]

Reimplemented in ComputeNonbondedCUDA.

Definition at line 110 of file Compute.C.

References DebugM.

Referenced by WorkDistrib::finishCUDAPatch().

00110                              {
00111     DebugM(5,"Default Compute::finishPatch() called.\n");
00112 }

void Compute::gbisP2PatchReady ( PatchID  ,
int  seq 
) [virtual]

Reimplemented in CudaComputeNonbonded.

Definition at line 82 of file Compute.C.

References enqueueWork().

Referenced by CudaComputeNonbonded::gbisP2PatchReady().

00082                                                    {
00083 
00084   if (! --patchReadyCounter) {
00085     patchReadyCounter = numPatches;
00086     //gbisPhase = 2;
00087     sequenceNumber = seq;
00088     enqueueWork();
00089   }
00090 }

void Compute::gbisP3PatchReady ( PatchID  ,
int  seq 
) [virtual]

Reimplemented in CudaComputeNonbonded.

Definition at line 92 of file Compute.C.

References enqueueWork().

Referenced by CudaComputeNonbonded::gbisP3PatchReady().

00092                                                    {
00093   if (! --patchReadyCounter) {
00094     patchReadyCounter = numPatches;
00095     //gbisPhase = 3;
00096     sequenceNumber = seq;
00097     enqueueWork();
00098   }
00099 }

int Compute::getGBISPhase ( void   )  [inline]

Definition at line 66 of file Compute.h.

References gbisPhase.

Referenced by WorkDistrib::messageEnqueueWork(), WorkDistrib::messageFinishCUDA(), and WorkDistrib::messageFinishMIC().

00066 {return gbisPhase;}

int Compute::getNumPatches (  )  [inline]

Definition at line 53 of file Compute.h.

Referenced by CudaComputeNonbonded::assignPatches(), ComputeLCPO::ComputeLCPO(), ComputePmeCUDA::ComputePmeCUDA(), ComputeLCPO::doWork(), ComputePmeCUDA::initialize(), ComputePmeCUDA::noWork(), CudaComputeNonbonded::openBoxesOnPe(), CudaComputeNonbonded::skipPatchesOnPe(), ComputePmeCUDA::storePmeForceMsg(), ComputeLCPO::~ComputeLCPO(), and ComputePmeCUDA::~ComputePmeCUDA().

00053 { return (numPatches); };

virtual void Compute::initialize ( void   )  [inline, virtual]

Reimplemented in ComputeHomePatch, ComputeHomePatches, ComputeHomeTuples< T, S, P >, ComputeLCPO, ComputeNonbondedPair, ComputeNonbondedSelf, ComputePatch, ComputePatchPair, ComputePme, ComputePmeCUDA, ComputeQM, ComputeSelfTuples< T, S, P >, CudaComputeNonbonded, ComputeHomeTuples< GromacsPairElem, gromacsPair, GromacsPairValue >, ComputeHomeTuples< AngleElem, angle, AngleValue >, ComputeHomeTuples< ExclElem, Exclusion, int >, ComputeHomeTuples< ImproperElem, improper, ImproperValue >, ComputeHomeTuples< BondElem, bond, BondValue >, ComputeHomeTuples< TholeElem, thole, thole >, ComputeHomeTuples< CrosstermElem, crossterm, CrosstermValue >, ComputeHomeTuples< DihedralElem, dihedral, DihedralValue >, ComputeHomeTuples< AnisoElem, aniso, aniso >, ComputeSelfTuples< GromacsPairElem, gromacsPair, GromacsPairValue >, ComputeSelfTuples< AngleElem, angle, AngleValue >, ComputeSelfTuples< ExclElem, Exclusion, int >, ComputeSelfTuples< ImproperElem, improper, ImproperValue >, ComputeSelfTuples< BondElem, bond, BondValue >, ComputeSelfTuples< TholeElem, thole, thole >, ComputeSelfTuples< DihedralElem, dihedral, DihedralValue >, ComputeSelfTuples< CrosstermElem, crossterm, CrosstermValue >, and ComputeSelfTuples< AnisoElem, aniso, aniso >.

Definition at line 56 of file Compute.h.

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

00056 {};

int Compute::noWork (  )  [virtual]

Reimplemented in ComputeLCPO, ComputeNonbondedCUDA, ComputeNonbondedMIC, ComputeNonbondedPair, ComputeNonbondedSelf, ComputePme, ComputePmeCUDA, and CudaComputeNonbonded.

Definition at line 102 of file Compute.C.

Referenced by enqueueWork().

00102                     {
00103   return 0;
00104 }

void Compute::patchReady ( PatchID  ,
int  doneMigration,
int  seq 
) [virtual]

Reimplemented in CudaComputeNonbonded.

Definition at line 61 of file Compute.C.

References atomUpdate(), DebugM, and enqueueWork().

Referenced by CudaComputeNonbonded::patchReady(), ComputeMgr::recvNonbondedCUDASlaveReady(), and ComputeMgr::recvNonbondedMICSlaveReady().

00061                                                                     { 
00062   if (doneMigration) { // If any patch has done migration - we must remap
00063     doAtomUpdate = true; 
00064   }
00065 
00066   if (numPatches <= 0) {
00067       DebugM(5,"Compute::patchReady("<<patchID<<")-call not valid!\n");
00068   } else {
00069     if (! --patchReadyCounter) {
00070       patchReadyCounter = numPatches;
00071       //gbisPhase = 1;
00072       sequenceNumber = seq;  // breaks CUDA priority if done earlier
00073       if (doAtomUpdate) {
00074         atomUpdate();
00075         doAtomUpdate = false;
00076       }
00077       enqueueWork();
00078     }
00079   }
00080 }

int Compute::priority ( void   )  [inline]

Definition at line 65 of file Compute.h.

References basePriority, gbisPhase, and gbisPhasePriority.

Referenced by ComputeNonbondedCUDA::finishWork(), CudaComputeNonbonded::initialize(), WorkDistrib::messageEnqueueWork(), WorkDistrib::messageFinishCUDA(), WorkDistrib::messageFinishMIC(), and cptr_sortop_priority::operator()().

int Compute::sequence ( void   )  [inline]

Definition at line 64 of file Compute.h.

Referenced by ComputeNonbondedSelf::doForce(), ComputeNonbondedPair::doForce(), ComputeNonbondedCUDA::doWork(), ComputeMsm::doWork(), ComputeGBISser::doWork(), ComputeNonbondedCUDA::finishWork(), WorkDistrib::messageEnqueueWork(), WorkDistrib::messageFinishCUDA(), WorkDistrib::messageFinishMIC(), ComputeNonbondedCUDA::messageFinishPatch(), ComputeNonbondedCUDA::noWork(), ComputeNonbondedCUDA::recvYieldDevice(), and ComputePme::ungridForces().

00064 { return sequenceNumber; }

void Compute::setNumPatches ( int  n  )  [inline]

Definition at line 52 of file Compute.h.

Referenced by CudaComputeNonbonded::assignPatches(), ComputeHomePatch::ComputeHomePatch(), ComputeLCPO::ComputeLCPO(), ComputePatch::ComputePatch(), ComputePatchPair::ComputePatchPair(), ComputePme::ComputePme(), ComputePmeCUDA::ComputePmeCUDA(), ComputeHomePatches::initialize(), and ComputeNonbondedCUDA::registerPatches().

00052 { patchReadyCounter = numPatches = n; }

int Compute::type (  )  [inline]

Definition at line 48 of file Compute.h.

References computeType.

Referenced by WorkDistrib::messageEnqueueWork(), ComputeMgr::sendNonbondedCUDASlaveEnqueue(), and ComputeMgr::sendNonbondedMICSlaveEnqueue().

00048 { return computeType; };


Member Data Documentation

int Compute::basePriority [protected]

Definition at line 37 of file Compute.h.

Referenced by ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputePme::ComputePme(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputePatchPair::initialize(), ComputePatch::initialize(), ComputeLCPO::initialize(), ComputeHomePatch::initialize(), and priority().

const ComputeID Compute::cid

Definition at line 43 of file Compute.h.

Referenced by ComputeNonbondedSelf::doForce(), ComputeNonbondedPair::doForce(), ComputePatchPair::initialize(), ComputePatch::initialize(), ComputeNonbondedSelf::initialize(), ComputeNonbondedPair::initialize(), ComputeHomePatch::initialize(), WorkDistrib::messageEnqueueWork(), ComputeMgr::recvCreateNonbondedCUDASlave(), ComputeMgr::recvCreateNonbondedMICSlave(), Patch::registerAvgPositionPickup(), Patch::registerBornRadPickup(), Patch::registerDEdaSumDeposit(), Patch::registerDHdrPrefixPickup(), Patch::registerForceDeposit(), Patch::registerIntRadPickup(), Patch::registerLcpoTypePickup(), Patch::registerPositionPickup(), Patch::registerPsiSumDeposit(), Patch::registerVelocityPickup(), ComputeMgr::sendNonbondedCUDASlaveEnqueue(), ComputeMgr::sendNonbondedMICSlaveEnqueue(), Patch::unregisterAvgPositionPickup(), Patch::unregisterPositionPickup(), Patch::unregisterVelocityPickup(), ComputeHomePatch::~ComputeHomePatch(), ComputeLCPO::~ComputeLCPO(), ComputePatch::~ComputePatch(), and ComputePatchPair::~ComputePatchPair().

int Compute::computeType [protected]

Definition at line 36 of file Compute.h.

Referenced by Compute(), ComputePatchPair::doWork(), ComputePatch::doWork(), and type().

int Compute::gbisPhase [protected]

Definition at line 39 of file Compute.h.

Referenced by ComputePatch::ComputePatch(), ComputePatchPair::ComputePatchPair(), CudaComputeNonbonded::CudaComputeNonbonded(), ComputeNonbondedSelf::doForce(), ComputeNonbondedPair::doForce(), CudaComputeNonbonded::doWork(), ComputePatchPair::doWork(), ComputePatch::doWork(), ComputeNonbondedCUDA::doWork(), ComputeNonbondedCUDA::finishWork(), getGBISPhase(), CudaComputeNonbonded::launchWork(), ComputeNonbondedSelf::noWork(), ComputeNonbondedPair::noWork(), ComputeNonbondedCUDA::noWork(), priority(), and ComputeNonbondedCUDA::recvYieldDevice().

int Compute::gbisPhasePriority[3] [protected]

Definition at line 40 of file Compute.h.

Referenced by Compute(), ComputePatchPair::initialize(), ComputePatch::initialize(), and priority().

LDObjHandle Compute::ldObjHandle

Definition at line 44 of file Compute.h.

Referenced by Compute(), ComputePatchPair::doWork(), ComputePatch::doWork(), ComputeLCPO::doWork(), LdbCoordinator::initialize(), ComputeNonbondedSelf::noWork(), ComputeNonbondedPair::noWork(), and ComputeLCPO::noWork().

LocalWorkMsg* const Compute::localWorkMsg

Definition at line 46 of file Compute.h.

Referenced by WorkDistrib::enqueueAngles(), WorkDistrib::enqueueAniso(), WorkDistrib::enqueueBonds(), WorkDistrib::enqueueCrossterms(), WorkDistrib::enqueueDihedrals(), WorkDistrib::enqueueExcls(), WorkDistrib::enqueueGromacsPair(), WorkDistrib::enqueueImpropers(), WorkDistrib::enqueueLCPO(), WorkDistrib::enqueuePme(), WorkDistrib::enqueueSelfA1(), WorkDistrib::enqueueSelfA2(), WorkDistrib::enqueueSelfA3(), WorkDistrib::enqueueSelfB1(), WorkDistrib::enqueueSelfB2(), WorkDistrib::enqueueSelfB3(), WorkDistrib::enqueueThole(), WorkDistrib::enqueueWork(), WorkDistrib::enqueueWorkA1(), WorkDistrib::enqueueWorkA2(), WorkDistrib::enqueueWorkA3(), WorkDistrib::enqueueWorkB1(), WorkDistrib::enqueueWorkB2(), WorkDistrib::enqueueWorkB3(), WorkDistrib::enqueueWorkC(), WorkDistrib::messageEnqueueWork(), WorkDistrib::messageFinishCUDA(), WorkDistrib::messageFinishMIC(), ComputePmeCUDADevice::sendForcesToPatch(), ComputeMgr::sendNonbondedCUDASlaveEnqueue(), ComputeMgr::sendNonbondedMICSlaveEnqueue(), and ~Compute().


The documentation for this class was generated from the following files:
Generated on Mon Nov 20 01:17:16 2017 for NAMD by  doxygen 1.4.7