Computations for Stadel-style interaction list walk. More...
#include <Compute.h>
Public Member Functions | |
int | doWork (GenericTreeNode *, TreeWalk *tw, State *state, int chunk, int reqID, bool isRoot, bool &didcomp, int awi) |
Process a node. More... | |
int | openCriterion (TreePiece *ownerTP, GenericTreeNode *node, int reqID, State *state) |
apply node opening criterion to this node. | |
void | nodeMissedEvent (int reqID, int chunk, State *state, TreePiece *tp) |
Update state on a node miss. More... | |
void | nodeRecvdEvent (TreePiece *owner, int chunk, State *state, int bucket) |
Update state upon receiving a remote node. More... | |
void | recvdParticles (ExternalGravityParticle *egp, int num, int chunk, int reqID, State *state, TreePiece *tp, Tree::NodeKey &remoteBucket) |
Process received remote particles. More... | |
void | initState (State *state) |
Clear lists. | |
void | stateReady (State *, TreePiece *, int chunk, int start, int end) |
Check for computation Computation can be done on buckets indexed from start to end. More... | |
void | stateReadyPar (TreePiece *tp, int start, int end, CkVec< OffsetNode > &clist, CkVec< RemotePartInfo > &rpilist, CkVec< LocalPartInfo > &lpilist) |
CkLoop version of stateReady() More... | |
void | fillLists (State *state_, TreePiece *tp, int chunk, int start, int end, CkVec< OffsetNode > &clistforb, CkVec< RemotePartInfo > &rplistforb, CkVec< LocalPartInfo > &lplistforb) |
Populate CkLoop Data. More... | |
void | reassoc (void *cE, int activeRung, Opt *o) |
Reassociate the target node. | |
State * | getNewState (int d1, int d2) |
Version that allocates a DoubleWalkState. | |
State * | getNewState (int d1) |
Version that allocates a DoubleWalkState. | |
State * | getNewState () |
Version that allocates a DoubleWalkState. | |
void | freeState (State *state) |
Version that frees a DoubleWalkState. | |
void | freeDoubleWalkState (DoubleWalkState *state) |
Free up all the lists. | |
![]() | |
void | setOpt (Opt *opt) |
virtual void | init (void *cE, int activeRung, Opt *opt) |
Associate computeEntity (target bucket or node), activeRung and Optimization with this Compute object. | |
ComputeType | getSelfType () |
OptType | getOptType () |
int | getActiveRung () |
virtual void | startNodeProcessEvent (State *state) |
virtual void | finishNodeProcessEvent (TreePiece *owner, State *state) |
Allow book-keeping when finished with a node. | |
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. | |
virtual void | walkDone (State *state) |
virtual void | setComputeEntity (void *ce) |
virtual void * | getComputeEntity () |
Additional Inherited Members | |
![]() | |
int | nActive |
![]() | |
Compute (ComputeType t) | |
![]() | |
Opt * | opt |
void * | computeEntity |
int | activeRung |
ComputeType | type |
Computations for Stadel-style interaction list walk.
At a given point in the walk, this compares a node against another see if it 1) has to be opened, 2) doesn't need to be opened or 3) undecided, and manipulates the lists in State accordingly.
|
virtual |
Process a node.
node | is the global node being processed. |
state | contains the lists to be checked. |
chunk | chunk we are walking; used in case of a miss |
reqID | Encodes offset and bucket |
awi | Active walk index; used in case of a miss |
Implements Compute.
|
virtual |
Populate CkLoop Data.
This populates the local, remote lists. Once all the nodes and particles are identified with which force calculations need to be performed, this list is passed on to CkLoop function where it gets parallelized.
Reimplemented from Compute.
|
virtual |
Update state upon receiving a remote node.
Calls TreePiece::finishedChunk() if all outstanding requests are satisfied.
Reimplemented from Compute.
|
virtual |
Process received remote particles.
part | Array of particles received. |
num | Number of particles |
Update the state bookkeeping, add the particles to the interaction list and call stateReady() to compute their interactions. Call TreePiece::finishedChunk() if all outstanding requests are satisfied.
Reimplemented from Compute.
|
virtual |
Check for computation Computation can be done on buckets indexed from start to end.
state_ | State to be checked |
start | first bucket to apply computations |
end | last + 1 bucket to apply computations |
state->lowestNode is used to determine how deep the walk got. Cells and particles from that level and above are processed on these buckets.
Reimplemented from Compute.
|
virtual |
CkLoop version of stateReady()
This function is called in the ckloop so multiple threads are concurrently updating forces on its set of particles. Do not modify state variables of TreePiece without locking.
Reimplemented from Compute.