IBM Support

LI78299: USAGE OF OMP MAX/MIN REDUCTION OPERATORS CAUSING SYNTAX ERROR IN _PRAGMA

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The OMP 3.1 reduction operators 'max' and 'min' are causing an
    unexpected syntax error when they are used in a _Pragma
    preprocessing operator.  Usage of the reduction operators in a
    "#pragma" works without issue.
    
    The issue only occurs with the xlc invocation.  The C++ xlC
    invocation is not affected.
    
    
    
       ==== TEST CASE ====
    
    int main()
    {
     int i;
     int N=5;
     double bmax;
    
     _Pragma("omp parallel for private(i) reduction(max:bmax)")
     for(i=0;i<N;i++){}
    
     _Pragma("omp parallel for private(i) reduction(min:bmax)")
     for(i=0;i<N;i++){}
    
     #pragma omp parallel for private(i) reduction(max:bmax)
     for(i=0;i<N;i++){}
    }
    
    
    $ xlc_r -qsmp testcase.c
    "testcase.c", line 7.105: 1506-046 (S) Syntax error.
    "testcase.c", line 10.105: 1506-046 (S) Syntax error.
    $
    

Local fix

  • Use #pragma syntax
    

Problem summary

  • PROBLEM DESCRIPTION:
    Invalid syntax error for OMP reduction operators max and min
    when used in a _Pragma statement.
    
    USERS AFFECTED:
    Users of the _Pragma syntax and the OMP reduction operators max
    and min.
    

Problem conclusion

  • The issue has now been corrected.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI78299

  • 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 / Xsystem

  • Submitted date

    2014-11-18

  • Closed date

    2015-02-13

  • Last modified date

    2015-02-13

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

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

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS2LWA","label":"XL C\/C++ for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
05 September 2024