LI77215: -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: When -qsmp=omp -O1 is specified, -O1 is
    unsupported and ignored.  The compiler does not set -O2 for
    -qsmp.
    
    USERS AFFECTED: Users who mistakenly specify -O1 with the -qsmp
    option.  The -O1 option is not supported.
    

Problem conclusion

  • The compiler sets -O2 in this situation.
    Fix is available, apply applicable service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77215

  • Reported component name

    XL C/C++ FOR BG

  • Reported component ID

    5799AG100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-02-13

  • Closed date

    2013-05-29

  • Last modified date

    2013-05-29

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

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

    IV40154

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

  • RC10 PSY

       UP



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

XL C/C++ for Blue Gene/Q
Compiler

Software version:

12.1

Reference #:

LI77215

Modified date:

2013-05-29

Translate my page

Machine Translation

Content navigation