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 33 of file Compute.C.

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

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

Compute::~Compute (  )  [virtual]

Definition at line 43 of file Compute.C.

References localWorkMsg.

00043                   {
00044   delete localWorkMsg;
00045 }


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 108 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().

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

void Compute::enqueueWork (  )  [protected]

Definition at line 47 of file Compute.C.

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

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

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

void Compute::finishPatch ( int   )  [virtual]

Reimplemented in ComputeNonbondedCUDA.

Definition at line 112 of file Compute.C.

References DebugM.

Referenced by WorkDistrib::finishCUDAPatch().

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

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

Reimplemented in CudaComputeNonbonded.

Definition at line 84 of file Compute.C.

References enqueueWork().

Referenced by CudaComputeNonbonded::gbisP2PatchReady().

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

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

Reimplemented in CudaComputeNonbonded.

Definition at line 94 of file Compute.C.

References enqueueWork().

Referenced by CudaComputeNonbonded::gbisP3PatchReady().

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

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 104 of file Compute.C.

Referenced by enqueueWork().

00104                     {
00105   return 0;
00106 }

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

Reimplemented in CudaComputeNonbonded.

Definition at line 63 of file Compute.C.

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

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

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

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(), ComputeMgr::sendFinishPatchesOnPe(), ComputeMgr::sendFinishPatchOnPe(), ComputeMgr::sendOpenBoxesOnPe(), 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 Jul 23 01:17:18 2018 for NAMD by  doxygen 1.4.7