IBM Support

LI77675: -QSMP=OMP -O1 GENERATES INCORRECT OUTPUT

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Specifying -qsmp implicitly sets -O2. However, if user
    mis-types "-O1", optimization is not passed to the compiler and
    incorrect binary is generated.
    
    ===== TESTCASE:
    $cat nt.C
    #include <stdio.h>
    #include <omp.h>
    int main(int argc, char* argv)
    {
      int mt = omp_get_max_threads();
      int nt;
    #pragma omp parallel
      {
    #pragma omp master
        {
          nt = omp_get_num_threads();
        }
      }
      printf("mt=%d nt=%d\n", mt, nt);
      return 0;
    }
    
    Compile with bgxlC_r -qsmp=omp -O1 nt.C
    run with 1 node and env variable OMP_NUM_THREADS=16
    
    ===== ACTUAL OUTPUT:
    $xlC_r -qsmp=omp -O1 nt.C
    xlC_r: 1501-210 (W) command option -O contains an incorrect
    subargument
    $export OMP_NUM_THREADS=16
    $./a.out
    mt=16 nt=1
    
    
    ===== EXPECTED OUTPUT:
    As with "-qsmp=omp", "-qsmp=omp -O0", "-qsmp=omp -O2",
    "-qsmp=omp -qnoopt":
    $xlC_r -qsmp=omp nt.C
    $export OMP_NUM_THREADS=16
    $./a.out
    mt=16 nt=16
    

Local fix

  • Do not specify incorrect option name -O1.
    

Problem summary

  • PROBLEM DESCRIPTION: -qsmp=omp -O1 causes program to abend.
    
    USERS AFFECTED: Users who accidentally specifies -O1 with
    -qsmp=omp.
    

Problem conclusion

  • Problem is fixed. -O1 has been defaulted to -O2 in this case.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77675

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-28

  • Closed date

    2013-10-28

  • Last modified date

    2013-10-28

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

    IV40154

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

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":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
14 October 2021