Skip to content

looks like OMP nthreads is off-by-one #5

Description

@naughtont3

I just ran a test against the latest gv_pmix branch and noticed that the omp_get_thread_num() returns one less than expected. For example, if NumCpus=12 and NumRanks=2, would expect to have 6 threads but instead we get 5 threads.

  [PID:1037] DBG: LINE:1780 nthreads=5, _n_local_cpus=12, _n_local_ranks=2
  [PID:1036] DBG: LINE:1780 nthreads=5, _n_local_cpus=12, _n_local_ranks=2
 ...<snip>...
  [mpi_omp_hello.c:main:48] In parallel loop: calling omp_get_thread_num()...
  [mpi_omp_hello.c:main:50] omp_get_thread_num() succeeded
  Number of threads = 5

Looks like this is related to kmp_runtime.cpp#L1779.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions