Fixes are available
APAR status
Closed as program error.
Error description
The following test case gives out incorrect runtime results if compile with -qsmp=omp option. $cat simple_omp_bug.cpp #include <complex> #include <iostream> #include <vector> #ifdef _OPENMP # include "omp.h" #endif void Aggrevate ( std::complex<double> alpha, int height, int width, std::complex<double>* ABuf, const std::complex<double>* BBuf ) { #ifdef _OPENMP #pragma omp parallel for #endif for( int j=0; j<width; ++j ) { const std::complex<double>* BCol = &BBuf[j*height]; std::complex<double>* ACol = &ABuf[j*height]; for( int i=0; i<height; ++i ) ACol[i] += alpha*BCol[i]; } } int main( int argc, char* argv[] ) { const int height = 100; const int width = 100; std::vector< std::complex<double> > C(height*width,1.0); std::vector< std::complex<double> > D(height*width,0.7); std::complex<double> beta(0.3,0.); std::cout << "C[0] before: " << C[0] << "\n" << "D[0] before: " << D[0] << "\n" << "beta before: " << beta << "\n" << "height: " << height << "\n" << "width: " << width << "\n" << "C.size(): " << C.size() << "\n" << "D.size(): " << D.size() << std::endl; std::cout << "Started complex OpenMP section." << std::endl; Aggrevate( beta, height, width, &C[0], &D[0] ); std::cout << "C[0] := C[0] + beta D[0] = " << C[0] << std::endl; return 0; } ${bgxlC} -g -O0 simple_omp_bug.cpp -o simple_omp_bug_O0.x ${bgxlC_r} -qsmp=omp:noauto -g -O0 simple_omp_bug.cpp -o simple_omp_bug_omp_O0.x ${bgxlC} -g -O3 simple_omp_bug.cpp -o simple_omp_bug_O3.x ${bgxlC_r} -qsmp=omp:noauto -g -O3 simple_omp_bug.cpp -o simple_omp_bug_omp_O3.x ${bgxlC} -g -O4 simple_omp_bug.cpp -o simple_omp_bug_O4.x ${bgxlC_r} -qsmp=omp:noauto -g -O4 simple_omp_bug.cpp -o simple_omp_bug_omp_O4.x diff O0_omp.output O0.output 9c9 < C[0] := C[0] + beta D[0] = (1,4.10606e-313) --- > C[0] := C[0] + beta D[0] = (1.21,0) diff O3_omp.output O3.output 9c9 < C[0] := C[0] + beta D[0] = (1,4.10606e-313) --- > C[0] := C[0] + beta D[0] = (1.21,0) diff O4_omp.output O4.output 9c9 < C[0] := C[0] + beta D[0] = (1,0) --- > C[0] := C[0] + beta D[0] = (1.21,0)
Local fix
N/A
Problem summary
PROBLEM DESCRIPTION: Incorrect calculation of complex number with -qsmp=omp USERS AFFECTED: Complex numbers using -qsmp=omp to compile.
Problem conclusion
In an outlined procedure the real and complex members of a complex number were not privatized into that procedure but the owner was. So the stores into them did not go into the location of the owner causing runtime failures when the owner was referenced. The problem is fixed. Apply recommended service.
Temporary fix
Comments
APAR Information
APAR number
LI76052
Reported component name
XL C/C++ AE BG/
Reported component ID
5799HJE00
Reported release
900
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-04-26
Closed date
2011-07-26
Last modified date
2011-07-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C/C++ AE BG/
Fixed component ID
5799HJE00
Applicable component levels
R900 PSY
UP
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
17 October 2021