changa  3.5
 All Classes Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Public Member Functions | List of all members
ListCompute Class Reference

Computations for Stadel-style interaction list walk. More...

#include <Compute.h>

Inheritance diagram for ListCompute:
Compute

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.
 
StategetNewState (int d1, int d2)
 Version that allocates a DoubleWalkState.
 
StategetNewState (int d1)
 Version that allocates a DoubleWalkState.
 
StategetNewState ()
 Version that allocates a DoubleWalkState.
 
void freeState (State *state)
 Version that frees a DoubleWalkState.
 
void freeDoubleWalkState (DoubleWalkState *state)
 Free up all the lists.
 
- Public Member Functions inherited from Compute
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

- Public Attributes inherited from Compute
int nActive
 
- Protected Member Functions inherited from Compute
 Compute (ComputeType t)
 
- Protected Attributes inherited from Compute
Optopt
 
void * computeEntity
 
int activeRung
 
ComputeType type
 

Detailed Description

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.

Member Function Documentation

int ListCompute::doWork ( GenericTreeNode node,
TreeWalk tw,
State state,
int  chunk,
int  reqID,
bool  isRoot,
bool &  didcomp,
int  awi 
)
virtual

Process a node.

Parameters
nodeis the global node being processed.
statecontains the lists to be checked.
chunkchunk we are walking; used in case of a miss
reqIDEncodes offset and bucket
awiActive walk index; used in case of a miss
Returns
KEEP if we descend further down the tree

Implements Compute.

void ListCompute::fillLists ( State state_,
TreePiece tp,
int  chunk,
int  start,
int  end,
CkVec< OffsetNode > &  clistforb,
CkVec< RemotePartInfo > &  rplistforb,
CkVec< LocalPartInfo > &  lplistforb 
)
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.

void ListCompute::nodeMissedEvent ( int  reqID,
int  chunk,
State state,
TreePiece tp 
)
virtual

Update state on a node miss.

Parameters
reqIDunused.

Reimplemented from Compute.

void ListCompute::nodeRecvdEvent ( TreePiece owner,
int  chunk,
State state,
int  reqIDlist 
)
virtual

Update state upon receiving a remote node.

Calls TreePiece::finishedChunk() if all outstanding requests are satisfied.

Reimplemented from Compute.

void ListCompute::recvdParticles ( ExternalGravityParticle part,
int  num,
int  chunk,
int  reqID,
State state_,
TreePiece tp,
Tree::NodeKey &  remoteBucket 
)
virtual

Process received remote particles.

Parameters
partArray of particles received.
numNumber 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.

void ListCompute::stateReady ( State state_,
TreePiece tp,
int  chunk,
int  start,
int  end 
)
virtual

Check for computation Computation can be done on buckets indexed from start to end.

Parameters
state_State to be checked
startfirst bucket to apply computations
endlast + 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.

void ListCompute::stateReadyPar ( TreePiece tp,
int  start,
int  end,
CkVec< OffsetNode > &  clist,
CkVec< RemotePartInfo > &  rpilist,
CkVec< LocalPartInfo > &  lpilist 
)
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.


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