GetFEM++
5.3
|
Allows to re-throw exceptions, generated in OpemMP parallel section. More...
#include <getfem_omp.h>
Public Member Functions | |
~thread_exception () | |
re-throws the first captured exception | |
template<typename Function , typename... Parameters> | |
void | run (Function f, Parameters...params) |
Run function f in parallel part to capture it's exceptions. More... | |
std::vector< std::exception_ptr > | caughtExceptions () const |
vector of pointers to caught exceptions | |
Allows to re-throw exceptions, generated in OpemMP parallel section.
Collects exceptions from all threads and on destruction re-throws the first one, so that it can be again caught in the master thread.
Definition at line 348 of file getfem_omp.h.
|
inline |
Run function f in parallel part to capture it's exceptions.
Possible syntax can be: thread_exception exception; #pragma omp parallel... { exception.run([&] { your code that can throw exceptions }); } exception.rethrow();
Definition at line 368 of file getfem_omp.h.