Paraper
Public Types | Public Member Functions | Private Attributes
Paraper< INT > Class Template Reference

List of all members.

Public Types

enum  Phase_1_type { PHASE_1_SINGLE, PHASE_1_BULK }
 Type of distribution of the elements in Phase 1. More...
typedef INT value_type
 Integer data type for permutation elements. Matches template parameter INT.
typedef std::vector< INT > vector_type
 Standard library vector type with elemetns of type value_type.

Public Member Functions

 Paraper ()
 Default constructor.
 ~Paraper ()
 Default destructor.
void set_communicator (MPI_Comm comm)
 Set MPI communicator.
void free_communicator ()
 Free internal MPI communicators. This function is also called within the destructor.
void generate (INT size, Phase_1_type p1t=PAHSE_1_BULK)
 Parallelly generates random permutation.
const vector_typeelements () const
 Get local array with generated permutation elements.
INT first () const
 Return position of the first local element in the global permutation array.
INT count () const
 Return number of local permutation elements.

Private Attributes

Paraper_impl< INT > impl_

template<typename INT = uintmax_t>
class Paraper< INT >


Member Enumeration Documentation

Type of distribution of the elements in Phase 1.

Enumerator:
PHASE_1_SINGLE 

Elements are distributed one-by-one to random destination processors.

PHASE_1_BULK 

Elements are first stored in an auxiliary array together with random destination processor numbers. This array is then sorted according to the processor numbers. Finally, all elements targeting the same processor are sent at once. This process is split into two subphases due to memory requirements. See [1] for more details.


Member Function Documentation

void set_communicator ( MPI_Comm  comm)

Set MPI communicator.

Parameters:
[in]commvalid MPI communicator

Internally, the comm communicator is duplicated, no MPI operations are performed using comm directly.

Must be called collectively within all MPI processes that belongs to comm!

Free internal MPI communicators. This function is also called within the destructor.

Must be called collectively within all MPI processes that belongs to the original outer communicator (see set_communicator() function)!

Must be called prior to the execution of the MPI_Finalize() function!

void generate ( INT  size,
Phase_1_type  p1t = PAHSE_1_BULK 
)

Parallelly generates random permutation.

Parameters:
[in]sizenumber of elements of the permutation
[in]p1ttype of Phase 1 (see Phase_1_type for more details)

Generation of the random permutation of a set of integer numbers from 0 to (size - 1). After generation, these elements are available via elements() member function.

Must be called collectively within all MPI processes that belongs to the original outer communicator (see set_communicator() function)!

const vector_type& elements ( ) const

Get local array with generated permutation elements.

Returns:
vector of type vector_type with local generated permutation elements

The position of the first local element in the global permutation array is provided by the first() member function. The number of local elements is provided by the count() member function.

INT first ( ) const

Return position of the first local element in the global permutation array.

Returns:
position of the first local element in the global permutation array
INT count ( ) const

Return number of local permutation elements.

Returns:
the number of local permutation elements

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Typedefs Enumerations Enumerator