IBM Support

LI78257: XLF OMP THREADPRIVATE ALLOCATION FAILURE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • In the below test case, foo is considered unallocated after
    returning from the initialize subroutine with threadprivate
    attribute.
    
    This only fails when the initialize subroutine is in a module,
    not when it is outside of a module in the same file.
    
    Also if commenting out the threadprivate attribute, foo is also
    allocated.
    
    ===== TESTCASE:
    $cat xlf-omp.f90
    module init
     implicit none
     integer, save, allocatable :: foo(:)
    !$omp threadprivate (foo)  ! comment this line will make the
    test case pass
    
    
    contains
     subroutine initialize()
       allocate(foo(1))    ! this succeeds though status line is
    omitted for brevity
     end subroutine initialize
    end module init
    
    program main
     use init
     implicit none
    
     !$omp parallel
    
     call initialize()
     print*, allocated(foo)  ! prints F
     !$omp end parallel
    
    
    end program main
    
    
    ===== ACTUAL OUTPUT:
    xlf90_r -qsmp=omp xlf-omp.f90
    $./a.out
     F
    
    ===== EXPECTED OUTPUT:
    xlf90_r -qsmp=omp xlf-omp.f90
    $./a.out
     T
    

Local fix

  • Use option -qsmp=omp:noostls
    

Problem summary

  • USERS AFFECTED:
    Fortran OMP users may be affected by this issue.
    
    PROBLEM DESCRIPTION:
    Fortran allocatable array with OMP threadprivate attribute
    declared within a module named 'init' is not allocated and
    accessed correctly.
    

Problem conclusion

  • The fix is to ensure that Fortran module related functions are
    not considered as C++ Init/Term functions.
    An additional check has been added in the compiler for the
    above.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI78257

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    F10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-10-30

  • Closed date

    2014-10-30

  • Last modified date

    2014-10-30

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

    LI77898

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

Fix information

  • Fixed component name

    XL FORTRAN LINU

  • Fixed component ID

    5725C7500

Applicable component levels

  • RF10 PSY

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAT4T","label":"XL Fortran for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"15.1","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
17 October 2021