a Cartesian mpi class More...
#include <gsmpicart.hpp>


Public Member Functions | |
| GSMPICart () | |
| Construct a new GSMPICart. More... | |
| GSMPICart (const std::vector< int > nproc, const std::vector< int > isperiod={1}) | |
| Construct a new GSMPICart. More... | |
| ~GSMPICart () | |
| void | InitMPI (const std::vector< int > nproc, const std::vector< int > isperiod={1}) |
| int | RankFromCoords (const int ri, const int rj, const int rk) |
| Get rank from Coordinates. More... | |
| int | RankFromCoords (const int ri, const int rj) |
| Get rank from Coordinates. More... | |
| int | RankFromCoords (const int ri) |
| Get rank from Coordinates. More... | |
| int & | RefNbrs (const int i, const int j, const int k) |
| reference the Neigbhors via coords More... | |
| int & | RefNbrs (const int i, const int j) |
| reference the Neigbhors via coords More... | |
| int & | RefNbrs (const int i) |
| reference the Neigbhors via coords More... | |
| int | GetNbrs (const int i, const int j, const int k) |
| Get the Neigbhors via coords. More... | |
| int | GetNbrs (const int i, const int j) |
| Get the Neigbhors via coords. More... | |
| int | GetNbrs (const int i) |
| Get the Neigbhors via coords. More... | |
| void | InitCoord0 () |
| initialize coord0, the index is from 0 More... | |
| void | InitCoord1 () |
| initialize coord1 More... | |
| void | InitCoord2 () |
| initialize coord2 More... | |
| void | InitCoords () |
| initialize coordinates More... | |
| int | GetCoord (const int i) |
| Get the coordination for the i'th direction. More... | |
| std::vector< int > | GetCoord () |
| int | GetProc (const int i) |
| std::vector< int > | GetProc () |
| int | GetIsPeriod (const int i) |
| std::vector< int > | GetIsPeriod () |
| int | GetValidNbrsOrder (const int i) |
| void | InitNbrs () |
| initialize neigbhors More... | |
| void | vInitNbrs1D () |
| initialize neigbhors for 1-D case More... | |
| void | vInitNbrs2D () |
| initialize neigbhors for 2-D case More... | |
| void | vInitNbrs3D () |
| initialize neigbhors for 3-D case More... | |
| void | PrintNbrs () |
| print neigbhors infomations More... | |
| void | GenerateGraph () |
| generate a cartesian graph communication More... | |
| void | InitGraph () |
| initialize the graph More... | |
| std::vector< int > & | InitValidNbrsOrder () |
| Get the Valid Neigbhors Order. More... | |
| std::vector< int > | GetNbrsOrderFromGraph () |
| Get the Valid Neigbhors by mpi communication. More... | |
| void | CheckGraphComm () |
| the graph communications More... | |
Public Member Functions inherited from gsmpi::GSMPI | |
| GSMPI () | |
| Construct a new KLMPI object. More... | |
| void | Init () |
| Initialize keli mpi. More... | |
| int | GetRank () |
| Get the Rank. More... | |
| int | GetRank () const |
| int | GetNumofProc () |
| Get the Number of Procs. More... | |
| int | GetNumofProc () const |
| int | GetNumofNbrs () |
| Get the Number of Neigbhors. More... | |
| int | GetNumofNbrs () const |
| const int * | PtrNbrsList () |
| const int * | PtrNbrsList () const |
| int | GetNumofNbrsExcludeNullAndSelfProc () |
| Get the Number of Neigbhors Without Nullproc And Self. More... | |
| int | GetNumofNbrsExcludeNullAndSelfProc () const |
| MPI_Comm | GetComm () const |
| Get the Communicator. More... | |
| MPI_Comm | GetComm () |
| void | SendRecv (auto &send, auto &recv, MPI_Datatype datatype) |
| Send and Receive data by a graph communication. More... | |
| void | AllGather (auto &send, auto &recv, MPI_Datatype datatype) |
| void | SendRecv_v1 (SerializedBuffer &send, SerializedBuffer &recv, MPI_Datatype datatype) |
| void | Barrier () |
| MPI_Barrier() More... | |
| void | Bcast (auto &in, MPI_Datatype datatype) |
| void | Bcast (auto &in, int count, MPI_Datatype datatype) |
| void | Bcast (auto *in, int count, MPI_Datatype datatype) |
| void | Reduce (auto &send, auto &recv, MPI_Datatype datatype, MPI_Op op) |
| void | Reduce (auto &send, auto &recv, int count, MPI_Datatype datatype, MPI_Op op) |
| void | Reduce (auto *send, auto *recv, int count, MPI_Datatype datatype, MPI_Op op) |
| void | AllReduce (auto &send, auto &recv, MPI_Datatype datatype, MPI_Op op) |
| void | AllReduce (auto &send, auto &recv, int count, MPI_Datatype datatype, MPI_Op op) |
| void | AllReduce (auto *send, auto *recv, int count, MPI_Datatype datatype, MPI_Op op) |
Static Public Member Functions | |
| static int | CoordMod (int rk, int np) |
| Get Coordinate remiander. More... | |
Private Attributes | |
| int | _nproc [N_dim] |
| int | _isperiod [N_dim] |
| int | _coord [N_dim] |
| const int | _ndim = N_dim |
| const int | ColMaj = IsColMaj |
Additional Inherited Members | |
Protected Attributes inherited from gsmpi::GSMPI | |
| MPI_Comm | _comm |
| int | _nprocall |
| int | _rank |
| int * | _nbrs = nullptr |
| int | _num_nbrs |
| int | _num_nbrs_exclude_null_selfproc |
| int * | _graph_index = nullptr |
| int * | _graph_edge = nullptr |
| std::vector< int > | _valid_nbrs_order |
a Cartesian mpi class
| N_dim | |
| IsColMaj |
|
inline |
Construct a new GSMPICart.
| gsmpi::GSMPICart< N_dim, IsColMaj >::GSMPICart | ( | const std::vector< int > | nproc, |
| const std::vector< int > | isperiod = {1} |
||
| ) |
Construct a new GSMPICart.
| nproc | total number of procs |
| isperiod | flag of periodica vitrual topology |
| gsmpi::GSMPICart< N_dim, IsColMaj >::~GSMPICart |
| void gsmpi::GSMPICart< N_dim, IsColMaj >::CheckGraphComm |
the graph communications
References gsmpi::root.
|
inlinestatic |
Get Coordinate remiander.
| rk | coordinate rank |
| np | the number of procs in one direction |
| void gsmpi::GSMPICart< N_dim, IsColMaj >::GenerateGraph |
generate a cartesian graph communication
References gsmpi::root.
|
inline |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_coord.
|
inline |
Get the coordination for the i'th direction.
| i |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_coord.

