44#include "ck128bitHash.h"
51 CkVec<CkVec<T> > lists;
52 int totalNumInteractions;
54 GenericList() : totalNumInteractions(0) {}
58 for(
int i = 0; i < lists.length(); i++){
59 lists[i].length() = 0;
61 totalNumInteractions = 0;
65 for(
int i = 0; i < lists.length(); i++){
69 totalNumInteractions = 0;
72 void init(
int numBuckets,
int numper){
73 lists.resize(numBuckets);
74 for(
int i = 0; i < numBuckets; i++){
75 lists[i].reserve(numper);
79 CudaRequest *serialize(TreePiece *tp);
80 void getBucketParameters(TreePiece *tp,
82 int &bucketStart,
int &bucketSize){
85 GenericTreeNode *bucketNode = tp->bucketList[bucket];
88 bucketStart = bucketNode->bucketArrayIndex;
89 CkAssert(bucketStart >= 0);
92 void getActiveBucketParameters(TreePiece *tp,
94 int &bucketStart,
int &bucketSize){
97 GenericTreeNode *bucketNode = tp->bucketList[bucket];
98 BucketActiveInfo *binfo = &(tp->bucketActiveInfo[bucket]);
102 bucketSize = tp->bucketActiveInfo[bucket].size;
103 bucketStart = tp->bucketActiveInfo[bucket].start;
104 CkAssert(bucketStart >= 0);
107 void push_back(
int b, T &ilc, DoubleWalkState *state, TreePiece *tp);
117class DoubleWalkState :
public State {
145 GenericList<ILCell> nodeLists;
146 GenericList<ILPart> particleLists;
148 CkVec<CudaMultipoleMoments> *nodes;
149 CkVec<CompactPartData> *particles;
164 CkVec<GenericTreeNode *> markedBuckets;
168 std::unordered_map<NodeKey,int> nodeMap;
169 std::unordered_map<NodeKey,int> partMap;
171 bool nodeOffloadReady(){
172 return nodeLists.totalNumInteractions >= nodeThreshold;
175 bool partOffloadReady(){
176 return particleLists.totalNumInteractions >= partThreshold;
191 partMap.reserve(100);
195#ifdef HAPI_INSTRUMENT_WRS
196 void nodeListConstructionTimeStart(){
197 nodeListTime = CmiWallTimer();
200 double nodeListConstructionTimeStop(){
201 return CmiWallTimer()-nodeListTime;
204 void partListConstructionTimeStart(){
205 partListTime = CmiWallTimer();
208 double partListConstructionTimeStop(){
209 return CmiWallTimer()-partListTime;
CkVec< UndecidedList > UndecidedLists
Vector of undecided lists, one for each level.
Definition ParallelGravity.h:658
CkQ< OffsetNode > CheckList
Queue of nodes to check for interactions.
Definition ParallelGravity.h:654
Hold state where both the targets and sources are tree walked.
Definition State.h:117
CkVec< CkVec< LocalPartInfo > > lplists
Lists of local particles to be computed. One list for each level.
Definition State.h:128
CkVec< CkVec< OffsetNode > > clists
Lists of cells to be computed. One list for each level.
Definition State.h:126
UndecidedLists undlists
Definition State.h:124
CheckList * chklists
Definition State.h:121
bool * placedRoots
Definition State.h:137
CkVec< CkVec< RemotePartInfo > > rplists
Lists of remote particles to be computed. One list for each level.
Definition State.h:130
GenericTreeNode * lowestNode
Definition State.h:186
Base class for maintaining the state of a tree walk.
Definition State.h:6
int myNumParticlesPending
Keep track of how many buckets are unfinished. XXX note the misnomer.
Definition State.h:21
int * counterArrays[2]
counters to keep track of outstanding remote processor
Definition State.h:36
int bWalkDonePending
Definition State.h:10
int numPendingChunks
Number of pending chunks.
Definition State.h:32
int currentBucket
The bucket we have started to walk.
Definition State.h:12
Base class for tree nodes.
Definition GenericTreeNode.h:59
int lastParticle
An index to the last particle contained by this node, myNumParticles+1 means outside the node.
Definition GenericTreeNode.h:108
int firstParticle
An index for the first particle contained by this node, 0 means outside the node.
Definition GenericTreeNode.h:106