$search

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

parallel_ode::BatchStrategy::BatchStrategy ( int  maxBatches = ParallelOptions::MAXBATCHES  )  [inline]

Constructs on instance of the base strategy.

Parameters:
maxBatches The 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:
pairList The original list of body pairs from ODE, per constraint
numConstraints The number of constraints
numBodies The number of bodies
constraintIndices The final permuted ordering of the constraints
bodyRepetitionCount0 The repetition count for each body-constraint for the first index of pairList
bodyRepetitionCount1 The repetition count for each body-constraint for the second index of pairList
maxBodyRepetitionCountInBatch The maximum # times a body is repeated in each batch
batchIndices The indices of each batch into the global array of constraints
batchSizes The number of constraints per batch
Returns:

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

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:
batchSizes The size of each batch
batchIndices The computed indices for each batch
bAlign Whether to align the indices for each batch
alignment The 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.

int parallel_ode::BatchStrategy::getAlignment (  )  const [inline]

Definition at line 77 of file parallel_batch.h.

int parallel_ode::BatchStrategy::getMaxBatches (  )  const [inline]

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


parallel_quickstep
Author(s): Jared Duke
autogenerated on Fri Mar 1 16:28:18 2013