Skip to content

Commit 400b073

Browse files
Merge pull request #351 from insertinterestingnamehere/cmake
Properly Route HWLOC_GET_TOPOLOGY_FUNCTION
2 parents 2893988 + f9ed7ac commit 400b073

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/affinity/binders.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ static int qt_affinity_compact(int num_workers, hwloc_obj_t obj) {
8787
void INTERNAL qt_affinity_init(qthread_shepherd_id_t *nbshepherds,
8888
qthread_worker_id_t *nbworkers,
8989
size_t *hw_par) {
90+
#ifdef HWLOC_GET_TOPOLOGY_FUNCTION
91+
extern void *HWLOC_GET_TOPOLOGY_FUNCTION;
92+
topology = (hwloc_topology_t)HWLOC_GET_TOPOLOGY_FUNCTION;
93+
#endif
9094
// Note: the lack of a teardown routine will cause topology initialization
9195
// to be skipped if qthreads is re-initialized
9296
if (topology == NULL) {

src/affinity/hwloc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ void INTERNAL qt_affinity_init(qthread_shepherd_id_t *nbshepherds,
8686
qthread_worker_id_t *nbworkers,
8787
size_t *hw_par) {
8888
if (qthread_cas(&initialized, 0, 1) == 0) {
89+
#ifdef HWLOC_GET_TOPOLOGY_FUNCTION
90+
extern void *HWLOC_GET_TOPOLOGY_FUNCTION;
91+
topology = (hwloc_topology_t)HWLOC_GET_TOPOLOGY_FUNCTION;
92+
#endif
8993
if (topology == NULL) {
9094
qassert(hwloc_topology_init(&topology), 0);
9195
qassert(hwloc_topology_load(topology), 0);

0 commit comments

Comments
 (0)