|
inline |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_isperiod.
|
inline |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_isperiod.
|
inline |
|
inline |
|
inline |
Get the Neigbhors via coords.
| i | coord0 |
| j | coord1 |
| k | coord2 |
References gsmpi::GSMPI::_nbrs.
| std::vector< int > gsmpi::GSMPICart< N_dim, IsColMaj >::GetNbrsOrderFromGraph |
Get the Valid Neigbhors by mpi communication.
|
inline |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_nproc.
|
inline |
|
inline |
References gsmpi::GSMPI::_valid_nbrs_order.
|
inline |
initialize coord0, the index is from 0
References gsmpi::GSMPICart< N_dim, IsColMaj >::_coord, gsmpi::GSMPICart< N_dim, IsColMaj >::_nproc, and gsmpi::GSMPI::_rank.

|
inline |
initialize coord1
References gsmpi::GSMPICart< N_dim, IsColMaj >::_coord, gsmpi::GSMPICart< N_dim, IsColMaj >::_nproc, and gsmpi::GSMPI::_rank.

|
inline |
initialize coord2
References gsmpi::GSMPICart< N_dim, IsColMaj >::_coord, gsmpi::GSMPICart< N_dim, IsColMaj >::_nproc, and gsmpi::GSMPI::_rank.

|
inline |
initialize coordinates
References gsmpi::GSMPICart< N_dim, IsColMaj >::InitCoord0(), gsmpi::GSMPICart< N_dim, IsColMaj >::InitCoord1(), and gsmpi::GSMPICart< N_dim, IsColMaj >::InitCoord2().

| void gsmpi::GSMPICart< N_dim, IsColMaj >::InitGraph |
initialize the graph
| void gsmpi::GSMPICart< N_dim, IsColMaj >::InitMPI | ( | const std::vector< int > | nproc, |
| const std::vector< int > | isperiod = {1} |
||
| ) |
| void gsmpi::GSMPICart< N_dim, IsColMaj >::InitNbrs |
initialize neigbhors
| std::vector< int > & gsmpi::GSMPICart< N_dim, IsColMaj >::InitValidNbrsOrder |
Get the Valid Neigbhors Order.
| void gsmpi::GSMPICart< N_dim, IsColMaj >::PrintNbrs |
print neigbhors infomations
|
inline |
Get rank from Coordinates.
| ri | coord0 |
|
inline |
Get rank from Coordinates.
| ri | coord0 |
| rj | coord1 |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_nproc.
|
inline |
Get rank from Coordinates.
| ri | coord0 |
| rj | coord1 |
| rk | coord2 |
References gsmpi::GSMPICart< N_dim, IsColMaj >::_nproc.
|
inline |
|
inline |
reference the Neigbhors via coords
| i | coord0 |
| j | coord1 |
References gsmpi::GSMPI::_nbrs.
|
inline |
reference the Neigbhors via coords
| i | coord0 |
| j | coord1 |
| k | coord2 |
References gsmpi::GSMPI::_nbrs.

| void gsmpi::GSMPICart< N_dim, IsColMaj >::vInitNbrs1D |
initialize neigbhors for 1-D case
| void gsmpi::GSMPICart< N_dim, IsColMaj >::vInitNbrs2D |
initialize neigbhors for 2-D case
| void gsmpi::GSMPICart< N_dim, IsColMaj >::vInitNbrs3D |
initialize neigbhors for 3-D case
|
private |
|
private |
|
private |
|
private |
|
private |