Skip to content

Commit 639d09e

Browse files
committed
hwloc.h+bind.1in: add a note about hwloc bind policy != linux bind
Refs #601. Signed-off-by: Brice Goglin <[email protected]>
1 parent b9249d1 commit 639d09e

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

include/hwloc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,12 @@ typedef enum {
15071507
HWLOC_MEMBIND_FIRSTTOUCH = 1,
15081508

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

utils/hwloc/hwloc-bind.1in

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,22 @@ the default policy is bind.
100100
.TP
101101
\fB\-\-mempolicy\fR <policy>
102102
Change the memory binding policy.
103-
The available policies are default, firsttouch, bind, interleave
104-
and nexttouch.
103+
105104
This option is only meaningful when an actual binding is also given
106105
with \fB\-\-membind\fR.
107106
If \fB\-\-membind\fR is given without \fB\-\-mempolicy\fR,
108107
the default policy is bind.
109108

109+
The available policies are \fBdefault\fR, \fBfirsttouch\fR,
110+
\fBbind\fR, \fBinterleave\fR and \fBnexttouch\fR.
111+
See hwloc.h for details about these policies.
112+
113+
Note that hwloc's memory binding policies may be slightly different
114+
from operating system policies.
115+
For instance, the hwloc \fBbind\fR policy uses Linux \fIMPOL_PREFERRED_MANY\fR
116+
(or \fIMPOL_PREFERRED\fR) by default, but it switches to Linux \fIMPOL_BIND\fR
117+
if the hwloc strict option or flag is also given.
118+
110119
.TP
111120
\fB\-\-get\fR
112121
Report the current bindings.

0 commit comments

Comments
 (0)