[Openmp-commits] [PATCH] D102188: Add experimental nesting mode
Terry Wilmarth via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Mon May 10 12:59:57 PDT 2021
tlwilmar created this revision.
tlwilmar added reviewers: jlpeyton, AndreyChurbanov.
tlwilmar added a project: OpenMP.
tlwilmar requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Nesting mode is a new experimental feature in the OpenMP runtime. It allows a user to set up nesting for an application in a way that corresponds to the hardware topology levels on the machine an application is being run on. For example, if a machine has 2 sockets, each with 12 cores, then use of nesting mode could set up an outer level of nesting that uses 2 threads per parallel region, and an inner level of nesting that uses 12 threads per parallel region.
Nesting mode is controlled with the KMP_NESTING_MODE environment variable as follows:
1. KMP_NESTING_MODE = 0: nesting mode is off (default); max-active-levels-var is set to 1 (the default -- nesting is off, nested parallel regions are serialized).
2. KMP_NESTING_MODE = 1: nesting mode is on, and a number of threads will be assigned for each level discovered in the machine topology; max-active-levels-var is set to the number of levels discovered.
If the user sets OMP_NUM_THREADS or OMP_MAX_ACTIVE_LEVELS, they will override KMP_NESTING_MODE settings for the associated environment variables. The detected topology may be limited by an affinity mask setting on the initial thread, or if the user sets KMP_HW_SUBSET. See also: KMP_HOT_TEAMS_MAX_LEVEL for controlling use of hot teams for nested parallel regions. Note that this feature only sets numbers of threads used at nesting levels. The user should make use of OMP_PLACES and OMP_PROC_BIND or KMP_AFFINITY for affinitizing those threads, if desired.
Repository:
rOMP OpenMP
https://reviews.llvm.org/D102188
Files:
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_ftn_entry.h
openmp/runtime/src/kmp_global.cpp
openmp/runtime/src/kmp_runtime.cpp
openmp/runtime/src/kmp_settings.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102188.344162.patch
Type: text/x-patch
Size: 7372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210510/02a2df43/attachment.bin>
More information about the Openmp-commits
mailing list