IBM Support

LI75895: ISSUES WITH BINDING THREADS TO PROCESSORS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The test case makes use of "omp_set_num_threads" and is being
    set to 7, which should override the "export OMP_NUM_THREADS=1"
    env variable.
    
    The issue seems to be that, even though "export
    XLSMPOPTS=procs=2,4,6,8" is set and whenever OMP_NUM_THREADS is
    lower than the number specified in omp_set_num_threads,
    some threads are bound on processor #0.
    Also, when OMP_NUM_THREADS=1, all the threads seem to be bound
    to process#0 which seems to slow down clients' applications or
    may cause application segfault.
    
    ===== Compile Command:
    xlc_r -qsmp=omp -o a.out test.c -q64
    
    ===== TESTCASE:
    $cat test.c
    #include <stdlib.h>
    #include <stdio.h>
    #include <omp.h>
    int main(int argc, char **argv) {
    int x;
    if(argc>1) omp_set_num_threads(atoi(argv[1]));
    #pragma omp parallel
     {
     printf("Thread# %d\n", omp_get_thread_num());
     sleep(180);
     }
    }
    $
    
    
    ===== ACTUAL OUTPUT:
    $export XLSMPOPTS=procs=2,4,6,8
    $export OMP_NUM_THREADS=1
    $ ./a.out 7&
    [1]     1106068
    Thread# 0
    Thread# 1
    Thread# 2
    Thread# 3
    Thread# 4
    Thread# 5
    Thread# 6
    $
    $ ps -mo THREAD -p 1106068
        USER     PID    PPID      TID ST  CP PRI SC    WCHAN
    F     TT BND COMMAND
    bkanneth 1106068 2105588        - A    0  60  8        *
    200001 pts/227   0 ./a.out 7
           -       -       -  1016047 S    0  68  1 f1000131193e4fb0
    410410      -   0 -
           -       -       -  1659093 S    0  68  1 f10001017840fb30
    410410      -   0 -
           -       -       -  2154731 S    0  60  1        -
    2400400      -   0 -
           -       -       -  2576479 S    0  68  1 f10001017cb73130
    410410      -   0 -
           -       -       -  3391585 S    0  68  1 f10001017840f330
    410410      -   0 -
           -       -       -  3395627 S    0  68  1 f1000101b62ac7b0
    410410      -   0 -
           -       -       -  3870913 S    0  68  1 f10001017840f430
    410410      -   0 -
           -       -       -  3985495 S    0  68  1 f1000123bce1a5b0
    410410      -   0 -
    $
    
    
    
    ===== EXPECTED OUTPUT:
    All the threads should not be bound to processor #0
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    OpenMP users who set the number of threads in
    their program may be affected by this issue.
    
    PROBLEM DESCRIPTION:
    The thread binding information from XLSMPOPTS is deleted after
    the smprt is initialized, so, when new threads are created, they
    will not have the right binding.
    

Problem conclusion

  • The binding information is now perserved so that it
    could be used later on.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75895

  • Reported component name

    XL C/C++ RHEL52

  • Reported component ID

    5724U8310

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-01-27

  • Closed date

    2011-01-27

  • Last modified date

    2011-01-27

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

    IZ81059

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

Fix information

  • Fixed component name

    XL C/C++ RHEL52

  • Fixed component ID

    5724U8310

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
15 October 2021