Skip to content

Commit 22bba85

Browse files
authored
[OpenMP][test][AIX] Make 64 the max number of threads for capacity tests in AIX 32-bit (#88739)
This patch makes 64 the max number of threads for 2 capacity tests in AIX 32-bit mode rather than `XFAIL`ing them.
1 parent 454d449 commit 22bba85

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

openmp/runtime/test/tasking/hidden_helper_task/capacity_mix_threads.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
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

@@ -11,16 +8,27 @@
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+
1417
void 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

2023
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
2432

2533
std::vector<int> data(N);
2634

openmp/runtime/test/tasking/hidden_helper_task/capacity_nthreads.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
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

@@ -10,10 +7,21 @@
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+
1316
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
1725

1826
std::vector<int> data(N);
1927

0 commit comments

Comments
 (0)