open-mpi/hwloc

add memory binding API

Closed this issue · 13 comments

  • add hwloc_set_membind(topology, beginaddr, endaddr, HWLOC_MEMBIND_BIND/FIRSTTOUCH/INTERLEAVE, hwloc_cpuset_t)
    • size instead of endaddr?
    • if beginaddr=endaddr=NULL, setmempolicy?
    • reverse routine?
    • no level = empty mask, and we may want an easy alias for "whole machine"
  • allocation with a given policy
    • get Samuel's code from pm2's marcel_sysdep.c
  • apply a policy to a given area (not all OSes support that).

Imported from trac issue 9. Created by bgoglin on 2009-09-25T12:24:20, last modified: 2012-12-22T03:18:41

Trac comment by bgoglin on 2010-07-17 05:05:48:

(In [2339]) Baby step towards memory binding:

  • add hwloc_set/get_membind
  • add --cpubind/--membind options to hwloc-bind
  • support default, bind, preferred, interleave policies
  • get_membind retrieves the policy as well as the cpuset
  • strict flag not used so far

Many things to do:

  • only implemented on Linux
  • no support for other pids
  • no support for address ranges
  • no support bitmask yet
  • the strict flag and binding policy might be better in different
    parameters of the functions (the former is always input while
    the latter is output if get_membind)

Refs #9

Trac comment by sthibaul on 2010-07-29 12:49:26:

(In [2371]) Activate membind support in hwloc-bind
Refs #9

Trac comment by sthibaul on 2010-07-29 12:52:29:

See also r2370:

  • Add stubs for other pids, address range, allocation, no implementation yet.
  • Replace MEMBIND_BIND/PREFERRED with BIND/STRICT.
  • Add MIGRATE, no implementation yet.
  • Add support bitmask.

Trac comment by sthibaul on 2010-07-29 13:24:56:

(In [2372]) add memory bind test, a few fixes. Refs #9.

Trac comment by sthibaul on 2010-07-30 03:36:47:

(In [2374]) * alloc_membind replacement when the OS doesn't have it but has set_area_membind. Refs #9.

Trac comment by sthibaul on 2010-07-30 09:44:56:

(In [2391]) Add hwloc_cpuset_from/to_nodeset. Refs #9.

Trac comment by sthibaul on 2010-07-30 10:51:31:

(In [2393]) Add alloc_membind for AIX and OSF. Refs #9.

Trac comment by sthibaul on 2010-09-16 11:52:25:

One problem I have is that at least AIX and Solaris provide memory allocation policy functions, but they also set the thread binding at the same time. I don't have a machine to check, but on Solaris you might even just not be able to have a thread and its allocated memory on different nodes: moving the thread using lgrp_affinity_set after allocating data perhaps just migrates memory.

Trac comment by bgoglin on 2010-09-17 03:55:20:

Do nothing on AIX and Solaris when STRICT is given then?

Trac comment by sthibaul on 2010-09-17 12:20:39:

Well, it's not so easy:

  • hwloc_set_cpubind(STRICT);
  • hwloc_set_proc_membind();

doing binding in membind will override the strict cpubind.

Trac comment by bgoglin on 2010-10-28 10:37:26:

(In [2651]) Merge membind branch into trunk

This commit fixes #9.

Trac comment by bgoglin on 2011-03-29 13:36:23:

Milestone v1.1 deleted