![]() |
QMCPACK
|
Abstraction for running concurrent tasks in parallel by an executor executor workers can be OpenMP threads, std::thread. More...
Public Member Functions | |
template<typename F , typename... Args> | |
void | operator() (int num_tasks, F &&f, Args &&... args) |
Concurrently execute an arbitrary function/kernel with task id and arbitrary args. More... | |
template<> | |
void | operator() (int num_tasks, F &&f, Args &&... args) |
implements parallel tasks executed by threads in an OpenMP thread pool. More... | |
template<> | |
void | operator() (int num_tasks, F &&f, Args &&... args) |
implements parallel tasks executed by STD threads. More... | |
Abstraction for running concurrent tasks in parallel by an executor executor workers can be OpenMP threads, std::thread.
Note: it is not related to the executor that C++ standard is working on currently.
Construct with num_tasks to run then call operator(F, args...) F is lambda or function with form void F(int task_id, args...) [](int task_id, args...){...}
This has not been tested for nested threading with openmp It is not intended for use below the top level of openmp threading.
Definition at line 35 of file ParallelExecutor.hpp.
void operator() | ( | int | num_tasks, |
F && | f, | ||
Args &&... | args | ||
) |
implements parallel tasks executed by threads in an OpenMP thread pool.
This specialization throws below the top openmp theading level exception must be caught at thread level or terminate is called.
Definition at line 37 of file ParallelExecutorOPENMP.hpp.
References omp_get_level().
void operator() | ( | int | num_tasks, |
F && | f, | ||
Args &&... | args | ||
) |
Concurrently execute an arbitrary function/kernel with task id and arbitrary args.
ie each task will run f(int task_id, Args... args)
void operator() | ( | int | num_tasks, |
F && | f, | ||
Args &&... | args | ||
) |
implements parallel tasks executed by STD threads.
One task one thread mapping.
Definition at line 50 of file ParallelExecutorSTD.hpp.