[Openmp-commits] [openmp] LLVM Buildbot failure on openmp runtime test (PR #143674)
CHANDRA GHALE via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jun 11 02:56:53 PDT 2025
https://github.com/chandraghale created https://github.com/llvm/llvm-project/pull/143674
Error looks to be missing includes for complex number support in some system. Removing test for now.
```
.---command stderr------------
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:78:42: error: use of undeclared identifier 'I'
# | 78 | double _Complex expected = 0.0 + 0.0 * I;
# | | ^
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:79:40: error: use of undeclared identifier 'I'
# | 79 | double _Complex result = 0.0 + 0.0 * I;
# | | ^
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:84:22: error: use of undeclared identifier 'I'
# | 84 | arr[i] = i - i * I;
# | | ^
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:92:19: error: use of undeclared identifier 'creal'
# | 92 | real_sum += creal(arr[i]);
# | | ^~~~~
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:93:19: error: use of undeclared identifier 'cimag'
# | 93 | imag_sum += cimag(arr[i]);
# | | ^~~~~
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:96:36: error: use of undeclared identifier 'I'
# | 96 | result = real_sum + imag_sum * I;
# | | ^
# | /home/uweigand/sandbox/buildbot/openmp-s390x-linux/llvm.src/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp:97:9: error: use of undeclared identifier 'cabs'
# | 97 | if (cabs(result - expected) > 1e-6) {
# | | ^~~~
# | 7 errors generated.
```
>From a7dcb0ac150e521ec9dc123a209039dfba4fb13e Mon Sep 17 00:00:00 2001
From: Chandra Ghale <ghale at pe31.hpc.amslabs.hpecorp.net>
Date: Wed, 11 Jun 2025 04:52:03 -0500
Subject: [PATCH] fix failing openmp runtime test
---
.../for/omp_for_private_reduction.cpp | 34 ++-----------------
1 file changed, 3 insertions(+), 31 deletions(-)
diff --git a/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp b/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp
index 9bf3be1e9e45d..4520755a8a305 100644
--- a/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp
+++ b/openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp
@@ -73,34 +73,6 @@ void performMinMaxRed(int &min_val, int &max_val) {
max_val = input_data[i];
}
}
-int performComplexReduction() {
- double _Complex arr[N];
- double _Complex expected = 0.0 + 0.0 * I;
- double _Complex result = 0.0 + 0.0 * I;
- int error = 0;
-
- // Initialize the array and compute serial sum
- for (int i = 0; i < N; ++i) {
- arr[i] = i - i * I;
- expected += arr[i];
- }
- double real_sum = 0.0, imag_sum = 0.0;
-#pragma omp parallel private(real_sum) private(imag_sum)
- {
-#pragma omp for reduction(+ : real_sum, imag_sum)
- for (int i = 0; i < N; ++i) {
- real_sum += creal(arr[i]);
- imag_sum += cimag(arr[i]);
- }
-
- result = real_sum + imag_sum * I;
- if (cabs(result - expected) > 1e-6) {
- error++;
- }
- }
- return error;
-}
-
std::complex<double> doComplexReduction(std::complex<double> *arr) {
std::complex<double> result(1, 0);
@@ -138,7 +110,8 @@ int main(void) {
const float kPiVal = 3.14f;
const int kExpectedSum = 45; // Sum of 0..9
const int kExpectedProd = 3628800; // 10!
- const float kExpectedFsum = kPiVal * N; // 3.14f * 10
+ const float kExpectedFsum = 31.400000f; // 3.14f * 10
+ const float kTolerance = 1e-4f;
const int kExpectedMin = 3;
const int kExpectedMax = 12;
std::complex<double> arr[N];
@@ -163,7 +136,7 @@ int main(void) {
total_errors++;
if (t_prod_v != kExpectedProd)
total_errors++;
- if (t_fsum_v != kExpectedFsum)
+ if (std::abs(t_fsum_v - kExpectedFsum) > kTolerance)
total_errors++;
}
#pragma omp parallel num_threads(4)
@@ -177,7 +150,6 @@ int main(void) {
total_errors++;
}
total_errors += checkUserDefinedReduction();
- total_errors += performComplexReduction();
#pragma omp parallel num_threads(4)
{
std::complex<double> result(1, 0);
More information about the Openmp-commits
mailing list