4 #ifdef COOLING_MOLECULARH
33 Compute(ComputeType t) : type(t) {}
37 void setOpt(
Opt *opt);
44 virtual int openCriterion(
TreePiece *ownerTP,
47 virtual void stateReady(
State *state,
TreePiece *owner,
int chunk,
int start,
int end) {}
49 virtual void stateReadyPar(
TreePiece *tp,
int start,
int end,
50 CkVec<OffsetNode>& clist, CkVec<RemotePartInfo>& rpilist,
51 CkVec<LocalPartInfo>& lpilist){}
53 virtual void fillLists(
State *state_,
TreePiece *tp,
int chunk,
int start,
54 int end, CkVec<OffsetNode>& clistforb, CkVec<RemotePartInfo>& rplistforb,
55 CkVec<LocalPartInfo>& lplistforb) {}
59 virtual void init(
void *cE,
int activeRung,
Opt *opt);
60 virtual void reassoc(
void *cE,
int aR,
Opt *opt){}
61 ComputeType getSelfType(){
return type;}
63 int getActiveRung() {
return activeRung;}
67 virtual void initState(
State *state){}
85 virtual void walkDone(
State *state){}
86 virtual void setComputeEntity(
void *ce){
90 virtual void *getComputeEntity(){
94 virtual State *getNewState(
int d1,
int d2);
95 virtual State *getNewState(
int d1);
96 virtual State *getNewState();
97 virtual void freeState(
State *state);
106 #ifdef BENCHMARK_TIME_COMPUTE
107 double computeTimePart;
108 double computeTimeNode;
111 void updateInterMass(
GravityParticle *p,
int start,
int end,
double mass);
116 #ifdef BENCHMARK_TIME_COMPUTE
117 computeTimePart = 0.0;
118 computeTimeNode = 0.0;
122 #ifdef BENCHMARK_TIME_COMPUTE
123 CkPrintf(
"Compute time part: %f\n",computeTimePart);
124 CkPrintf(
"Compute time node: %f\n",computeTimeNode);
138 void reassoc(
void *cE,
int activeRung,
Opt *o);
142 #if INTERLIST_VER > 0
167 CkVec<OffsetNode>& clist, CkVec<RemotePartInfo>& rpilist,
168 CkVec<LocalPartInfo>& lpilist);
171 int end, CkVec<OffsetNode>& clistforb, CkVec<RemotePartInfo>& rplistforb,
172 CkVec<LocalPartInfo>& lplistforb);
176 void reassoc(
void *cE,
int activeRung,
Opt *o);
184 #ifdef GPU_LOCAL_TREE_WALK
185 void sendLocalTreeWalkTriggerToGpu(
State *state,
TreePiece *tp,
int activeRung,
int startBucket,
int endBucket);
186 #endif //GPU_LOCAL_TREE_WALK
198 #if defined CHANGA_REFACTOR_PRINT_INTERACTIONS || defined CHANGA_REFACTOR_WALKCHECK_INTERLIST || defined CUDA
213 void getBucketParameters(
TreePiece *tp,
int bucket,
int &bucketStart,
int &
bucketSize, std::map<NodeKey, int>&lpref);
218 void initCudaState(
DoubleWalkState *state,
int numBuckets,
int nodeThreshold,
int partThreshold,
bool resume);
257 remoteGravityAwi = 2,
272 tw(_tw), c(_c), o(_o), s(state){}
288 bool requestNonLocalMoments;
293 requestNonLocalMoments(req)
339 file <<
"}" << std::endl;
347 #ifdef COOLING_MOLECULARH
354 LocalLymanWernerDistributor(
TreePiece *owner) :
int openCriterion(TreePiece *ownerTP, GenericTreeNode *node, int reqID, State *state)
apply node opening criterion to this node.
Definition: Compute.cpp:955
Class to build the remote part of the tree. Fills in Boundary and NonLocal nodes. ...
Definition: Compute.h:286
Base clase for all tree based computations.
Definition: Compute.h:26
CkQ< OffsetNode > CheckList
Queue of nodes to check for interactions.
Definition: ParallelGravity.h:629
Class to compute gravity using a "bucket walk".
Definition: Compute.h:105
Interface for work in LocalTreeTraversal.
Definition: Compute.h:277
void recvdParticles(ExternalGravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Process received remote particles.
Definition: Compute.cpp:881
Compute for the remote node prefetch walk.
Definition: Compute.h:226
Computations for Stadel-style interaction list walk.
Definition: Compute.h:148
void fillLists(State *state_, TreePiece *tp, int chunk, int start, int end, CkVec< OffsetNode > &clistforb, CkVec< RemotePartInfo > &rplistforb, CkVec< LocalPartInfo > &lplistforb)
Populate CkLoop Data.
Definition: Compute.cpp:1221
Definition: Compute.h:264
virtual void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition: Compute.h:75
int computeParticleForces(TreePiece *owner, GenericTreeNode *node, ExternalGravityParticle *part, int reqID)
Calculate forces due to particles in a node.
Definition: Compute.cpp:586
virtual void nodeMissedEvent(int reqID, int chunk, State *state, TreePiece *tp)
Allow book-keeping of a cache miss.
Definition: Compute.h:77
void recvdParticles(ExternalGravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Allow book-keeping of a cache receive event.
Definition: Compute.cpp:320
Base class for walking trees.
Definition: TreeWalk.h:11
void initState(State *state)
Clear lists.
Definition: Compute.cpp:178
int doWork(GenericTreeNode *, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi)
Work to be done at each node.
Definition: Compute.cpp:402
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition: Compute.cpp:333
void recvdParticles(ExternalGravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Allow book-keeping of a cache receive event.
Definition: Compute.cpp:267
virtual void init(void *cE, int activeRung, Opt *opt)
Associate computeEntity (target bucket or node), activeRung and Optimization with this Compute object...
Definition: Compute.cpp:22
void freeDoubleWalkState(DoubleWalkState *state)
Free up all the lists.
Definition: Compute.cpp:83
void nodeMissedEvent(int reqID, int chunk, State *state, TreePiece *tp)
Update state on a node miss.
Definition: Compute.cpp:242
Class to build the local part of the tree. Builds Internal nodes.
Definition: Compute.h:305
WalkIndices
distingish between the walks that could be running.
Definition: Compute.h:254
TreeNodeWorker implementation that just prints out the tree. This is just for diagnostics.
Definition: Compute.h:323
Base class for tree nodes.
Definition: GenericTreeNode.h:59
virtual void recvdParticlesFull(GravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Allow book-keeping of a cache receive event.
Definition: Compute.h:83
void stateReadyPar(TreePiece *tp, int start, int end, CkVec< OffsetNode > &clist, CkVec< RemotePartInfo > &rpilist, CkVec< LocalPartInfo > &lpilist)
CkLoop version of stateReady()
Definition: Compute.cpp:1893
Base class for maintaining the state of a tree walk.
Definition: State.h:6
virtual void startNodeProcessEvent(State *state)
Definition: Compute.h:73
Information needed to calculate gravity.
Definition: GravityParticle.h:33
virtual void recvdParticles(ExternalGravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket)
Allow book-keeping of a cache receive event.
Definition: Compute.h:81
Fundamental structure that holds particle and tree data.
Definition: ParallelGravity.h:730
Definition: Compute.h:244
virtual int doWork(GenericTreeNode *, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi)=0
Work to be done at each node.
void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Update state upon receiving a remote node.
Definition: Compute.cpp:354
Hold state where both the targets and sources are tree walked.
Definition: State.h:117
int doWork(GenericTreeNode *, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi)
Immediately stop the walk.
Definition: Compute.h:247
unsigned int bucketSize
Definition: ParallelGravity.cpp:125
virtual int doWork(GenericTreeNode *, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi)
Work to be done at each node.
Definition: Compute.cpp:621
State * getNewState()
Version that allocates a DoubleWalkState.
Definition: Compute.cpp:163
void freeState(State *state)
Version that frees a DoubleWalkState.
Definition: Compute.cpp:77
Base class for optimizing walk actions.
Definition: Opt.h:12
Fundamental type for a particle.
Definition: GravityParticle.h:316
void nodeMissedEvent(int reqID, int chunk, State *state, TreePiece *tp)
Allow book-keeping of a cache miss.
Definition: Compute.cpp:218
void reassoc(void *cE, int activeRung, Opt *o)
Reassociate the target node.
Definition: Compute.cpp:211
void stateReady(State *, TreePiece *, int chunk, int start, int end)
Check for computation Computation can be done on buckets indexed from start to end.
Definition: Compute.cpp:1511
virtual void nodeRecvdEvent(TreePiece *owner, int chunk, State *state, int bucket)
Allow book-keeping of a cache receive event.
Definition: Compute.h:79
void finishNodeProcessEvent(TreePiece *owner, State *state)
Allow book-keeping when finished with a node.
Definition: Compute.cpp:231
int doWork(GenericTreeNode *, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi)
Process a node.
Definition: Compute.cpp:686
void startNodeProcessEvent(State *state)
Definition: Compute.cpp:225