Skip to content

Commit

Permalink
fix hwloc warning
Browse files Browse the repository at this point in the history
- fix warning depricated `hwloc_set_membind_nodeset` (since hwloc 2.0)
  • Loading branch information
psychocrypt committed Nov 25, 2019
1 parent 6212745 commit fc6200a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion xmrstak/backend/cpu/hwlocMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@

#include <hwloc.h>

static __hwloc_inline int
xmrstak_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
{
#if HWLOC_API_VERSION >= 0x20000
return hwloc_set_membind(
topology,
nodeset,
policy,
flags| HWLOC_MEMBIND_BYNODESET);
#else
return hwloc_set_membind_nodeset(
topology,
nodeset,
policy,
flags);
#endif
}

/** pin memory to NUMA node
*
* Set the default memory policy for the current thread to bind memory to the
Expand Down Expand Up @@ -37,7 +55,7 @@ void bindMemoryToNUMANode(size_t puId)
hwloc_obj_t pu = hwloc_get_obj_by_depth(topology, depth, i);
if(pu->os_index == puId)
{
if(0 > hwloc_set_membind_nodeset(
if(0 > xmrstak_set_membind_nodeset(
topology,
pu->nodeset,
HWLOC_MEMBIND_BIND,
Expand Down

0 comments on commit fc6200a

Please sign in to comment.