![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Classes | |
| class | MpiHandle |
Functions | |
| template<typename T> | |
| MPI_Datatype | getMpiType () |
| Map a C++ arithmetic type to its corresponding MPI_Datatype. | |
| static bool | isInitialized () |
| Return true if MPI has been initialized. | |
| static bool | isPetscInitialized () |
| Return true if PETSc has been initialized. | |
| static bool | isFinalized () |
| Return true if MPI has been finalized. | |
| static bool | isPetscFinalized () |
| Return true if PETSc has been finalized. | |
| static int | rank () |
| Return the MPI rank in MPI_COMM_WORLD. | |
| static int | size () |
| Return the size of MPI_COMM_WORLD. | |
| static bool | root () |
| Return true if the rank in MPI_COMM_WORLD is zero. | |
| template<typename T> | |
| void | send (const T *data, int count, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send count contiguous values of type T to a destination rank. | |
| template<typename T> | |
| void | send (const T &data, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send a single value of type T to a destination rank. | |
| template<typename T> | |
| void | send (const std::vector< T > &data, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send a std::vector<T>, prefixed with its size. | |
| void | send (const std::string &data, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send a std::string, prefixed with its size. | |
| template<typename T, std::size_t N> | |
| void | send (const std::vector< std::array< T, N > > &data, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send a std::vector<std::array<T, N>>, prefixed with its size. | |
| template<typename T, int N, int M, int Options> | |
| void | send (const std::vector< Eigen::Matrix< T, N, M, Options > > &data, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send a std::vector of fixed-size Eigen matrices, prefixed with its size. | |
| template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)> | |
| void | send (const datastructure::CrsMap< DataType, IndexType, RowSize > &map, int destination, MPI_Comm communicator=MPI_COMM_WORLD) |
| Send a CrsMap by sending its data and indices in sequence. | |
| template<typename T> | |
| void | recv (T *data, int count, int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive count contiguous values of type T from a source rank. | |
| template<typename T> | |
| T | recv (int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive a single value of type T from a source rank. | |
| template<typename T> | |
| void | recv (std::vector< T > &data, int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive a std::vector<T> previously sent with send(), resizing data to the transmitted size. | |
| void | recv (std::string &data, int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive a std::string previously sent with send(), resizing data to the transmitted size. | |
| template<typename T, std::size_t N> | |
| void | recv (std::vector< std::array< T, N > > &data, int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive a std::vector<std::array<T, N>> previously sent with send(), resizing data to the transmitted size. | |
| template<typename T, int N, int M, int Options> | |
| void | recv (std::vector< Eigen::Matrix< T, N, M, Options > > &data, int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive a std::vector of fixed-size Eigen matrices previously sent with send(), resizing data to the transmitted size. | |
| template<typename DataType, typename IndexType, IndexType RowSize = IndexType(-1)> | |
| void | recv (datastructure::CrsMap< DataType, IndexType, RowSize > &map, int source, MPI_Comm communicator=MPI_COMM_WORLD, MPI_Status *status=MPI_STATUS_IGNORE) |
| Receive a CrsMap by receiving its data and indices in sequence. | |
| template<typename T> | |
| void | bcast (T *data, int count, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Broadcast count contiguous values of type T from root. | |
| template<typename T> | |
| void | bcast (T &data, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Broadcast a single value of type T from root. | |
| template<typename T> | |
| void | bcast (std::vector< T > &data, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Broadcast a std::vector<T> from root, resizing data on the other ranks to match the root's size. | |
| void | bcast (std::string &data, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Broadcast a std::string from root, resizing data on the other ranks to match the root's size. | |
| template<typename T, int N, int M, int Options> | |
| void | bcast (Eigen::Matrix< T, N, M, Options > &data, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Broadcast a dynamically-sized Eigen matrix from root, resizing data on the other ranks to match the root's shape. | |
| template<typename T> | |
| void | reduce (const T *send_data, T *recv_data, int count, MPI_Op op, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Reduce count contiguous values of type T onto root. | |
| template<typename T> | |
| T | reduce (const T &send_data, MPI_Op op, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Reduce a single value of type T onto root. | |
| auto | computeChuncks (int32_t count, int32_t stride=1) |
| Split count elements into near-equal contiguous chunks, one per rank in the current communicator. | |
| template<typename T> | |
| void | gather (const T *send_data, int send_count, T *recv_data, int recv_count, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Gather send_count contiguous values of type T from every rank into recv_data on root. | |
| template<typename T> | |
| void | gather (const std::vector< T > &send_data, std::vector< T > &recv_data, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Gather a std::vector<T> of equal size from every rank into recv_data on root. | |
| template<typename T> | |
| void | gatherv (const T *send_data, int send_count, T *recv_data, int *recv_count, int *displs, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Gather variable-length contiguous values of type T from every rank into recv_data on root. | |
| template<typename T> | |
| void | scatter (const T *send_data, int send_count, T *recv_data, int recv_count, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Scatter recv_count contiguous values of type T from root to every rank. | |
| template<typename T> | |
| void | scatter (const std::vector< T > &send_data, std::vector< T > &recv_data, int root, MPI_Comm communicator=MPI_COMM_WORLD) |
| Scatter a std::vector<T> from root into equal-size chunks on every rank. | |
| template<typename T> | |
| void | scatterv (const T *send_data, int *send_counts, int *displacements, T *recv_data, int recv_count, int root, MPI_Comm mpi_comm=MPI_COMM_WORLD, MPI_Datatype send_t=getMpiType< T >(), MPI_Datatype recv_t=getMpiType< T >()) |
| Scatter variable-length contiguous values of type T from root to every rank. | |
Variables | |
| static constexpr int | s_default_tag = 0 |
| Default MPI message tag used by all wrappers in this file. | |
| void vulpes::mpi::bcast | ( | Eigen::Matrix< T, N, M, Options > & | data, |
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Broadcast a dynamically-sized Eigen matrix from root, resizing data on the other ranks to match the root's shape.
| T | Scalar type of the matrix (must be supported by getMpiType). |
| N | Compile-time number of rows. |
| M | Compile-time number of columns. |
| Options | Eigen storage options. |
| data | Matrix to broadcast from (root) / resize and fill (other ranks). |
| root | Rank broadcasting the data. |
| communicator | MPI communicator to use. |
|
inline |
Broadcast a std::string from root, resizing data on the other ranks to match the root's size.
| data | String to broadcast from (root) / resize and fill (other ranks). |
| root | Rank broadcasting the data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::bcast | ( | std::vector< T > & | data, |
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Broadcast a std::vector<T> from root, resizing data on the other ranks to match the root's size.
| T | Element type (must be supported by getMpiType). |
| data | Vector to broadcast from (root) / resize and fill (other ranks). |
| root | Rank broadcasting the data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::bcast | ( | T & | data, |
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Broadcast a single value of type T from root.
| T | Value type (must be supported by getMpiType). |
| data | Value to broadcast from (root) / into (other ranks). |
| root | Rank broadcasting the data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::bcast | ( | T * | data, |
| int | count, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Broadcast count contiguous values of type T from root.
| T | Element type (must be supported by getMpiType). |
| data | Buffer to broadcast from (root) / into (other ranks). |
| count | Number of elements to broadcast. |
| root | Rank broadcasting the data. |
| communicator | MPI communicator to use. |
|
inline |
Split count elements into near-equal contiguous chunks, one per rank in the current communicator.
| count | Total number of elements to split (assumed known identically by every rank). |
| stride | Number of scalars per element (e.g. vector component count). |
| void vulpes::mpi::gather | ( | const std::vector< T > & | send_data, |
| std::vector< T > & | recv_data, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Gather a std::vector<T> of equal size from every rank into recv_data on root.
| T | Element type (must be supported by getMpiType). |
| send_data | This rank's contribution. |
| recv_data | Buffer receiving the concatenated results (valid on root only); its pre-existing size determines the per-rank chunk size (recv_data.size() / mpi::size()). |
| root | Rank receiving the gathered data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::gather | ( | const T * | send_data, |
| int | send_count, | ||
| T * | recv_data, | ||
| int | recv_count, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Gather send_count contiguous values of type T from every rank into recv_data on root.
| T | Element type (must be supported by getMpiType). |
| send_data | This rank's contribution. |
| send_count | Number of elements this rank sends. |
| recv_data | Buffer receiving the concatenated results (valid on root only), must hold send_count * mpi::size() elements. |
| recv_count | Number of elements to receive from each rank. |
| root | Rank receiving the gathered data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::gatherv | ( | const T * | send_data, |
| int | send_count, | ||
| T * | recv_data, | ||
| int * | recv_count, | ||
| int * | displs, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Gather variable-length contiguous values of type T from every rank into recv_data on root.
| T | Element type (must be supported by getMpiType). |
| send_data | This rank's contribution. |
| send_count | Number of elements this rank sends. |
| recv_data | Buffer receiving the concatenated results (valid on root only). |
| recv_count | Per-rank element counts (valid on root only). |
| displs | Per-rank offsets into recv_data (valid on root only). |
| root | Rank receiving the gathered data. |
| communicator | MPI communicator to use. |
| MPI_Datatype vulpes::mpi::getMpiType | ( | ) |
Map a C++ arithmetic type to its corresponding MPI_Datatype.
| T | Arithmetic type to map (must be one of the supported built-in integer/floating-point types). |
|
inlinestatic |
Return true if MPI has been finalized.
|
inlinestatic |
Return true if MPI has been initialized.
|
inlinestatic |
Return true if PETSc has been finalized.
|
inlinestatic |
Return true if PETSc has been initialized.
|
inlinestatic |
Return the MPI rank in MPI_COMM_WORLD.
| void vulpes::mpi::recv | ( | datastructure::CrsMap< DataType, IndexType, RowSize > & | map, |
| int | source, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD, | ||
| MPI_Status * | status = MPI_STATUS_IGNORE ) |
Receive a CrsMap by receiving its data and indices in sequence.
| DataType | Element type stored in the map. |
| IndexType | Index type used by the map. |
| RowSize | Compile-time row size of the map (dynamic if -1). |
| map | The CrsMap to receive into. |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
| T vulpes::mpi::recv | ( | int | source, |
| MPI_Comm | communicator = MPI_COMM_WORLD, | ||
| MPI_Status * | status = MPI_STATUS_IGNORE ) |
Receive a single value of type T from a source rank.
| T | Value type (must be supported by getMpiType). |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
|
inline |
Receive a std::string previously sent with send(), resizing data to the transmitted size.
| data | String to receive into; resized to match the sender's size. |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
| void vulpes::mpi::recv | ( | std::vector< Eigen::Matrix< T, N, M, Options > > & | data, |
| int | source, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD, | ||
| MPI_Status * | status = MPI_STATUS_IGNORE ) |
Receive a std::vector of fixed-size Eigen matrices previously sent with send(), resizing data to the transmitted size.
| T | Scalar type of the matrices (must be supported by getMpiType). |
| N | Compile-time number of rows. |
| M | Compile-time number of columns. |
| Options | Eigen storage options. |
| data | Vector to receive into; resized to match the sender's size. |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
| void vulpes::mpi::recv | ( | std::vector< std::array< T, N > > & | data, |
| int | source, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD, | ||
| MPI_Status * | status = MPI_STATUS_IGNORE ) |
Receive a std::vector<std::array<T, N>> previously sent with send(), resizing data to the transmitted size.
| T | Element type (must be supported by getMpiType). |
| N | Length of each array. |
| data | Vector to receive into; resized to match the sender's size. |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
| void vulpes::mpi::recv | ( | std::vector< T > & | data, |
| int | source, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD, | ||
| MPI_Status * | status = MPI_STATUS_IGNORE ) |
Receive a std::vector<T> previously sent with send(), resizing data to the transmitted size.
| T | Element type (must be supported by getMpiType). |
| data | Vector to receive into; resized to match the sender's size. |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
| void vulpes::mpi::recv | ( | T * | data, |
| int | count, | ||
| int | source, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD, | ||
| MPI_Status * | status = MPI_STATUS_IGNORE ) |
Receive count contiguous values of type T from a source rank.
| T | Element type (must be supported by getMpiType). |
| data | Pointer to the buffer to receive into (must hold count elements). |
| count | Number of elements to receive. |
| source | Rank of the sending process. |
| communicator | MPI communicator to use. |
| status | Optional MPI_Status to fill in. |
| T vulpes::mpi::reduce | ( | const T & | send_data, |
| MPI_Op | op, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Reduce a single value of type T onto root.
| T | Value type (must be supported by getMpiType). |
| send_data | This process's contribution to the reduction. |
| op | MPI reduction operator (e.g. MPI_SUM). |
| root | Rank receiving the reduced result. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::reduce | ( | const T * | send_data, |
| T * | recv_data, | ||
| int | count, | ||
| MPI_Op | op, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Reduce count contiguous values of type T onto root.
| T | Element type (must be supported by getMpiType). |
| send_data | Buffer of values to reduce, one per process. |
| recv_data | Buffer receiving the reduced result (valid on root only). |
| count | Number of elements to reduce. |
| op | MPI reduction operator (e.g. MPI_SUM). |
| root | Rank receiving the reduced result. |
| communicator | MPI communicator to use. |
|
inlinestatic |
Return true if the rank in MPI_COMM_WORLD is zero.
| void vulpes::mpi::scatter | ( | const std::vector< T > & | send_data, |
| std::vector< T > & | recv_data, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Scatter a std::vector<T> from root into equal-size chunks on every rank.
| T | Element type (must be supported by getMpiType). |
| send_data | Vector on root to distribute (unused on other ranks); its size must be a multiple of mpi::size(). |
| recv_data | Buffer receiving this rank's chunk; its pre-existing size determines the chunk length. |
| root | Rank distributing the data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::scatter | ( | const T * | send_data, |
| int | send_count, | ||
| T * | recv_data, | ||
| int | recv_count, | ||
| int | root, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Scatter recv_count contiguous values of type T from root to every rank.
| T | Element type (must be supported by getMpiType). |
| send_data | Buffer on root holding recv_count * mpi::size() elements to distribute (unused on other ranks). |
| send_count | Number of elements root sends to each rank. |
| recv_data | Buffer receiving this rank's chunk. |
| recv_count | Number of elements this rank receives. |
| root | Rank distributing the data. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::scatterv | ( | const T * | send_data, |
| int * | send_counts, | ||
| int * | displacements, | ||
| T * | recv_data, | ||
| int | recv_count, | ||
| int | root, | ||
| MPI_Comm | mpi_comm = MPI_COMM_WORLD, | ||
| MPI_Datatype | send_t = getMpiType<T>(), | ||
| MPI_Datatype | recv_t = getMpiType<T>() ) |
Scatter variable-length contiguous values of type T from root to every rank.
| T | Element type (must be supported by getMpiType). |
| send_data | Buffer on root holding the data to distribute (unused on other ranks). |
| send_counts | Per-rank element counts (valid on root only). |
| displacements | Per-rank offsets into send_data (valid on root only). |
| recv_data | Buffer receiving this rank's chunk. |
| recv_count | Number of elements this rank receives. |
| root | Rank distributing the data. |
| mpi_comm | MPI communicator to use. |
| send_t | MPI datatype of the sent elements. |
| recv_t | MPI datatype of the received elements. |
| void vulpes::mpi::send | ( | const datastructure::CrsMap< DataType, IndexType, RowSize > & | map, |
| int | destination, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Send a CrsMap by sending its data and indices in sequence.
| DataType | Element type stored in the map. |
| IndexType | Index type used by the map. |
| RowSize | Compile-time row size of the map (dynamic if -1). |
| map | The CrsMap to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
|
inline |
Send a std::string, prefixed with its size.
| data | The string to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::send | ( | const std::vector< Eigen::Matrix< T, N, M, Options > > & | data, |
| int | destination, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Send a std::vector of fixed-size Eigen matrices, prefixed with its size.
| T | Scalar type of the matrices (must be supported by getMpiType). |
| N | Compile-time number of rows. |
| M | Compile-time number of columns. |
| Options | Eigen storage options. |
| data | The vector of matrices to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::send | ( | const std::vector< std::array< T, N > > & | data, |
| int | destination, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Send a std::vector<std::array<T, N>>, prefixed with its size.
| T | Element type (must be supported by getMpiType). |
| N | Length of each array. |
| data | The vector of fixed-size arrays to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::send | ( | const std::vector< T > & | data, |
| int | destination, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Send a std::vector<T>, prefixed with its size.
| T | Element type (must be supported by getMpiType). |
| data | The vector to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::send | ( | const T & | data, |
| int | destination, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Send a single value of type T to a destination rank.
| T | Value type (must be supported by getMpiType). |
| data | The value to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
| void vulpes::mpi::send | ( | const T * | data, |
| int | count, | ||
| int | destination, | ||
| MPI_Comm | communicator = MPI_COMM_WORLD ) |
Send count contiguous values of type T to a destination rank.
| T | Element type (must be supported by getMpiType). |
| data | Pointer to the first element to send. |
| count | Number of elements to send. |
| destination | Rank of the receiving process. |
| communicator | MPI communicator to use. |
|
inlinestatic |
Return the size of MPI_COMM_WORLD.
|
inlinestaticconstexpr |
Default MPI message tag used by all wrappers in this file.