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

Domain decomposition of particles via a parallel sort. More...

#include <Sorter.h>

Inheritance diagram for Sorter:

Public Member Functions

 Sorter (CkMigrateMessage *m)
 
void startSorting (const CkGroupID &dataManagerID, const double toler, const CkCallback &cb, bool decompose)
 Overall start of domain decomposition. More...
 
void convertNodesToSplitters ()
 
SFC::Key * convertNodesToSplittersRefine (int num, NodeKey *keys)
 
void collectEvaluations (CkReductionMsg *m)
 Collect the counts of particles in each domain.
 
void collectEvaluationsSFC (CkReductionMsg *m)
 Collect evaluations for the SFC domain decomposion. More...
 
void collectEvaluationsOct (CkReductionMsg *m)
 
void doORBDecomposition (CkReductionMsg *m)
 Start ORB decomposition. More...
 
void finishPhase (CkReductionMsg *m)
 
void collectORBCounts (CkReductionMsg *m)
 Collect particle counts from treepieces and send out new splits. More...
 
void readytoSendORB (CkReductionMsg *m)
 

Detailed Description

Domain decomposition of particles via a parallel sort.

Domain decomposition is handled differently depending on the type of decomposition requested. SFC (either Morton ordering or Peano-Hibert) or Oct (where domains are complete nodes within the tree) is described first.

In the SFC and Oct case, the Sorter controls a parallel sorting of particles based on their keys. The goal is to split the particles up into n pieces of roughly equal sizes.

The Sorter generates a list of possible splitter keys, and broadcasts this list to the TreePieces. The TreePieces evaluate the list, determining how many particles they have between each splitter key. These bin counts are then reduced back to the Sorter::collectEvaluations, which uses the information to create a new list. When the last iteration of splitter keys is deemed satisfactory, counts for the final keys are evaluated, and the keys and counts are broadcast to DataManager::acceptFinalKeys(), which coordinates the shuffling of the particles to the correct owners.

Member Function Documentation

void Sorter::collectEvaluationsOct ( CkReductionMsg *  m)

Examine the counts for Oct decomposition and determine if further refining is needed. Call TreePiece::evaluateBoundaries if needed, else send the final keys to DataManager::acceptFinalKeys. Sorter::refineOctSplitting perfoms splits where needed.

void Sorter::collectEvaluationsSFC ( CkReductionMsg *  m)

Collect evaluations for the SFC domain decomposion.

Examines the bin counts to see if the iteration has converged. If yes, a final count is done and then sent to DataManager::acceptFinalKeys. If not, then Sorter::adjustSplitters is used to refine the search intervals.

void Sorter::collectORBCounts ( CkReductionMsg *  m)

Collect particle counts from treepieces and send out new splits.

Parameters
mA message with the summed counts for the current ORB splits.

If the counts are within the tolerances, call TreePiece::finalizeBoundaries().

void Sorter::convertNodesToSplitters ( )

Given "numKeys" node keys ("nodeKeys"), convert these keys into splitters.

Key * Sorter::convertNodesToSplittersRefine ( int  num,
NodeKey *  keys 
)

Given "num" node keys, create splitters for these selected nodekeys to refine the information within those nodes: each node in keys is divided a number of times that depends on "refineLevel". Returns a newly allocated Key array containing a concatenation of the splitter keys for each node to be refined for the histogramming phase.

void Sorter::doORBDecomposition ( CkReductionMsg *  m)

Start ORB decomposition.

Parameters
mmessage with bounding box of the simulation

Begins the ORB decomposition by calculating the initial split and broadcasting to TreePiece::evaluateParticleCounts(). Particle counts will be contributed to Sorter::collectORBCounts().

void Sorter::finishPhase ( CkReductionMsg *  m)

Calculate candidate divisions for next level in the ORB decomposition tree. If we have enough pieces, proceed to sending particles.

void Sorter::startSorting ( const CkGroupID &  dataManagerID,
const double  toler,
const CkCallback &  cb,
bool  decompose 
)

Overall start of domain decomposition.

Sort the particles in an array of TreePieces using a histogram-probing method. The the Sorter sends splitters to the TreePieces for them to evaluate. The evaluation results in a histogram back to the Sorter, which uses the information to generate new guesses for the splitter keys. When all the splitter keys have been found (within the percent tolerance per chare) the TreePieces move the data around to the proper sorted location. The boundary keys are shared between adjacent TreePieces, as these will be needed in the tree building phase. The callback will receive a CkReductionMsg containing no data.

Parameters
dataManagerIDID of data manager group
tolerTolerance within which to have the same number of particles
cbCallback for when we are done.
decomposeAre we still deciding on decomposition?

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