Files for communication of parallel solvers.
More...
|
| constexpr bool | Dumux::Multithreading::isSerial () |
| | Checking whether the backend is serial.
|
| template<class Communication> |
| std::vector< char > | Dumux::Detail::exchangeSparse (const Communication &comm, std::vector< std::vector< char > > &sendBufs, int tag=7373) |
| | Exchange variable-sized byte messages with a sparse set of peer processes.
|
| template<class FunctorType> |
| void | Dumux::parallelFor (const std::size_t count, const FunctorType &functor) |
| | A parallel for loop (multithreading).
|
◆ exchangeSparse()
template<class Communication>
| std::vector< char > Dumux::Detail::exchangeSparse |
( |
const Communication & | comm, |
|
|
std::vector< std::vector< char > > & | sendBufs, |
|
|
int | tag = 7373 ) |
- Parameters
-
| comm | a Dune communicator (convertible to an MPI_Comm when built with MPI) |
| sendBufs | one byte buffer per destination rank; an empty buffer means "no
message for that rank". A buffer addressed to the calling rank is ignored. |
| tag | the MPI message tag to use; it must not clash with other communication in flight on the same communicator while this exchange runs. |
- Returns
- the concatenation, in unspecified order, of all messages addressed to this rank
- Note
- Collective over comm. Each rank only needs to know its own destinations; who sends to it (and how much) is discovered on the fly, so there is no O(number of ranks) memory or all-to-all collective involved.
◆ isSerial()
| bool Dumux::Multithreading::isSerial |
( |
| ) |
|
|
inlineconstexpr |
◆ parallelFor()
template<class FunctorType>
| void Dumux::parallelFor |
( |
const std::size_t | count, |
|
|
const FunctorType & | functor ) |
|
inline |
- Parameters
-
| count | the number of work tasks to perform |
| functor | functor executed for each task (get task number as argument) |