Skip to content

Commit

Permalink
Fix daphne-eu#650: destroy hwloc_topology_t instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Guilloteau authored and Quentin Guilloteau committed Jan 22, 2024
1 parent ccba938 commit 1ecb54b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/runtime/local/vectorized/MTWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ class MTWrapperBase {
}

void get_topology(std::vector<int> &physicalIds, std::vector<int> &uniqueThreads, std::vector<int> &responsibleThreads) {
hwloc_topology_t topology;
hwloc_topology_t topology;

hwloc_topology_init(&topology);
hwloc_topology_load(topology);
hwloc_topology_init(&topology);
hwloc_topology_load(topology);

physicalIds.resize(hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PACKAGE));
uniqueThreads.resize(hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE));
responsibleThreads.resize(hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PU));
physicalIds.resize(hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PACKAGE));
uniqueThreads.resize(hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE));
responsibleThreads.resize(hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PU));

hwloc_topology_destroy(topology);
}

void initCPPWorkers(std::vector<TaskQueue *> &qvector, uint32_t batchSize, const bool verbose = false,
Expand Down

0 comments on commit 1ecb54b

Please sign in to comment.