File tree Expand file tree Collapse file tree 2 files changed +28
-12
lines changed
openmp/runtime/test/tasking/hidden_helper_task Expand file tree Collapse file tree 2 files changed +28
-12
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %libomp-cxx-compile-and-run
2
- //
3
- // AIX runs out of resource in 32-bit with 4*omp_get_max_threads() threads.
4
- // XFAIL: aix && ppc
5
2
6
3
#include < omp.h>
7
4
11
8
#include < thread>
12
9
#include < vector>
13
10
11
+ // AIX runs out of resource in 32-bit if 4*omp_get_max_threads() is more
12
+ // than 64 threads with the default stack size.
13
+ #if defined(_AIX) && !__LP64__
14
+ #define MAX_THREADS 64
15
+ #endif
16
+
14
17
void dummy_root () {
15
18
// omp_get_max_threads() will do middle initialization
16
19
int nthreads = omp_get_max_threads ();
17
20
std::this_thread::sleep_for (std::chrono::milliseconds (1000 ));
18
21
}
19
22
20
23
int main (int argc, char *argv[]) {
21
- const int N = std::min (std::max (std::max (32 , 4 * omp_get_max_threads ()),
22
- 4 * omp_get_num_procs ()),
23
- std::numeric_limits<int >::max ());
24
+ int N = std::min (std::max (std::max (32 , 4 * omp_get_max_threads ()),
25
+ 4 * omp_get_num_procs ()),
26
+ std::numeric_limits<int >::max ());
27
+
28
+ #if defined(_AIX) && !__LP64__
29
+ if (N > MAX_THREADS)
30
+ N = MAX_THREADS;
31
+ #endif
24
32
25
33
std::vector<int > data (N);
26
34
Original file line number Diff line number Diff line change 1
1
// RUN: %libomp-cxx-compile-and-run
2
- //
3
- // AIX runs out of resource in 32-bit with 4*omp_get_max_threads() threads.
4
- // XFAIL: aix && ppc
5
2
6
3
#include < omp.h>
7
4
10
7
#include < limits>
11
8
#include < vector>
12
9
10
+ // AIX runs out of resource in 32-bit if 4*omp_get_max_threads() is more
11
+ // than 64 threads with the default stacksize.
12
+ #if defined(_AIX) && !__LP64__
13
+ #define MAX_THREADS 64
14
+ #endif
15
+
13
16
int main (int argc, char *argv[]) {
14
- const int N = std::min (std::max (std::max (32 , 4 * omp_get_max_threads ()),
15
- 4 * omp_get_num_procs ()),
16
- std::numeric_limits<int >::max ());
17
+ int N = std::min (std::max (std::max (32 , 4 * omp_get_max_threads ()),
18
+ 4 * omp_get_num_procs ()),
19
+ std::numeric_limits<int >::max ());
20
+
21
+ #if defined(_AIX) && !__LP64__
22
+ if (N > MAX_THREADS)
23
+ N = MAX_THREADS;
24
+ #endif
17
25
18
26
std::vector<int > data (N);
19
27
You can’t perform that action at this time.
0 commit comments