Skip to content

Commit

Permalink
hwloc.h+bind.1in: add a note about hwloc bind policy != linux bind
Browse files Browse the repository at this point in the history
Refs #601.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
(cherry picked from commit 639d09e)
bgoglin committed Jul 4, 2023
1 parent 2928148 commit f5cffaf
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions include/hwloc.h
Original file line number Diff line number Diff line change
@@ -1484,6 +1484,12 @@ typedef enum {
HWLOC_MEMBIND_FIRSTTOUCH = 1,

/** \brief Allocate memory on the specified nodes.
*
* The actual behavior may slightly vary between operating systems,
* especially when (some of) the requested nodes are full.
* On Linux, by default, the MPOL_PREFERRED_MANY (or MPOL_PREFERRED) policy
* is used. However, if the hwloc strict flag is also given, the Linux
* MPOL_BIND policy is rather used.
* \hideinitializer */
HWLOC_MEMBIND_BIND = 2,

13 changes: 11 additions & 2 deletions utils/hwloc/hwloc-bind.1in
Original file line number Diff line number Diff line change
@@ -100,13 +100,22 @@ the default policy is bind.
.TP
\fB\-\-mempolicy\fR <policy>
Change the memory binding policy.
The available policies are default, firsttouch, bind, interleave
and nexttouch.

This option is only meaningful when an actual binding is also given
with \fB\-\-membind\fR.
If \fB\-\-membind\fR is given without \fB\-\-mempolicy\fR,
the default policy is bind.

The available policies are \fBdefault\fR, \fBfirsttouch\fR,
\fBbind\fR, \fBinterleave\fR and \fBnexttouch\fR.
See hwloc.h for details about these policies.

Note that hwloc's memory binding policies may be slightly different
from operating system policies.
For instance, the hwloc \fBbind\fR policy uses Linux \fIMPOL_PREFERRED_MANY\fR
(or \fIMPOL_PREFERRED\fR) by default, but it switches to Linux \fIMPOL_BIND\fR
if the hwloc strict option or flag is also given.

.TP
\fB\-\-get\fR
Report the current bindings.

0 comments on commit f5cffaf

Please sign in to comment.