IBM Support

IZ56256: FIRSTPRIVATE OPENMP CLAUSE CAUSES CRASH

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using the 'firstprivate' OpenMP clause in the following
    testcase, the executable would segfault at runtime.
    
    Compile line:
    xlf_r SBP_omp_firstprivate.f90 -O3 -q64 -qsmp=omp
    -bmaxstack:0x1000000000
    
    ===== TESTCASE:
    $cat SBP_omp_firstprivate.f90
    program SBP_mono_omp
    
      implicit none
    
    !!! Attention !!! : OpenMP - Memoire necessaire : 3600 Mo + 3600
    Mo par thread
    !!! Attention !!! : Mono - Memoire necessaire : 5 Go
      integer(kind=8), parameter :: puissance = 27, n = 2**puissance
      integer(kind=8) :: i, pas, rep=200, nb_iterations
    
      print *,'\n *** IDRIS SBP ***'
      nb_iterations=n*rep
      call SBP
    
    contains
    
      subroutine SBP
        real(kind=kind(1.d0)), dimension(3*n) :: TAB
        real(kind=kind(1.d0)) :: t1, t2, tps_elapsed, tps_cpu
        real(kind=kind(1.d0)) :: debit
        integer :: nbp_max, freq_p, nbp_final_local
        integer :: nbp_init, nbp_final, numth, nbth
        !$ integer :: OMP_GET_THREAD_NUM, OMP_GET_NUM_THREADS
    
        TAB(1:n) = 1.013
        TAB(n+1:2*n) = 1.0014
        TAB(2*n+1:3*n) = 0.000012
    
        nbth=1
        !$OMP PARALLEL
         !$ nbth  = OMP_GET_NUM_THREADS()
        !$OMP END PARALLEL
    
        call system_clock(count_rate=freq_p, count_max=nbp_max)
    
        call cpu_time(t1)
        call system_clock(nbp_init)
        !Note: if you change firstprivate to private it works fine.
        !$OMP PARALLEL firstprivate(TAB)
        call CALCUL(TAB(1:n),TAB(1+n:2*n),TAB(2*n+1:3*n))
        !$OMP END PARALLEL
        call system_clock(nbp_final)
        call cpu_time(t2)
    
        if (nbp_final>nbp_init) then
           tps_elapsed=real(nbp_final-nbp_init)/real(freq_p)
        else
           tps_elapsed=real(nbp_final-nbp_init+nbp_max)/real(freq_p)
        endif
        tps_cpu=(t2-t1)/nbth
        debit = nb_iterations*4*8/(1000000*tps_elapsed)
    
        print *,'\n Resultat sur ',nbth,' threads'
    print '(" Tps elapsed, Tps CPU moy/thread, debit moy/thread = ",
    f9.2, f9.2, f9.3)' &
                ,tps_elapsed,tps_cpu,debit
      end subroutine SBP
    
      subroutine CALCUL(A,B,C)
        real(kind=kind(1.d0)), dimension(:), intent(in) :: B, C
        real(kind=kind(1.d0)), dimension(:), intent(inout) :: A
        integer(kind=8) :: i,j
    
        do j=1,rep
           do i = 1,n
              A(i)=A(i)*B(i)+C(i)
           enddo
        enddo
    
      end subroutine CALCUL
    
    end program SBP_mono_omp
    
    
    
    =====ACTUAL OUTPUT:
    $ ./a.out
    
     *** IDRIS SBP ***
    Segmentation fault(coredump)
    &
    
    
    =====EXPECTED OUTPUTS:
    $ ./a.out
    
     *** IDRIS SBP ***
    
     Resultat sur  1  threads
     Tps elapsed, Tps CPU moy/thread, debit moy/thread =     93.29
    67.95 9207.776
    $
    

Local fix

  • n/a
    

Problem summary

  • This problem was exposed when using the firstprivate OpenMP
    directive with -q64.
    
    There was an issue with the compiler optimizer where the length
    for memcpy was
    incorrectly generated as a sign extended 32 bit word in 64 bit
    mode.
    

Problem conclusion

  • The compiler optimizer has been fixed to generate the correct
    sign extended word in 64 bit mode.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ56256

  • Reported component name

    XL FORTRAN AIX

  • Reported component ID

    5724U8200

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-07-29

  • Closed date

    2009-11-16

  • Last modified date

    2009-11-16

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

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

    LI75012 LI75020

Fix information

  • Fixed component name

    XL FORTRAN AIX

  • Fixed component ID

    5724U8200

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSB259","label":"XL Fortran Advanced Edition for Linux"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
24 February 2022