IBM Support

IV05125: INCORRECT RESULT WITH -QSMP=OMP

Fixes are available

August 2011 PTF for XL C/C++ for AIX, V11.1
November 2011 PTF for XL C/C++ for AIX, V11.1
January 2012 PTF for XL C for AIX, V11.1
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C for AIX, V11.1
February 2013 PTF for XL C for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C for AIX Fix Pack 24 (September 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
August 2011 PTF for XL C for AIX, V11.1
November 2011 PTF for XL C for AIX, V11.1
July 2012 PTF for XL C for AIX, V11.1
XL C for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 22 (September 2015 PTF) for 11.1

Subscribe

You can track all active APARs for this component.

 

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

    IV05125

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5724X1200

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-08-09

  • Closed date

    2011-08-09

  • Last modified date

    2011-08-10

  • APAR is sysrouted FROM one or more of the following:

    LI76052

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5724X1200

Applicable component levels

[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1"}]

Document Information

Modified date:
28 September 2021