You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users can put a : in front of KMP_HW_SUBSET to indicate that the
specified subset is an "absolute" subset. Currently, when a user puts
KMP_HW_SUBSET=1t. This gets translated to KMP_HW_SUBSET="*s,*c,1t",
where * means "use all of". If a user wants only one thread as the
entire topology they can now do KMP_HW_SUBSET=:1t.
Along with the absolute syntax is a fix for newer machines and making
them easier to use with only the 3-level topology syntax. When a user
puts KMP_HW_SUBSET=1s,4c,2t on a machine which actually has 4 layers,
(say 1s,2m,3c,2t as the entire machine) the user gets an unexpected "too
many resources asked" message because KMP_HW_SUBSET currently translates
the "4c" value to mean 4 cores per module. To help users out, the
runtime can assume that these newer layers, module in this case, should
be ignored if they are not specified, but the topology should always
take into account the sockets, cores, and threads layers.
An optional colon (:) can be specified at the beginning of the syntax to specify an explicit hardware subset. The default is an implicit hardware subset.
500
502
501
503
Supported unit IDs are not case-insensitive.
502
504
@@ -547,6 +549,18 @@ When any numa or tile units are specified in ``KMP_HW_SUBSET`` and the hwloc
547
549
topology method is available, the ``KMP_TOPOLOGY_METHOD`` will be automatically
548
550
set to hwloc, so there is no need to set it explicitly.
549
551
552
+
For an **explicit hardware subset**, if one or more topology layers detected by the
553
+
runtime are omitted from the subset, then those topology layers are ignored.
554
+
Only explicitly specified topology layers are used in the subset.
555
+
556
+
For an **implicit hardware subset**, it is implied that the socket, core, and thread
557
+
topology types should be included in the subset. Other topology layers are not
558
+
implicitly included and are ignored if they are not specified in the subset.
559
+
Because the socket, core and thread topology types are always included in
560
+
implicit hardware subsets, when they are omitted, it is assumed that all
561
+
available resources of that type should be used. Implicit hardware subsets are
562
+
the default.
563
+
550
564
If you don't specify one or more types of resource, such as socket or thread,
551
565
all available resources of that type are used.
552
566
@@ -565,7 +579,7 @@ This variable does not work if ``KMP_AFFINITY=disabled``.
565
579
**Default:** If omitted, the default value is to use all the
566
580
available hardware resources.
567
581
568
-
**Examples:**
582
+
**Implicit Hardware Subset Examples:**
569
583
570
584
* ``2s,4c,2t``: Use the first 2 sockets (s0 and s1), the first 4 cores on each
571
585
socket (c0 - c3), and 2 threads per core.
@@ -590,6 +604,12 @@ available hardware resources.
590
604
* ``*c:eff1@3``: Use all available sockets, skip the first three cores of
591
605
efficiency 1, and then use the rest of the available cores of efficiency 1.
592
606
607
+
Explicit Hardware Subset Examples:
608
+
609
+
* ``:2s,6t`` Use exactly the first two sockets and 6 threads per socket.
610
+
* ``:1t@7`` Skip the first 7 threads (t0-t6) and use exactly one thread (t7).
611
+
* ``:5c,1t`` Use exactly the first 5 cores (c0-c4) and the first thread on each core.
612
+
593
613
To see the result of the setting, you can specify ``verbose`` modifier in
594
614
``KMP_AFFINITY`` environment variable. The OpenMP run-time library will output
595
615
to ``stderr`` the information about the discovered hardware topology before and
0 commit comments