IBM Support

LI76580: INCORRECT RESULT WITH -QSMP=OMP

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

    LI76580

  • Reported component name

    XL FORTRAN RHEL

  • Reported component ID

    5724U8410

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-01-09

  • Closed date

    2012-01-09

  • Last modified date

    2012-01-09

  • 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 FORTRAN RHEL

  • Fixed component ID

    5724U8410

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSB259","label":"XL Fortran Advanced Edition for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"C.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
24 February 2022