Hi Brice, I've tried:
p = hwloc_alloc_membind_policy(_topo, cnt * sizeof (T), mem_nodeset, HWLOC_MEMBIND_NEXTTOUCH, 0); and p = hwloc_alloc_membind_nodeset(_topo, cnt * sizeof (T), mem_nodeset, HWLOC_MEMBIND_NEXTTOUCH, 0); and p = hwloc_alloc(_topo, cnt * sizeof (T)); hwloc_set_area_membind_nodeset(_topo, p, cnt * sizeof (T), mem_nodeset, HWLOC_MEMBIND_NEXTTOUCH, 0); where mem_nodeset = hwloc_topology_get_complete_nodeset(_topo); Thanks,Rob From: Brice Goglin <brice.gog...@inria.fr<mailto:brice.gog...@inria.fr>> Reply-To: Hardware locality user list <hwloc-us...@open-mpi.org<mailto:hwloc-us...@open-mpi.org>> List-Post: hwloc-users@lists.open-mpi.org Date: Tue, 19 Aug 2014 18:44:05 +0200 To: Hardware locality user list <hwloc-us...@open-mpi.org<mailto:hwloc-us...@open-mpi.org>> Subject: Re: [hwloc-users] setting memory bindings Le 19/08/2014 18:38, Aulwes, Rob a écrit : Hi, I'm trying to write a custom C++ allocator that wraps hwloc calls. I've tried using various hwloc_alloc* functions to set the memory bindings, but when I call hwloc_get_area_membind_nodeset to verify, I don't get the same policy I passed to alloc. Are there example codes that show how to set memory bindings? More generally, are there example codes that help illustrate how to use hwloc API? Thanks,Rob Aulwes Hello Your problem may be related to the fact that same policies are identical on some operating systems. For instance DEFAULT and FIRST_TOUCH are often identical. What did you set and what did you get back? There are many examples in the tests subdirectory, in doc/hwloc-helloc.c and in hwloc/helper.h and hwloc/inline.h, but I don't think we have much about the membind API, and this API isn't a easy one unfortunately (given the variety of existing policies and operating systems). Brice _______________________________________________ hwloc-users mailing list hwloc-us...@open-mpi.org<mailto:hwloc-us...@open-mpi.org> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users Link to this post: http://www.open-mpi.org/community/lists/hwloc-users/2014/08/1058.php