File tree Expand file tree Collapse file tree
openmp/runtime/test/tasking/hidden_helper_task Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// 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
52
63#include < omp.h>
74
118#include < thread>
129#include < vector>
1310
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+
1417void dummy_root () {
1518 // omp_get_max_threads() will do middle initialization
1619 int nthreads = omp_get_max_threads ();
1720 std::this_thread::sleep_for (std::chrono::milliseconds (1000 ));
1821}
1922
2023int 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
2432
2533 std::vector<int > data (N);
2634
Original file line number Diff line number Diff line change 11// 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
52
63#include < omp.h>
74
107#include < limits>
118#include < vector>
129
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+
1316int 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
1725
1826 std::vector<int > data (N);
1927
You can’t perform that action at this time.
0 commit comments