ARTS 2.5.11 (git: 725533f0)
arts_omp.cc
Go to the documentation of this file.
1
16#include "arts.h"
17
18#include <iostream>
19using namespace std;
20
21#include "arts_omp.h"
22
24
30#ifdef _OPENMP
31 int max_threads = omp_get_max_threads();
32#else
33 int max_threads = 1;
34#endif
35
36 return max_threads;
37}
38
40
46#ifdef _OPENMP
47 return omp_in_parallel();
48#else
49 return false;
50#endif
51}
52
54
60#ifdef _OPENMP
61 int thread_num = omp_get_thread_num();
62#else
63 int thread_num = 0;
64#endif
65
66 return thread_num;
67}
68
70
76#ifdef _OPENMP
77 int nested = omp_get_nested();
78#else
79 int nested = 0;
80#endif
81
82 return nested;
83}
84
86
91#ifdef _OPENMP
92void arts_omp_set_nested(int i)
93#else
95#endif
96{
97
98#ifdef _OPENMP
99 omp_set_nested(i);
100#else
101 // Nothing to do here.
102#endif
103}
104
106
111#ifdef _OPENMP
112void arts_omp_set_dynamic(int i)
113#else
115#endif
116{
117
118#ifdef _OPENMP
119 omp_set_dynamic(i);
120#else
121 // Nothing to do here.
122#endif
123}
The global header file for ARTS.
int arts_omp_get_nested()
Wrapper for omp_get_nested.
Definition arts_omp.cc:75
void arts_omp_set_dynamic(int i)
Wrapper for omp_set_dynamic.
Definition arts_omp.cc:114
void arts_omp_set_nested(int i)
Wrapper for omp_set_nested.
Definition arts_omp.cc:94
int arts_omp_get_max_threads()
Wrapper for omp_get_max_threads.
Definition arts_omp.cc:29
int arts_omp_get_thread_num()
Wrapper for omp_get_thread_num.
Definition arts_omp.cc:59
bool arts_omp_in_parallel()
Wrapper for omp_in_parallel.
Definition arts_omp.cc:45
Header file for helper functions for OpenMP.
#define _U_
Definition config.h:177