IBM Support

LI76142: CLASS INSTANCE COPY ISSUE WITH OPENMP

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When running the following OpenMP test case, the application is
    giving incorrect output.
    
    
       ===== TEST CASE =====
    
    #include <cstdio>
    #include <omp.h>
    #include <algorithm>
    
    using namespace std;
    
    std::pair< double, double >
    getData(int a, int b, double c)
    {
            std::pair< double, double > tmpCritV;
            tmpCritV.first = (double)a / (double)b + c;
            tmpCritV.second = (double)b / (double)a + c;
    
            return tmpCritV;
    }
    
    int main(int argc, char* argv[])
    {
    
      #pragma omp parallel
        printf("Hello, world. I'm thread %d\n",
         omp_get_thread_num());
      printf("========================\n");
    
      std::pair< double, double > tmpCritV;
    
      #pragma omp parallel for private (tmpCritV)
      for (int i = 0; i < 100; i++){
    
      if( i != 9 )
            continue;
    
      tmpCritV = getData(5, 8, 1.0);
    
      printf("%f, %f\n", tmpCritV.first, tmpCritV.second);
    
      }
    
      return 0;
    }
    
    
       ===== ACTUAL OUTPUT =====
    
    Hello, world. I'm thread 0
    ========================
    0.000000, 0.000000
    
    
       ===== EXPECTED OUTPUT =====
    
    Hello, world. I'm thread 0
    Hello, world. I'm thread 1
    Hello, world. I'm thread 2
    Hello, world. I'm thread 3
    Hello, world. I'm thread 4
    Hello, world. I'm thread 5
    Hello, world. I'm thread 6
    Hello, world. I'm thread 7
    ========================
    1.625000, 2.600000
    

Local fix

  • N/A
    

Problem summary

  • PROBLEM DESCRIPTION:
    The problem occurs due to copy propagation for an aggrate (and
    creating new member symbols) after the compiler has privatized
    the members of the aggregate.  As a result, the new member
    symbols are not privatized.
    
    USERS AFFECTED:
    Potentially any OpenMP users who privatize a structure (this
    can occur implicitly in C++).
    

Problem conclusion

  • A check was added to avoid copy propagation that will create a
    member.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76142

  • 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-04-27

  • Closed date

    2011-04-27

  • Last modified date

    2011-04-27

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

    IZ89653

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5724X1400

Applicable component levels

[{"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:
17 October 2021