Skip to content
Snippets Groups Projects
Commit 3ec7fa7c authored by fireice-uk's avatar fireice-uk
Browse files

make hwloc check capabilities and stop it from leaking mem

parent dcd176ad
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,13 @@ void bindMemoryToNUMANode( size_t puId ) ...@@ -21,6 +21,13 @@ void bindMemoryToNUMANode( size_t puId )
hwloc_topology_init(&topology); hwloc_topology_init(&topology);
hwloc_topology_load(topology); hwloc_topology_load(topology);
if(!hwloc_topology_get_support(topology)->membind->set_thisthread_membind)
{
printer::inst()->print_msg(L0, "hwloc: set_thisthread_membind not supported");
hwloc_topology_destroy(topology);
return;
}
depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU); depth = hwloc_get_type_depth(topology, HWLOC_OBJ_PU);
for( size_t i = 0; for( size_t i = 0;
...@@ -45,6 +52,8 @@ void bindMemoryToNUMANode( size_t puId ) ...@@ -45,6 +52,8 @@ void bindMemoryToNUMANode( size_t puId )
} }
} }
} }
hwloc_topology_destroy(topology);
} }
#else #else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment