Mantid
|
Runs a callable in parallel. More...
#include <ParallelRunner.h>
Public Member Functions | |
ParallelRunner () | |
ParallelRunner (const int threads) | |
template<class Function , class... Args> | |
void | runParallel (Function &&f, Args &&...args) |
template<class Function , class... Args> | |
void | runSerial (Function &&f, Args &&...args) |
int | size () const |
Private Attributes | |
std::shared_ptr< Mantid::Parallel::detail::ThreadingBackend > | m_backend |
std::shared_ptr< Mantid::Parallel::detail::ThreadingBackend > | m_serialBackend |
Runs a callable in parallel.
This is mainly a helper for testing code with MPI calls. ParallelRunner passes a Communicator as first argument to the callable. In runs with only a single MPI rank the callable is executed in threads to mimic MPI ranks.
Definition at line 24 of file ParallelRunner.h.
ParallelTestHelpers::ParallelRunner::ParallelRunner | ( | ) |
Definition at line 16 of file ParallelRunner.cpp.
References m_backend, and m_serialBackend.
ParallelTestHelpers::ParallelRunner::ParallelRunner | ( | const int | threads | ) |
Definition at line 29 of file ParallelRunner.cpp.
References m_backend, and m_serialBackend.
void ParallelTestHelpers::ParallelRunner::runParallel | ( | Function && | f, |
Args &&... | args | ||
) |
Definition at line 43 of file ParallelRunner.h.
References m_backend.
Referenced by ParallelTestHelpers::runParallel().
void ParallelTestHelpers::ParallelRunner::runSerial | ( | Function && | f, |
Args &&... | args | ||
) |
Definition at line 39 of file ParallelRunner.h.
References m_serialBackend.
int ParallelTestHelpers::ParallelRunner::size | ( | ) | const |
Definition at line 41 of file ParallelRunner.cpp.
References m_backend.
|
private |
Definition at line 35 of file ParallelRunner.h.
Referenced by ParallelRunner(), runParallel(), and size().
|
private |
Definition at line 36 of file ParallelRunner.h.
Referenced by ParallelRunner(), and runSerial().