NAMD
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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

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

33  : gbisPhase(1),basePriority(0), cid(c),
35  gbisPhasePriority[0] = 0;
36  gbisPhasePriority[1] = 0;
37  gbisPhasePriority[2] = 0;
38  doAtomUpdate = false;
40  LdbIdField(ldObjHandle.id, 0) = 0;
41 }
LDObjHandle ldObjHandle
Definition: Compute.h:44
LocalWorkMsg *const localWorkMsg
Definition: Compute.h:46
#define PRIORITY_SIZE
Definition: Priorities.h:13
ComputeType type(ComputeID cid)
Definition: ComputeMap.C:120
int computeType
Definition: Compute.h:36
int gbisPhasePriority[3]
Definition: Compute.h:40
const int & LdbIdField(const LdbId &id, const int index)
int gbisPhase
Definition: Compute.h:39
static ComputeMap * Object()
Definition: ComputeMap.h:89
int basePriority
Definition: Compute.h:37
const ComputeID cid
Definition: Compute.h:43
Compute::~Compute ( )
virtual

Definition at line 43 of file Compute.C.

References localWorkMsg.

43  {
44  delete localWorkMsg;
45 }
LocalWorkMsg *const localWorkMsg
Definition: Compute.h:46

Member Function Documentation

virtual void Compute::atomUpdate ( void  )
inlinevirtual
void Compute::doWork ( void  )
virtual

Reimplemented in ComputeHomeTuples< T, S, P >, 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< T, S, P >, 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 >, ComputeSelfTuples< TholeElem, Thole, TholeValue >, CudaComputeNonbonded, ComputeQM, ComputeLCPO, ComputeEwald, ComputeMoa, ComputeNonbondedCUDA, ComputeNonbondedMIC, ComputePme, ComputeGlobal, ComputeHomePatch, ComputePatchPair, ComputePatch, ComputeGBISser, ComputeMsm, ComputeTclBC, ComputePmeCUDA, ComputeExt, ComputeFmmSerial, ComputeFullDirect, and ComputeMsmSerial.

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

108  {
109  DebugM(5,"Default Compute::doWork() called.\n");
110 }
#define DebugM(x, y)
Definition: Debug.h:59
void Compute::enqueueWork ( )
protected

Definition at line 47 of file Compute.C.

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

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

47  {
48  if (!this) { DebugM(4,"This Compute is NULL!!!\n"); }
49  if ( ! noWork() ) {
50  //gbisPhase = 1; //first phase - this should already be 1
51  WorkDistrib::messageEnqueueWork(this); // should be in ComputeMgr?
52  } else {
53  //don't enqueue work
54  }
55 }
#define DebugM(x, y)
Definition: Debug.h:59
static void messageEnqueueWork(Compute *)
Definition: WorkDistrib.C:2727
virtual int noWork()
Definition: Compute.C:104
void Compute::finishPatch ( int  )
virtual

Reimplemented in ComputeNonbondedCUDA.

Definition at line 112 of file Compute.C.

References DebugM.

Referenced by WorkDistrib::finishCUDAPatch().

112  {
113  DebugM(5,"Default Compute::finishPatch() called.\n");
114 }
#define DebugM(x, y)
Definition: Debug.h:59
void Compute::gbisP2PatchReady ( PatchID  pid,
int  seq 
)
virtual

Reimplemented in CudaComputeNonbonded.

Definition at line 84 of file Compute.C.

References enqueueWork().

Referenced by CudaComputeNonbonded::gbisP2PatchReady().

84  {
85 
86  if (! --patchReadyCounter) {
87  patchReadyCounter = numPatches;
88  //gbisPhase = 2;
89  sequenceNumber = seq;
90  enqueueWork();
91  }
92 }
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
void enqueueWork()
Definition: Compute.C:47
void Compute::gbisP3PatchReady ( PatchID  pid,
int  seq 
)
virtual

Reimplemented in CudaComputeNonbonded.

Definition at line 94 of file Compute.C.

References enqueueWork().

Referenced by CudaComputeNonbonded::gbisP3PatchReady().

94  {
95  if (! --patchReadyCounter) {
96  patchReadyCounter = numPatches;
97  //gbisPhase = 3;
98  sequenceNumber = seq;
99  enqueueWork();
100  }
101 }
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
void enqueueWork()
Definition: Compute.C:47
int Compute::getGBISPhase ( void  )
inline

Definition at line 66 of file Compute.h.

References gbisPhase.

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

66 {return gbisPhase;}
int gbisPhase
Definition: Compute.h:39
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().

53 { return (numPatches); };
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
virtual void Compute::initialize ( void  )
inlinevirtual

Reimplemented in ComputeHomeTuples< T, S, P >, 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< T, S, P >, 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 >, ComputeSelfTuples< TholeElem, Thole, TholeValue >, CudaComputeNonbonded, ComputeQM, ComputeLCPO, ComputeHomePatches, ComputePme, ComputeHomePatch, ComputePatchPair, ComputeNonbondedSelf, ComputePatch, ComputeNonbondedPair, and ComputePmeCUDA.

Definition at line 56 of file Compute.h.

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

56 {};
int Compute::noWork ( )
virtual

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

Definition at line 104 of file Compute.C.

Referenced by enqueueWork().

104  {
105  return 0;
106 }
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 CudaComputeNonbonded::patchReady(), ComputeMgr::recvNonbondedCUDASlaveReady(), and ComputeMgr::recvNonbondedMICSlaveReady().

63  {
64  if (doneMigration) { // If any patch has done migration - we must remap
65  doAtomUpdate = true;
66  }
67 
68  if (numPatches <= 0) {
69  DebugM(5,"Compute::patchReady("<<patchID<<")-call not valid!\n");
70  } else {
71  if (! --patchReadyCounter) {
72  patchReadyCounter = numPatches;
73  //gbisPhase = 1;
74  sequenceNumber = seq; // breaks CUDA priority if done earlier
75  if (doAtomUpdate) {
76  atomUpdate();
77  doAtomUpdate = false;
78  }
79  enqueueWork();
80  }
81  }
82 }
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
#define DebugM(x, y)
Definition: Debug.h:59
void enqueueWork()
Definition: Compute.C:47
virtual void atomUpdate()
Definition: Compute.h:59
int Compute::priority ( void  )
inline
int Compute::sequence ( void  )
inline
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().

52 { patchReadyCounter = numPatches = n; }
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t cudaTextureObject_t const int const float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float4 *__restrict__ float4 *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
int Compute::type ( )
inline

Member Data Documentation

int Compute::basePriority
protected
const ComputeID Compute::cid
int Compute::computeType
protected

Definition at line 36 of file Compute.h.

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

int Compute::gbisPhase
protected
int Compute::gbisPhasePriority[3]
protected
LDObjHandle Compute::ldObjHandle
LocalWorkMsg* const Compute::localWorkMsg

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