Open MPI logo

Hardware Locality Development Mailing List Archives

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

Subject: Re: [hwloc-devel] [hwloc-svn] svn:hwloc r2339
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2010-07-17 06:34:02

Le 17/07/2010 11:47, Samuel Thibault a écrit :
> bgoglin_at_[hidden], le Sat 17 Jul 2010 05:05:46 -0400, a écrit :
>> +/** \brief Bind current process memory on memory nodes near the given cpuset \p set
>> + *
>> + * \return ENOSYS if the action is not supported
>> + * \return EXDEV if the binding cannot be enforced
>> + */
>> +HWLOC_DECLSPEC int hwloc_set_membind(hwloc_topology_t topology, hwloc_const_cpuset_t set, int policy);
>> +
>> +/** \brief Get current process memory binding
>> + */
>> +HWLOC_DECLSPEC int hwloc_get_membind(hwloc_topology_t topology, hwloc_cpuset_t set, int * policy);
>> +
>> +
> Mmm, I wouldn't have thought of providing the places by giving a cpuset.
> Why not using nodesets?

If we really start using nodesets intensively, we shouldn't use
hwloc_cpuset_t for their type, it's confusing. Maybe #define
hwloc_nodeset_t hwloc_cpuset_t and add a big comment saying that
nodesets may be manipulated with cpuset functions? Not very satisfying
but better than duplicating the whole API for nodesets? Or replace
hwloc_cpuset_t with hwloc_set_t everywhere and add many #define in
hwloc/cpuset.h for backward API compatibility?

Then, we'd need some conversion routines such as
hwloc_cpuset_from/to_nodeset(topology, cpuset, nodeset). And a big
comment saying that we don't duplicate all helpers from nodesets and
that people should convert to cpusets before using helpers.