Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/affinity/binders.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ static int qt_affinity_compact(int num_workers, hwloc_obj_t obj) {
void INTERNAL qt_affinity_init(qthread_shepherd_id_t *nbshepherds,
qthread_worker_id_t *nbworkers,
size_t *hw_par) {
#ifdef HWLOC_GET_TOPOLOGY_FUNCTION
extern void *HWLOC_GET_TOPOLOGY_FUNCTION;
topology = (hwloc_topology_t)HWLOC_GET_TOPOLOGY_FUNCTION;
#endif
// Note: the lack of a teardown routine will cause topology initialization
// to be skipped if qthreads is re-initialized
if (topology == NULL) {
Expand Down
4 changes: 4 additions & 0 deletions src/affinity/hwloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ void INTERNAL qt_affinity_init(qthread_shepherd_id_t *nbshepherds,
qthread_worker_id_t *nbworkers,
size_t *hw_par) {
if (qthread_cas(&initialized, 0, 1) == 0) {
#ifdef HWLOC_GET_TOPOLOGY_FUNCTION
extern void *HWLOC_GET_TOPOLOGY_FUNCTION;
topology = (hwloc_topology_t)HWLOC_GET_TOPOLOGY_FUNCTION;
#endif
if (topology == NULL) {
qassert(hwloc_topology_init(&topology), 0);
qassert(hwloc_topology_load(topology), 0);
Expand Down
Loading