Public Member Functions | Static Public Member Functions | Private Attributes

twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX > Class Template Reference

implements an m-way jagged partitioning heuristic using the first dimension as the main dimension. More...

#include <twod/m_way_jag_2d.hpp>

Inheritance diagram for twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >:
twod::PartBase< T, Pr >

Detailed Description

template<typename T, typename Pr, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, false> >::nicol_plus, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, true> >::nicol_plus>
class twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >

implements an m-way jagged partitioning heuristic using the first dimension as the main dimension.

The heuristic partitions the first dimension in a number of stripes given by setP() using onedalgoX (default: oned::NicolPlus). Then it distributes the processors to the stripes proportionnally to their load. Finally, each stripe is partitioned using onedalgoY (default oned::NicolPlus).

Parameters:
T data type of instance matrix
Pr data type of 2D matrix
onedalgoY 1d partitioning algorithm to be used to fix columns. If unspecified, uses oned::NicolPlus
onedalgoX 1d partitioning algorithm to be used to fix rows. If unspecified, uses oned::NicolPlus

List of all members.

Public Member Functions

 JagMHeurHor ()
void setP (int P)
 selects the number of stripes in the main dimension.
virtual T part (int procCount, const Pr &prefixSumArray, util::RectList< T, Pr > &parts)
 Applies m-way jagged partitioning to a given 2d prefixSumArray.
virtual ~JagMHeurHor ()

Static Public Member Functions

static T m_way_jag_2d_internal (int procX, int m, const Pr &prefixSumArray, util::RectList< T, Pr > &parts)
 actual implementation of the algorithm.

Private Attributes

int P

Constructor & Destructor Documentation

template<typename T, typename Pr, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, false> >::nicol_plus, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, true> >::nicol_plus>
twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >::JagMHeurHor (  )  [inline]
template<typename T, typename Pr, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, false> >::nicol_plus, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, true> >::nicol_plus>
virtual twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >::~JagMHeurHor (  )  [inline, virtual]

Member Function Documentation

template<typename T , typename Pr , T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX>
T twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >::m_way_jag_2d_internal ( int  procX,
int  m,
const Pr prefixSumArray,
util::RectList< T, Pr > &  parts 
) [static]

actual implementation of the algorithm.

Parameters:
procX number of stripes
m total number of processors
template<typename T , typename Pr , T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX>
T twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >::part ( int  procCount,
const Pr prefixSumArray,
util::RectList< T, Pr > &  parts 
) [virtual]

Applies m-way jagged partitioning to a given 2d prefixSumArray.

Parameters:
[in] procCount is the number of processors
[in] prefixSumArray first column and first row consists of zero only. But the borders of rectangles in rect_list never touch this area (index 0 in row or column)
[out] parts must be allocated before calling this function
Returns:
The load of maximum loaded processor.

Implements twod::PartBase< T, Pr >.

template<typename T, typename Pr, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, false> >::nicol_plus, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, true> >::nicol_plus>
void twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >::setP ( int  P  )  [inline]

selects the number of stripes in the main dimension.

Parameters:
P number of stripes in the main dimension. If 0, the number of stripes will be computed at runtime by taking the square root of the number of processors. If -1, the number of stripes is ceil(sqrt(m*prefixsizeX/prefixsizeY)). -1 is the default.

Member Data Documentation

template<typename T, typename Pr, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, false > &prefixSumArray, int length, int *cutIndexes, T) onedalgoY = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, false> >::nicol_plus, T(*)(int procCount, const util::Aggreg2Dto1D< T, Pr, true > &prefixSumArray, int length, int *cutIndexes, T) onedalgoX = oned::NicolPlus<T, util::Aggreg2Dto1D<T, Pr, true> >::nicol_plus>
int twod::JagMHeurHor< T, Pr, onedalgoY, onedalgoX >::P [private]

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