Gyselalib++
 
Loading...
Searching...
No Matches
MPITransposeAllToAll< Layout1, Layout2 > Class Template Reference

A class describing an operator for converting from/to different MPI layouts using AlltoAll. More...

Inheritance diagram for MPITransposeAllToAll< Layout1, Layout2 >:
IMPITranspose< Layout1, Layout2 >

Public Types

using idx_range_type1 = typename Layout1::discrete_domain_type
 The type of the index range of the first MPI layout.
 
using idx_range_type2 = typename Layout2::discrete_domain_type
 The type of the index range of the second MPI layout.
 
using distributed_idx_range_type1 = typename Layout1::distributed_sub_idx_range
 The type of the index range of the first MPI layout.
 
using distributed_idx_range_type2 = typename Layout2::distributed_sub_idx_range
 The type of the index range of the second MPI layout.
 
- Public Types inherited from IMPITranspose< Layout1, Layout2 >
using idx_range_type1 = typename Layout1::discrete_domain_type
 The type of the index range of the first MPI layout.
 
using idx_range_type2 = typename Layout2::discrete_domain_type
 The type of the index range of the second MPI layout.
 

Public Member Functions

template<class IdxRange >
 MPITransposeAllToAll (IdxRange global_idx_range, MPI_Comm comm)
 A constructor for the transpose operator.
 
template<class Layout >
auto get_local_idx_range ()
 Getter for the local index range.
 
template<class ElementType , class InIdxRange , class IdxRangeOut , class MemSpace , class ExecSpace >
void operator() (ExecSpace const &execution_space, Field< ElementType, IdxRangeOut, MemSpace > recv_field, ConstField< ElementType, InIdxRange, MemSpace > send_field)
 An operator which transposes from one layout to another.
 
template<class OutLayout , class ElementType , class MemSpace , class ExecSpace , class InIdxRange >
void transpose_to (ExecSpace const &execution_space, Field< ElementType, typename OutLayout::discrete_domain_type, MemSpace > recv_field, ConstField< ElementType, InIdxRange, MemSpace > send_field)
 An operator which transposes from one layout to another.
 
- Public Member Functions inherited from IMPITranspose< Layout1, Layout2 >
 IMPITranspose (MPI_Comm comm)
 A constructor for the class.
 

Additional Inherited Members

- Protected Attributes inherited from IMPITranspose< Layout1, Layout2 >
MPI_Comm m_comm
 The MPI communicator.
 

Detailed Description

template<class Layout1, class Layout2>
class MPITransposeAllToAll< Layout1, Layout2 >

A class describing an operator for converting from/to different MPI layouts using AlltoAll.

This class implements a basic AlltoAll operator and currently only works with a basic MPIBlockLayout.

Template Parameters
Layout1One of the MPI layouts.
Layout2The other MPI layouts.

Constructor & Destructor Documentation

◆ MPITransposeAllToAll()

template<class Layout1 , class Layout2 >
template<class IdxRange >
MPITransposeAllToAll< Layout1, Layout2 >::MPITransposeAllToAll ( IdxRange  global_idx_range,
MPI_Comm  comm 
)
inline

A constructor for the transpose operator.

Parameters
global_idx_rangeThe global index range of the data across processes provided in either layout.
commThe MPI communicator.

Member Function Documentation

◆ get_local_idx_range()

template<class Layout1 , class Layout2 >
template<class Layout >
auto MPITransposeAllToAll< Layout1, Layout2 >::get_local_idx_range ( )
inline

Getter for the local index range.

Template Parameters
LayoutThe layout whose index range should be retrieved.
Returns
The local index range in the specified MPI layout.

◆ operator()()

template<class Layout1 , class Layout2 >
template<class ElementType , class InIdxRange , class IdxRangeOut , class MemSpace , class ExecSpace >
void MPITransposeAllToAll< Layout1, Layout2 >::operator() ( ExecSpace const &  execution_space,
Field< ElementType, IdxRangeOut, MemSpace >  recv_field,
ConstField< ElementType, InIdxRange, MemSpace >  send_field 
)
inline

An operator which transposes from one layout to another.

If the dimensions are ordered differently in the index ranges of the two layouts then this function can be used. If the index ranges have the same type then the transpose_to function must be used to disambiguate.

Parameters
[in]execution_spaceThe execution space (Host/Device) where the code will run.
[out]recv_fieldThe chunk which will describe the data in the new layout. This data is gathered from the MPI processes.
[in]send_fieldThe chunk describing the data in the current layout. This data will be scattered to other MPI processes.

◆ transpose_to()

template<class Layout1 , class Layout2 >
template<class OutLayout , class ElementType , class MemSpace , class ExecSpace , class InIdxRange >
void MPITransposeAllToAll< Layout1, Layout2 >::transpose_to ( ExecSpace const &  execution_space,
Field< ElementType, typename OutLayout::discrete_domain_type, MemSpace >  recv_field,
ConstField< ElementType, InIdxRange, MemSpace >  send_field 
)
inline

An operator which transposes from one layout to another.

If the dimensions are ordered differently in the index ranges of the two layouts then this function can be used. If the index ranges have the same type then the transpose_to function must be used to disambiguate.

Template Parameters
OutLayoutThe layout that the data should be transposed to.
Parameters
[in]execution_spaceThe execution space (Host/Device) where the code will run.
[out]recv_fieldThe chunk which will describe the data in the new layout. This data is gathered from the MPI processes.
[in]send_fieldThe chunk describing the data in the current layout. This data will be scattered to other MPI processes.

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