Open MPI logo

Hardware Locality Users' Mailing List Archives

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

Subject: Re: [hwloc-users] on using hwloc_get_area_membind_nodeset
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2011-07-05 14:34:40

Le 05/07/2011 20:13, Alfredo Buttari a écrit :
> Hi all,
> if I understand correctly this routine can tell on which NUMA node(s)
> a specific memory area resides, is this correct?
> Will this routine work on any memory area allocated with any
> allocation routine other than those provided by hwloc?
> Can anybody provide a simple example of usage of this routine?
> I tried something simple like this
> hwloc_topology_t topology;
> int *a;
> hwloc_membind_policy_t *policy;
> hwloc_nodeset_t nodeset;
> hwloc_topology_init(&topology);
> hwloc_topology_load(topology);
> a = (int *) malloc(1000*sizeof(int));
> nodeset = hwloc_bitmap_alloc();
> ret = hwloc_get_area_membind_nodeset( topology, a,
> 1000*sizeof(int), nodeset, policy, HWLOC_MEMBIND_STRICT);
> printf("---> %d\n",ret);
> hwloc_topology_destroy(topology);
> but I'm always getting a -1 in ret. What's wrong?


You're running Linux and errno is ENOSYS, right? From what I remember,
it's not supported on Linux because getting memory binding is very
poorly supported. I think we could implement it but it would be very
slow (one get_mempolicy syscall per virtual page or something like that).