IBM Support

LI76992: OMP_SET_SCHEDULE CALL IS IGNORED

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When the OMP_SCHEDULE env variable is set, there exists a couple
    of 2 for each thread for the following test case.
    But when the OMP_SCHEDULE is unset and omp_set_schedule() is
    used, we don't see a couple of 2 per thread.
    
    
    ===== COMPILE COMMAND:
    xlf95_r -c -q64 -qsmp=omp:noopt -o helloworld.o helloworld.f95
    
    
    ===== TESTCASE:
    $ cat helloworld.f95
    PROGRAM helloworld
      use omp_lib
    
      IMPLICIT NONE
    
      INTEGER :: i, foo, ompmodifier
      integer(kind=omp_sched_kind) :: ompsched
      CHARACTER (LEN=16) :: ENVDATA
    
    !$OMP parallel
      PRINT *,'thread ',omp_get_thread_num(),' of
    ',omp_get_num_threads()
    !$OMP end parallel
    
      foo = 0
    
    !$OMP parallel
      CALL GETENV('OMP_SCHEDULE', VALUE=ENVDATA)
      PRINT *,'thread ',omp_get_thread_num(),' has env ', envdata
      call omp_set_schedule(omp_sched_static,2)
      call omp_get_schedule(ompsched,ompmodifier)
    
      PRINT *,'thread ',omp_get_thread_num(),' has schedule ',
    ompsched,' ', ompmodifier
    !$OMP do private(i) reduction(+:foo) schedule(runtime)
      DO i=1,6
        foo = foo + i
        PRINT *,'thread ',omp_get_thread_num(),' has item ', i
      END DO
    !$OMP end do
    
    !$OMP end parallel
    
    END PROGRAM helloworld
    $
    
    
    ===== ACTUAL OUTPUT:
    $export OMP_NUM_THREADS=2
    $./helloworld
     thread  0  of  2
     thread  1  of  2
     thread  0  has env
     thread  0  has schedule  1   2
     thread  1  has env
     thread  1  has schedule  1   2
     thread  1  has item  4
     thread  1  has item  5
     thread  1  has item  6
     thread  0  has item  1
     thread  0  has item  2
     thread  0  has item  3
    $
    
    
    
    ===== EXPECTED OUTPUT:
    Should give the same output as when OMP_SCHEDULE env variable is
    set to "static,2" as shown below because
    the program internally calls
    omp_get_schedule(omp_sched_static,2)
    
    $export OMP_NUM_THREADS=2
    $export OMP_SCHEDULE=static,2
    $./helloworld
     thread  0  of  2
     thread  1  of  2
     thread  0  has env static,2
     thread  0  has schedule  1   2
     thread  1  has env static,2
     thread  1  has schedule  1   2
     thread  1  has item  3
     thread  1  has item  4
     thread  0  has item  1
     thread  0  has item  2
     thread  0  has item  5
     thread  0  has item  6
    $
    

Local fix

  • n/a
    

Problem summary

  • USERS AFFECTED:
    Any OpenMP users that wish to change the runtime schedule of
    loops while the program is running is affected by this issue.
    
    PROBLEM DESCRIPTION:
    The omp_set_schedule call is effectively being ignored by the
    SMP Runtime.
    This means that users cannot dynamically change the schedule of
    runtime scheduled loops, as described in the OpenMP
    specification.
    

Problem conclusion

  • The runtime is currently recording the values for the schedule
    and the modifier,
    as specified in the omp_set_schedule call. However, when it
    sets up the chunks for the parallel loop,
    it is not using the overwritten values. Instead it is using the
    default value provided in the OMP_SCHEDULE environment
    variable.
    This has been fixed.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76992

  • Reported component name

    XL FORTRAN LINU

  • Reported component ID

    5725C7500

  • Reported release

    E10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-08-28

  • Closed date

    2012-08-28

  • Last modified date

    2012-08-28

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

    IV20901

  • 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

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

Document Information

Modified date:
16 October 2021