IBM Support

IV40154: -QSMP=OMP -O1 GENERATES INCORRECT OUTPUT

Fixes are available

XL C/C++ for AIX Fix Pack 4 (June 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 4 (June 2013 PTF) for 12.1
XL C for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C for AIX Fix Pack 7 (January 2014 PTF) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1

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

    IV40154

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-04-17

  • Closed date

    2013-06-17

  • Last modified date

    2013-06-17

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

    LI77215

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

    LI77675

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

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":"12.1"}]

Document Information

Modified date:
03 October 2021