[Openmp-commits] [openmp] ddef9ce - LLVM Buildbot failure on openmp runtime test (#143674)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 11 03:09:20 PDT 2025


Author: CHANDRA GHALE
Date: 2025-06-11T15:39:16+05:30
New Revision: ddef9ce8dad611c2fef172f3b08c5c98235a3b41

URL: https://github.com/llvm/llvm-project/commit/ddef9ce8dad611c2fef172f3b08c5c98235a3b41
DIFF: https://github.com/llvm/llvm-project/commit/ddef9ce8dad611c2fef172f3b08c5c98235a3b41.diff

LOG: LLVM Buildbot failure on openmp runtime test (#143674)

Error looks to be missing includes for complex number support in some
system. Removing test for now.
Relevant PR :
[PR-134709](https://github.com/llvm/llvm-project/pull/134709)
```
 .---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.
```

Co-authored-by: Chandra Ghale <ghale at pe31.hpc.amslabs.hpecorp.net>

Added: 
    

Modified: 
    openmp/runtime/test/worksharing/for/omp_for_private_reduction.cpp

Removed: 
    


################################################################################
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