22 #pragma omp atomic update 26 TEST_CASE(
"ParallelExecutor<OPENMP> function case",
"[concurrency]")
31 test_block(num_threads,
TestTaskOMP, std::ref(count));
35 TEST_CASE(
"ParallelExecutor<OPENMP> lambda case",
"[concurrency]")
38 std::cout <<
"omp_get_max_threads() == " << num_threads <<
'\n';
44 #pragma omp atomic update 51 TEST_CASE(
"ParallelExecutor<OPENMP> nested case",
"[concurrency]")
56 auto nested_tasks = [num_threads](
int task_id,
int& my_count) {
58 test_block2(num_threads,
TestTaskOMP, std::ref(my_count));
61 REQUIRE_THROWS_WITH(test_block(num_threads, nested_tasks, std::ref(count)),
62 Catch::Contains(
"ParallelExecutor should not be used for nested openmp threading"));
helper functions for EinsplineSetBuilder
Abstraction for running concurrent tasks in parallel by an executor executor workers can be OpenMP th...
TEST_CASE("complex_helper", "[type_traits]")
omp_int_t omp_get_max_threads()
REQUIRE(std::filesystem::exists(filename))
void TestTaskOMP(const int ip, int &counter)
Openmp generally works but is not guaranteed with std::atomic.