Public Member Functions | Static Private Member Functions | Private Attributes

twod::RectNicol< T, Pr, DEBUG > Class Template Reference

Implements the rectilinear partitioning algorithm with iterative refinement described in "David Nicol, Rectilinear Partitioning of Irregular Data Parallel Computations, JPDC, 1994". More...

#include <twod/nicol_2d.hpp>

Inheritance diagram for twod::RectNicol< T, Pr, DEBUG >:
twod::PartBase< T, Pr >

Detailed Description

template<typename T, typename Pr, bool DEBUG = false>
class twod::RectNicol< T, Pr, DEBUG >

Implements the rectilinear partitioning algorithm with iterative refinement described in "David Nicol, Rectilinear Partitioning of Irregular Data Parallel Computations, JPDC, 1994".

The number of processors in each dimension can be controlled by setP().

Parameters:
T type of element of the array
Pr type of the prefix sum array

List of all members.

Public Member Functions

 RectNicol ()
void setP (int P)
 selects the number of stripes in the first dimension
virtual T part (int procCount, const Pr &prefixSumArray, util::RectList< T, Pr > &parts)
 Implements the rectilinear partitioning algorithm with iterative refinement described in "David Nicol, Rectilinear Partitioning of Irregular Data Parallel Computations, JPDC, 1994".
virtual ~RectNicol ()

Static Private Member Functions

static T nicol_2d_internal (int procX, int procY, const Pr &prefixSumArray, util::RectList< T, Pr > &parts)
static T fix_x_dimension (util::AggregMax2Dto1D< T, Pr, true > &array, int length, int procX, int *x_cuts)
static T fix_y_dimension (util::AggregMax2Dto1D< T, Pr, false > &array, int length, int procY, int *y_cuts)
static void convertToRectList (int lengthX, int lengthY, int *x_cuts, int *y_cuts, int procX, int procY, util::RectList< T, Pr > &parts)
 TODO: that function should be in utils ?

Private Attributes

int P

Constructor & Destructor Documentation

template<typename T , typename Pr , bool DEBUG = false>
twod::RectNicol< T, Pr, DEBUG >::RectNicol (  )  [inline]
template<typename T , typename Pr , bool DEBUG = false>
virtual twod::RectNicol< T, Pr, DEBUG >::~RectNicol (  )  [inline, virtual]

Member Function Documentation

template<typename T , typename Pr , bool DEBUG>
void twod::RectNicol< T, Pr, DEBUG >::convertToRectList ( int  lengthX,
int  lengthY,
int *  x_cuts,
int *  y_cuts,
int  procX,
int  procY,
util::RectList< T, Pr > &  parts 
) [static, private]

TODO: that function should be in utils ?

add the last rectangle

add the last rectangles

template<typename T , typename Pr , bool DEBUG>
T twod::RectNicol< T, Pr, DEBUG >::fix_x_dimension ( util::AggregMax2Dto1D< T, Pr, true > &  array,
int  length,
int  procX,
int *  x_cuts 
) [static, private]
template<typename T , typename Pr , bool DEBUG>
T twod::RectNicol< T, Pr, DEBUG >::fix_y_dimension ( util::AggregMax2Dto1D< T, Pr, false > &  array,
int  length,
int  procY,
int *  y_cuts 
) [static, private]
template<typename T , typename Pr , bool DEBUG>
T twod::RectNicol< T, Pr, DEBUG >::nicol_2d_internal ( int  procX,
int  procY,
const Pr prefixSumArray,
util::RectList< T, Pr > &  parts 
) [static, private]
template<typename T , typename Pr , bool DEBUG>
T twod::RectNicol< T, Pr, DEBUG >::part ( int  procCount,
const Pr prefixSumArray,
util::RectList< T, Pr > &  parts 
) [virtual]

Implements the rectilinear partitioning algorithm with iterative refinement described in "David Nicol, Rectilinear Partitioning of Irregular Data Parallel Computations, JPDC, 1994".

Parameters:
[in] procCount number of processors.
[in] prefixSumArray input martix's prefix sum array.
[out] parts rectangle list of partition results.
Returns:
Maximum loaded processor's load.

Implements twod::PartBase< T, Pr >.

template<typename T , typename Pr , bool DEBUG = false>
void twod::RectNicol< T, Pr, DEBUG >::setP ( int  P  )  [inline]

selects the number of stripes in the first dimension

Parameters:
P number of stripes in the first dimension. If 0, the number of stripes will be computed at runtime by taking the square root of the number of processors.

Member Data Documentation

template<typename T , typename Pr , bool DEBUG = false>
int twod::RectNicol< T, Pr, DEBUG >::P [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines