Compute Class Reference

#include <Compute.h>

Inheritance diagram for Compute:
ComputeHomePatch ComputeHomePatches ComputeHomeTuples< T, S, P > ComputeHomeTuples< AngleElem, Angle, AngleValue > ComputeHomeTuples< AngleElem, Angle, AngleValue > ComputeHomeTuples< AnisoElem, Aniso, AnisoValue > ComputeHomeTuples< BondElem, Bond, BondValue > ComputeHomeTuples< CrosstermElem, Crossterm, CrosstermValue > ComputeHomeTuples< CrosstermElem, Crossterm, CrosstermValue > ComputeHomeTuples< DihedralElem, Dihedral, DihedralValue > ComputeHomeTuples< DihedralElem, Dihedral, DihedralValue > ComputeHomeTuples< ExclElem, Exclusion, int > ComputeHomeTuples< GromacsPairElem, GromacsPair, GromacsPairValue > ComputeHomeTuples< GromacsPairElem, GromacsPair, GromacsPairValue > ComputeHomeTuples< ImproperElem, Improper, ImproperValue > ComputeHomeTuples< TholeElem, Thole, TholeValue > ComputeHomeTuples< TholeElem, Thole, TholeValue > 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  c  ) 

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]
void Compute::doWork ( void   )  [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, ComputeHomeTuples< AngleElem, Angle, AngleValue >, ComputeHomeTuples< CrosstermElem, Crossterm, CrosstermValue >, ComputeHomeTuples< GromacsPairElem, GromacsPair, GromacsPairValue >, ComputeHomeTuples< DihedralElem, Dihedral, DihedralValue >, ComputeHomeTuples< DihedralElem, Dihedral, DihedralValue >, ComputeHomeTuples< AngleElem, Angle, AngleValue >, ComputeHomeTuples< TholeElem, Thole, TholeValue >, ComputeHomeTuples< ImproperElem, Improper, ImproperValue >, ComputeHomeTuples< CrosstermElem, Crossterm, CrosstermValue >, ComputeHomeTuples< BondElem, Bond, BondValue >, ComputeHomeTuples< AnisoElem, Aniso, AnisoValue >, ComputeHomeTuples< ExclElem, Exclusion, int >, ComputeHomeTuples< GromacsPairElem, GromacsPair, GromacsPairValue >, ComputeHomeTuples< TholeElem, Thole, TholeValue >, ComputeSelfTuples< AnisoElem, Aniso, AnisoValue >, ComputeSelfTuples< AngleElem, Angle, AngleValue >, ComputeSelfTuples< GromacsPairElem, GromacsPair, GromacsPairValue >, ComputeSelfTuples< ExclElem, Exclusion, int >, ComputeSelfTuples< DihedralElem, Dihedral, DihedralValue >, ComputeSelfTuples< ImproperElem, Improper, ImproperValue >, ComputeSelfTuples< BondElem, Bond, BondValue >, ComputeSelfTuples< CrosstermElem, Crossterm, CrosstermValue >, and ComputeSelfTuples< TholeElem, Thole, TholeValue >.

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  pid,
int  seq 
) [virtual]

Reimplemented in CudaComputeNonbonded.

Definition at line 84 of file Compute.C.

References enqueueWork().

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

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

Reimplemented in CudaComputeNonbonded.

Definition at line 94 of file Compute.C.

References enqueueWork().

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]
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< AngleElem, Angle, AngleValue >, ComputeHomeTuples< CrosstermElem, Crossterm, CrosstermValue >, ComputeHomeTuples< GromacsPairElem, GromacsPair, GromacsPairValue >, ComputeHomeTuples< DihedralElem, Dihedral, DihedralValue >, ComputeHomeTuples< DihedralElem, Dihedral, DihedralValue >, ComputeHomeTuples< AngleElem, Angle, AngleValue >, ComputeHomeTuples< TholeElem, Thole, TholeValue >, ComputeHomeTuples< ImproperElem, Improper, ImproperValue >, ComputeHomeTuples< CrosstermElem, Crossterm, CrosstermValue >, ComputeHomeTuples< BondElem, Bond, BondValue >, ComputeHomeTuples< AnisoElem, Aniso, AnisoValue >, ComputeHomeTuples< ExclElem, Exclusion, int >, ComputeHomeTuples< GromacsPairElem, GromacsPair, GromacsPairValue >, ComputeHomeTuples< TholeElem, Thole, TholeValue >, ComputeSelfTuples< AnisoElem, Aniso, AnisoValue >, ComputeSelfTuples< AngleElem, Angle, AngleValue >, ComputeSelfTuples< GromacsPairElem, GromacsPair, GromacsPairValue >, ComputeSelfTuples< ExclElem, Exclusion, int >, ComputeSelfTuples< DihedralElem, Dihedral, DihedralValue >, ComputeSelfTuples< ImproperElem, Improper, ImproperValue >, ComputeSelfTuples< BondElem, Bond, BondValue >, ComputeSelfTuples< CrosstermElem, Crossterm, CrosstermValue >, and ComputeSelfTuples< TholeElem, Thole, TholeValue >.

Definition at line 56 of file Compute.h.

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  patchID,
int  doneMigration,
int  seq 
) [virtual]

Reimplemented in CudaComputeNonbonded.

Definition at line 63 of file Compute.C.

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

Referenced by 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]
int Compute::sequence ( void   )  [inline]
void Compute::setNumPatches ( int  n  )  [inline]
int Compute::type (  )  [inline]

Member Data Documentation

int Compute::basePriority [protected]
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]
int Compute::gbisPhasePriority[3] [protected]
LDObjHandle Compute::ldObjHandle

The documentation for this class was generated from the following files:

Generated on 19 Jan 2019 for NAMD by  doxygen 1.6.1