Skip to content

Commit

Permalink
Protect against stone age HWLOC versions
Browse files Browse the repository at this point in the history
Provide a missing function in cases where we are building
against HWLOC pre-v1.10.

Signed-off-by: Ralph Castain <[email protected]>
(cherry picked from commit 58650f8)
  • Loading branch information
rhc54 committed Jan 24, 2022
1 parent 571a4f3 commit bd34aee
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/hwloc/hwloc-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* Copyright (c) 2021 Nanook Consulting. All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -31,10 +31,20 @@
# include <hwloc/shmem.h>
#endif

#if HWLOC_API_VERSION < 0x00010b00
#if HWLOC_API_VERSION < 0x10b00
#define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
#define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
#endif
#if HWLOC_API_VERSION < 0x10a00
static inline hwloc_obj_t hwloc_get_numanode_obj_by_os_index(hwloc_topology_t topology, unsigned os_index)
{
hwloc_obj_t obj = NULL;
while ((obj = hwloc_get_next_obj_by_type(topology, HWLOC_OBJ_NUMANODE, obj)) != NULL)
if (obj->os_index == os_index)
return obj;
return NULL;
}
#endif

#include "src/class/prte_list.h"
#include "src/class/prte_value_array.h"
Expand Down

0 comments on commit bd34aee

Please sign in to comment.