Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Users mailing list

Subject: Re: [hwloc-users] q about mem binding API usage
From: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2012-05-31 11:28:24


Vlad, le Thu 31 May 2012 16:49:00 +0200, a écrit :
> This might be a naive question, but I'd like to clarify nonetheless: to provide
> any sort of affinity guarantees, hwloc mem binding APIs assume that any memory
> allocation is done exclusively via hwloc_alloc_membind() and friends?  And if I
> use "raw" calls to malloc() or posix_memalign() etc then any ensuing affinity
> will be incidental at best?

It seems the documentation lacks explanation about that indeed. I have
added the following text:

  Memory binding can be done three ways:
  - explicit memory allocation thanks to hwloc_alloc_membind and friends: the
    binding will have effect on the memory allocated by these functions.
  - implicit memory binding through binding policy: hwloc_set_membind and
    friends only define the current policy of the process, which will be
    applied to the subsequent calls to malloc() and friends.
  - migration of existing memory ranges, thanks to hwloc_set_area_membind()
    and friends, which move already-allocated data.

Does it answer your question? (i.e. the first way doesn't have effect on
malloc, while the second way does)