Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes
parallel_ode::BatchStrategy Class Reference

#include <parallel_batch.h>

Inheritance diagram for parallel_ode::BatchStrategy:
Inheritance graph
[legend]

List of all members.

Public Types

typedef IntVector BatchVector

Public Member Functions

virtual int batch (const int *pairList, const int numConstraints, const int numBodies, BatchVector &constraintIndices, BatchVector &bodyRepetitionCount0, BatchVector &bodyRepetitionCount1, BatchVector &maxBodyRepetitionCountInBatch, BatchVector &batchIndices, BatchVector &batchSizes)
 Batches the constraints.
 BatchStrategy (int maxBatches=ParallelOptions::MAXBATCHES)
 Constructs on instance of the base strategy.
int getAlignment () const
int getMaxBatches () const
bool isAligning () const
void setAlign (bool bAlign)
void setAlignment (int alignment)
void setMaxBatches (int maxBatches)
virtual ~BatchStrategy ()
 Destroys the strategy instance.

Protected Member Functions

int baseBatch (const int *pairList, const BatchVector &constraintIndices, const BatchVector &batchSizes, BatchVector &batchIndices, BatchVector &bodyRepetitionCount0, BatchVector &bodyRepetitionCount1, BatchVector &maxBodyRepetitionCountInBatch)
 Computes batch indices and body repetition counts.
int batchRepetitionCount (const int *pairList, const BatchVector &constraintIndices, const BatchVector &batchIndices, BatchVector &bodyRepetitionCount0, BatchVector &bodyRepetitionCount1, BatchVector &maxBodyRepetitionCountInBatch)
 Computes the body repetition counts.

Static Protected Member Functions

static void batchIndicesFromBatchSizes (const BatchVector &batchSizes, BatchVector &batchIndices, bool bAlign, int alignment)
 Computes batch indices given batch sizes.

Private Attributes

int alignment_
bool bAlign_
int maxBatches_

Detailed Description

Base class for all batch strategy implementations. Defaults to random batch assignment.

Definition at line 25 of file parallel_batch.h.


Member Typedef Documentation

Definition at line 29 of file parallel_batch.h.


Constructor & Destructor Documentation

Constructs on instance of the base strategy.

Parameters:
maxBatchesThe maximum number of batches to be supported

Definition at line 36 of file parallel_batch.h.

virtual parallel_ode::BatchStrategy::~BatchStrategy ( ) [inline, virtual]

Destroys the strategy instance.

Definition at line 46 of file parallel_batch.h.


Member Function Documentation

int parallel_ode::BatchStrategy::baseBatch ( const int *  pairList,
const BatchVector constraintIndices,
const BatchVector batchSizes,
BatchVector batchIndices,
BatchVector bodyRepetitionCount0,
BatchVector bodyRepetitionCount1,
BatchVector maxBodyRepetitionCountInBatch 
) [protected]

Computes batch indices and body repetition counts.

Returns:
The maximum number of times a body is repeated over all batches

Definition at line 17 of file parallel_batch.cpp.

int parallel_ode::BatchStrategy::batch ( const int *  pairList,
const int  numConstraints,
const int  numBodies,
BatchVector constraintIndices,
BatchVector bodyRepetitionCount0,
BatchVector bodyRepetitionCount1,
BatchVector maxBodyRepetitionCountInBatch,
BatchVector batchIndices,
BatchVector batchSizes 
) [virtual]

Batches the constraints.

Parameters:
pairListThe original list of body pairs from ODE, per constraint
numConstraintsThe number of constraints
numBodiesThe number of bodies
constraintIndicesThe final permuted ordering of the constraints
bodyRepetitionCount0The repetition count for each body-constraint for the first index of pairList
bodyRepetitionCount1The repetition count for each body-constraint for the second index of pairList
maxBodyRepetitionCountInBatchThe maximum # times a body is repeated in each batch
batchIndicesThe indices of each batch into the global array of constraints
batchSizesThe number of constraints per batch
Returns:

Reimplemented in parallel_ode::ColoringBatchStrategy, and parallel_ode::GreedyBatchStrategy.

Definition at line 81 of file parallel_batch.cpp.

void parallel_ode::BatchStrategy::batchIndicesFromBatchSizes ( const BatchVector batchSizes,
BatchVector batchIndices,
bool  bAlign,
int  alignment 
) [static, protected]

Computes batch indices given batch sizes.

Parameters:
batchSizesThe size of each batch
batchIndicesThe computed indices for each batch
bAlignWhether to align the indices for each batch
alignmentThe alignment width if align is enabled

Definition at line 30 of file parallel_batch.cpp.

int parallel_ode::BatchStrategy::batchRepetitionCount ( const int *  pairList,
const BatchVector constraintIndices,
const BatchVector batchIndices,
BatchVector bodyRepetitionCount0,
BatchVector bodyRepetitionCount1,
BatchVector maxBodyRepetitionCountInBatch 
) [protected]

Computes the body repetition counts.

Returns:
The maximum number of times a body is repeated over all batches

Definition at line 42 of file parallel_batch.cpp.

Definition at line 77 of file parallel_batch.h.

Definition at line 71 of file parallel_batch.h.

bool parallel_ode::BatchStrategy::isAligning ( ) const [inline]

Definition at line 74 of file parallel_batch.h.

void parallel_ode::BatchStrategy::setAlign ( bool  bAlign) [inline]

Definition at line 75 of file parallel_batch.h.

void parallel_ode::BatchStrategy::setAlignment ( int  alignment) [inline]

Definition at line 78 of file parallel_batch.h.

void parallel_ode::BatchStrategy::setMaxBatches ( int  maxBatches) [inline]

Definition at line 72 of file parallel_batch.h.


Member Data Documentation

The alignment width for batch index alignment

Definition at line 121 of file parallel_batch.h.

Whether to align the batch indices

Definition at line 120 of file parallel_batch.h.

The maximum number of batches

Definition at line 119 of file parallel_batch.h.


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


parallel_quickstep
Author(s): Jared Duke
autogenerated on Fri Jan 3 2014 11:36:56