Skip to content

Commit

Permalink
Improve hwloc version checks for HWLOC_OBJ_NUMANODE and HWLOC_MEMBIND…
Browse files Browse the repository at this point in the history
…_BYNODESET
  • Loading branch information
biddisco committed Oct 30, 2017
1 parent 6d4d6c5 commit e9881e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/threads/policies/hwloc_topology_info.cpp
Expand Up @@ -33,6 +33,10 @@

#include <hwloc.h>

#if HWLOC_API_VERSION < 0x00010b00
# define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
#endif

This comment has been minimized.

Copy link
@hkaiser

hkaiser Oct 30, 2017

Member

@biddisco: Why is this needed if the code below guards the use of HWLOC_OBJ_NUMANODE with a higher HWLOC API version?

This comment has been minimized.

Copy link
@biddisco

biddisco Oct 31, 2017

Author Contributor

because HWLOC_OBJ_NUMANODE is used in other places that are not protected. HWLOC_OBJ_NODE was deprecated and replaced by HWLOC_OBJ_NUMANODE and the hwloc version API var is actually incorrect in all recent versions of hwloc (the developers apologise).

I will clean this up when I move everything to hwloc 2.0

This comment has been minimized.

Copy link
@hkaiser

hkaiser Oct 31, 2017

Member

Ok, thanks for this clarification. The question is whether we should really enforce the use of hwloc V2.0. This is something I'd like to properly discuss (on the mailing list).


namespace hpx { namespace threads
{
///////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1174,7 +1178,7 @@ namespace hpx { namespace threads

int hwloc_topology_info::get_numa_domain(const void *addr, void *nodeset) const
{
#if HWLOC_API_VERSION >= 0x00010b00
#if HWLOC_API_VERSION >= 0x00010b03
hwloc_nodeset_t ns = reinterpret_cast<hwloc_nodeset_t>(nodeset);
int ret = hwloc_get_area_memlocation(topo, addr, 1, ns,
HWLOC_MEMBIND_BYNODESET);
Expand Down

0 comments on commit e9881e7

Please sign in to comment.