[all-commits] [llvm/llvm-project] 9830a5: [OpenMP] Fix for smaller team sizes inside teams c...

Terry Wilmarth via All-commits all-commits at lists.llvm.org
Wed Jan 11 09:24:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9830a5d0c19b8d5165735e39343b7174addd94a0
      https://github.com/llvm/llvm-project/commit/9830a5d0c19b8d5165735e39343b7174addd94a0
  Author: Terry Wilmarth <terry.l.wilmarth at intel.com>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M openmp/runtime/src/kmp_runtime.cpp
    A openmp/runtime/test/teams/teams_resize.c

  Log Message:
  -----------
  [OpenMP] Fix for smaller team sizes inside teams construct.

When a team nested inside a teams construct is allocated, it is
allocated to a size specified by the teams thread_limit.  In the case
where any mechanism that might not grant the full thread_limit is in
use, we may get a smaller team.  This possibility was not reflected in
the code when using the th_teams_size.nth value stored on the master
thread for the team. This value was never updated even when t_nproc on
the team itself was different.  I added a line to update it shortly
before the team is forked.

Added a simple teams test that uses KMP_DYNAMIC_MODE=random to mimic
allocating teams with sizes <= thread_limit. Eventually, this
will segfault without the fix in this commit.

Differential Revision: https://reviews.llvm.org/D139960




More information about the All-commits mailing list