IBM Support

LI75389: INCORRECT OUTPUT WITH OMP_SCHEDULE

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following test case produces incorrect output for
    OMP_SCHEDULE=DYNAMIC and OMP_SCHEDULE=GUIDED.
    
    
    
    $cat workshare.f90
    program workshare
    !$ use OMP_LIB
      implicit none
      integer, parameter           :: n=100
      integer                      :: i, j, num_th
      real(kind=8), dimension(n,n) :: a
    !$ integer                     :: nb_taches
      !$OMP PARALLEL
      !$ nb_taches = OMP_GET_NUM_THREADS()
      !$OMP END PARALLEL
      !$ print '(3X,"Parallel execution with ",i2,"
    threads")',nb_taches
      a(:,:)=1
      !$OMP PARALLEL PRIVATE(num_th)
      !$  num_th= OMP_GET_THREAD_NUM()
      !$OMP WORKSHARE
      forall (i=2:n, j=1:n-1, i>j) a(j,i) = a(i,j)
      forall (i=1:n) a(i,i) = a(i,i) + 800.0_8
      !$OMP END WORKSHARE
      if (num_th == 0) print*,"Sum = ",sum(a)
    !$OMP END PARALLEL
    end program workshare
    
    $cat submit.sh
    cd ./
    make all
    echo Monoprocessor
    echo
    ./workshare_mono.exe
    echo
    echo OMP_SCHEDULE=STATIC
    export OMP_SCHEDULE="STATIC"
    ./workshare_omp.exe
    echo
    echo OMP_SCHEDULE=DYNAMIC
    export OMP_SCHEDULE="DYNAMIC"
    ./workshare_omp.exe
    echo
    echo OMP_SCHEDULE=GUIDED
    export OMP_SCHEDULE="GUIDED"
    ./workshare_omp.exe
    echo
    echo The END.
    
    $cat Makefile
    FC =xlf90_r
    
    
    LDFLAGS =
    OMP = -qsmp=omp
    CMD = workshare
    SRC     = workshare.f90
    OBJ     = workshare.o
    FFLAGS = -qfree=f90 -O3
    all: mono para
    mono:
            $(FC) $(FFLAGS) -c $(SRC)
            $(FC) $(LDFLAGS) $(OBJ) -o $(CMD)_mono.exe
    para:
            $(FC) $(FFLAGS) $(OMP) -c $(SRC)
            $(FC) $(LDFLAGS) $(OMP) $(OBJ) -o $(CMD)_omp.exe
    clean:
            rm *.o *.exe
    
    $./submit.sh
    
    Monoprocessor
    
     Sum =  90000.0000000000000
    
    OMP_SCHEDULE=STATIC
       Parallel execution with  4 threads
     Sum =  90000.0000000000000
    
    OMP_SCHEDULE=DYNAMIC
       Parallel execution with  4 threads
     Sum =  -0.392987997483186611E+233
    
    OMP_SCHEDULE=GUIDED
       Parallel execution with  4 threads
     Sum =  72378.0000000000000
    

Local fix

  • N/A
    

Problem summary

  • PROBLEM DESCRIPTION:
    When a forall statement that performs array self-assignment
    appears in a worksharing construct, the self-assigned array may
    get corrupted under the dynamic or guided OMP scheduling.
    
    USERS AFFECTED:
    Users of forall statements that perform array self-assignment
    inside a worksharing construct and run their application under
    the dynamic or guided OMP scheduling.
    
    The test case can be simplied further:
    
    program workshare
    use OMP_LIB
    implicit none
    integer, parameter           :: n=10
    integer                      :: i, j, num_th
    real(kind=4), dimension(n,n) :: a
    
    a(:,:)=1
    
    !$OMP PARALLEL num_threads(4) private(i,j)
    !$OMP WORKSHARE
    forall (i=2:n, j=1:n-1, i>j) a(j,i) = a(i,j)
    !$OMP END WORKSHARE
    !$OMP END PARALLEL
    print *, sum(a)
    
    end program workshare
    

Problem conclusion

  • Made compiler temporary variable created for self-assignment
    inside forall non-private; the problem is fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75389

  • Reported component name

    XL FORTRAN RHEL

  • Reported component ID

    5724U8410

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-04-27

  • Closed date

    2010-04-27

  • Last modified date

    2010-04-27

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

    IZ69674

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

Fix information

  • Fixed component name

    XL FORTRAN RHEL

  • Fixed component ID

    5724U8410

Applicable component levels

  • RC10 PSY

       UP

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

Document Information

Modified date:
24 February 2022