16 #ifdef BENCHMARK_TIME_WALK
17 double walkTime, keepTime, finishNodeTime, doWorkTime;
21 #ifdef BENCHMARK_TIME_WALK
22 walkTime = keepTime = finishNodeTime = doWorkTime = 0.0;
25 TreeWalk() : comp(NULL), ownerTP(NULL), type(InvalidWalk){
26 #ifdef BENCHMARK_TIME_WALK
27 walkTime = keepTime = finishNodeTime = doWorkTime = 0.0;
30 TreeWalk(WalkType t) : comp(NULL), ownerTP(NULL), type(t){
31 #ifdef BENCHMARK_TIME_WALK
32 walkTime = keepTime = finishNodeTime = doWorkTime = 0.0;
38 #ifdef BENCHMARK_TIME_WALK
39 CkPrintf(
"walk,keep,finishNode,doWork time: %lf %lf %lf %lf\n",walkTime,keepTime,finishNodeTime,doWorkTime);
45 Compute *getCompute(){
return comp;}
50 virtual void reset() {};
51 virtual void walk(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
int activeWalkIndex) = 0;
53 virtual void resumeWalk(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
int activeWalkIndex) {
54 walk(node, state, chunk, reqID, activeWalkIndex);
58 WalkType getSelfType() {
return type;}
65 #ifndef CHANGA_REFACTOR_WALKCHECK
66 void dft(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
bool isRoot,
int awi);
67 void bft(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
bool isRoot,
int awi);
69 void dft(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
bool isRoot,
int shift,
bool doprint);
76 void walk(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
int awi);
87 void walk(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
int awi);
114 void dft(GenericTreeNode *localNode,
State *state,
int chunk,
int reqID,
115 bool isRoot,
int awi,
int level);
119 GenericTreeNode *glblNode,
121 int chunk,
int reqID,
122 bool isRoot,
bool &didcomp,
127 void walk(GenericTreeNode *startAncestor,
State *state,
int chunk,
int reqID,
int awi);
128 void resumeWalk(GenericTreeNode *node,
State *state,
int chunk,
int reqID,
int activeWalkIndex);
129 NodeKey getTargetKey() {
return targetKey;}
143 if(worker->work(node,level)){
144 for(
int i = 0; i < node->numChildren(); i++){
145 dft(node->getChildren(i),worker,level+1);
147 if(node->numChildren() > 0) worker->doneChildren(node,level);
Base clase for all tree based computations.
Definition: Compute.h:26
Interface for work in LocalTreeTraversal.
Definition: Compute.h:277
void walk(GenericTreeNode *startAncestor, State *state, int chunk, int reqID, int awi)
Definition: TreeWalk.cpp:297
Definition: TreeWalk.h:102
Base class for walking trees.
Definition: TreeWalk.h:11
virtual void init(Compute *c, TreePiece *owner)
Associate a compute object and a treepiece with this walk.
Definition: TreeWalk.cpp:15
Base class for maintaining the state of a tree walk.
Definition: State.h:6
Definition: TreeWalk.h:82
class to walk just the local treepiece.
Definition: TreeWalk.h:135
Fundamental structure that holds particle and tree data.
Definition: ParallelGravity.h:730
void walk(GenericTreeNode *node, State *state, int chunk, int reqID, int awi)
Definition: TreeWalk.cpp:216
Walk a tree starting with the root node.
Definition: TreeWalk.h:63
void dft(GenericTreeNode *node, TreeNodeWorker *worker, int level)
Definition: TreeWalk.h:142