IBM Support

LI75817: INCORRECT CALCULATION FOR COMPLEX NUMBER

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When dividing a complex number by one, an incorrect real number
    is observed and a core is generated.
    
    This occurs when compiling the below test case with any of the
    following options:
    
    " -qsmp=omp"
    " -qsmp=omp -qinline=level=5"
    
    ==== Test Case:
    test.cpp:
    #include <iostream>
    #include <complex>
    
    using namespace std;
    
    int main()
    {
       complex<double> ddd;
       ddd = 1.0;
    
    #pragma omp parallel for
       for ( int i=0; i<4; ++i )
       {
          complex<double> csum;
    
          csum = 2.0 / ddd;
    
    #pragma omp critical
          clog << csum << " <- expected:  (2,0)" << endl;
       }
    }
    ==========
    
    ==== Actual Output:
    # xlC_r -qsmp=omp test.cpp && ./a.out
    (-1.78686e-308,-0) <- expected:  (2,0)
    (-1.78686e-308,-0) <- expected:  (2,0)
    Segmentation fault (core dumped)
    #
    

Local fix

  • Use '-qsmp=omp -qinline=level=4'.
    

Problem summary

  • PROBLEM DESCRIPTION:
    Incorrect calculation of complex number with -O3 -qhot.
    
    USERS AFFECTED:
    Users of at levels -O3 -qhot and higher.
    

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 fix ensures that the owner and its members will
    become local to the outlined procedure.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75817

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5724X1400

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2011-01-18

  • Closed date

    2011-04-27

  • Last modified date

    2011-04-27

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

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

    IZ96359

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5724X1400

Applicable component levels

  • RB10 PSY

       UP

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

Document Information

Modified date:
15 October 2021