1#ifndef MPI_COMMUNICATION_PATTERNS_H
2#define MPI_COMMUNICATION_PATTERNS_H
59 static_assert(std::is_same<T, double>::value || std::is_same<T, float>::value
60 || std::is_same<T, int>::value || std::is_same<T, long>::value,
61 "commPatternAllDataToAll: unsupported T; extend mpi_type_of<T>()");
74 if (
global_array.
size() == sim->m_simulation_config.getIntParameters(
"global_number_of_facets"))
77 static_cast<int>(sim->global_array_split
78 / sim->m_simulation_config.getIntParameters(
"numerical_layers"));
86 throw std::runtime_error(
"split_id out of bounds");
92 if (
s >
static_cast<std::size_t
>(
INT_MAX))
93 throw std::overflow_error(
"count > INT_MAX");
94 return static_cast<int>(
s);
98 if (sim->my_color == 0)
108 dtype, sim->sub_comm);
112 if (sim->other_color_exists == 0)
120 if (sim->my_color == 0 && sim->my_sub_rank == 0)
125 else if (sim->my_color == 0)
137 if (sim->my_color == 1 && sim->my_sub_rank == 0)
142 else if (sim->my_color == 1)
173 static_assert(std::is_same<T, double>::value || std::is_same<T, float>::value
174 || std::is_same<T, int>::value || std::is_same<T, long>::value,
175 "commPatternAllDataToAll: unsupported T; extend mpi_type_of<T>()");
188 if (
global_array.
size() == sim->m_simulation_config.getIntParameters(
"global_number_of_facets"))
191 static_cast<int>(sim->global_array_split
192 / sim->m_simulation_config.getIntParameters(
"numerical_layers"));
200 throw std::runtime_error(
"split_id out of bounds");
202 if (sim->my_color == 0)
216 if (sim->other_color_exists == 0)
224 if (sim->my_color == 0 && sim->my_sub_rank == 0)
229 else if (sim->my_color == 0)
241 if (
s >
static_cast<std::size_t
>(
INT_MAX))
242 throw std::overflow_error(
"count > INT_MAX");
243 return static_cast<int>(
s);
247 if (sim->my_color == 1 && sim->my_sub_rank == 0)
252 else if (sim->my_color == 1)
283 static_assert(std::is_same<T, double>::value || std::is_same<T, float>::value
284 || std::is_same<T, int>::value || std::is_same<T, long>::value,
285 "commPatternAllDataToAll: unsupported T; extend mpi_type_of<T>()");
298 if (
global_array.
size() == sim->m_simulation_config.getIntParameters(
"global_number_of_facets"))
301 static_cast<int>(sim->global_array_split
302 / sim->m_simulation_config.getIntParameters(
"numerical_layers"));
310 throw std::runtime_error(
"split_id out of bounds");
312 if (sim->my_color == 0)
326 if (sim->other_color_exists == 0)
334 if (sim->my_color == 0 && sim->my_sub_rank == 0)
339 else if (sim->my_color == 0)
351 if (
s >
static_cast<std::size_t
>(
INT_MAX))
352 throw std::overflow_error(
"count > INT_MAX");
353 return static_cast<int>(
s);
357 if (sim->my_color == 1 && sim->my_sub_rank == 0)
362 else if (sim->my_color == 1)
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:35
std::pair< int, int > size() const
Function that returns the size of the matrix as a pair in (rows, columns) format.
Definition GenericMatrix.h:118