ARTS 2.5.9 (git: 825fa5f2)
test_omp.cc
Go to the documentation of this file.
1#include <auto_md.h>
2
3int main(int argc, char ** argv) {
7
8 const bool do_openmp = argc > 1 and argv[1][0] == 'y';
9
10 Workspace ws{};
11 WorkspaceOmpParallelCopyGuard wss{ws, do_openmp};
12
13 std::cerr << "arts_omp_in_parallel(): " << arts_omp_in_parallel() <<'\n';
14 std::cerr << "arts_omp_get_max_threads() not_eq 1: " << (arts_omp_get_max_threads() not_eq 1) << '\n';
15
16 #pragma omp parallel for firstprivate(wss) if (do_openmp)
17 for (Index i=0; i<100; i++) {}
18}
void define_wsv_groups()
Define the array of workspace variable group names.
Definition: groups.cc:66
int arts_omp_get_max_threads()
Wrapper for omp_get_max_threads.
Definition: arts_omp.cc:46
bool arts_omp_in_parallel()
Wrapper for omp_in_parallel.
Definition: arts_omp.cc:62
Workspace class.
Definition: workspace_ng.h:53
int main()
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
void define_wsv_data()
Definition: workspace.cc:48
void define_wsv_map()
Definition: workspace.cc:5711