1
1

hwloc/base: fix opal proc locality wrt to NUMA nodes on hwloc 1.11

Build was broken by mistake in commit d40662edc41a5a4d09ae690b640cfdeeb24e15a1

Fixes #7362

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
(cherry picked from commit 907ad854b46b42ae7cb1e9c87238691a5cc25e36)
Этот коммит содержится в:
Brice Goglin 2020-02-04 22:20:27 +01:00 коммит произвёл Geoffrey Paulsen
родитель 6702a4febb
Коммит f136804c45

Просмотреть файл

@ -19,8 +19,8 @@
* Copyright (C) 2018 Mellanox Technologies, Ltd. * Copyright (C) 2018 Mellanox Technologies, Ltd.
* All rights reserved. * All rights reserved.
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2019 IBM Corporation. All rights reserved. * Copyright (c) 2019 IBM Corporation. All rights reserved.
* Copyright (c) 2019 Inria. All rights reserved. * Copyright (c) 2019-2020 Inria. All rights reserved.
* Copyright (c) 2020 Triad National Security, LLC. All rights reserved. * Copyright (c) 2020 Triad National Security, LLC. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
@ -2181,15 +2181,16 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo,
locality = t2; locality = t2;
break; break;
#if HWLOC_API_VERSION < 0x20000 #if HWLOC_API_VERSION < 0x20000
case HWLOC_OBJ_CACHE: case HWLOC_OBJ_CACHE: {
if (3 == obj->attr->cache.depth) { unsigned cachedepth = hwloc_get_obj_by_depth(topo, d, 0)->attr->cache.depth;
if (3 == cachedepth) {
asprintf(&t2, "%sL3%s:", (NULL == locality) ? "" : locality, tmp); asprintf(&t2, "%sL3%s:", (NULL == locality) ? "" : locality, tmp);
if (NULL != locality) { if (NULL != locality) {
free(locality); free(locality);
} }
locality = t2; locality = t2;
break; break;
} else if (2 == obj->attr->cache.depth) { } else if (2 == cachedepth) {
asprintf(&t2, "%sL2%s:", (NULL == locality) ? "" : locality, tmp); asprintf(&t2, "%sL2%s:", (NULL == locality) ? "" : locality, tmp);
if (NULL != locality) { if (NULL != locality) {
free(locality); free(locality);
@ -2205,6 +2206,7 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo,
break; break;
} }
break; break;
}
#else #else
case HWLOC_OBJ_L3CACHE: case HWLOC_OBJ_L3CACHE:
asprintf(&t2, "%sL3%s:", (NULL == locality) ? "" : locality, tmp); asprintf(&t2, "%sL3%s:", (NULL == locality) ? "" : locality, tmp);
@ -2257,7 +2259,7 @@ char* opal_hwloc_base_get_locality_string(hwloc_topology_t topo,
* that we came up empty at this depth */ * that we came up empty at this depth */
if (!hwloc_bitmap_iszero(result)) { if (!hwloc_bitmap_iszero(result)) {
hwloc_bitmap_list_asprintf(&tmp, result); hwloc_bitmap_list_asprintf(&tmp, result);
opal_asprintf(&t2, "%sNM%s:", (NULL == locality) ? "" : locality, tmp); asprintf(&t2, "%sNM%s:", (NULL == locality) ? "" : locality, tmp);
if (NULL != locality) { if (NULL != locality) {
free(locality); free(locality);
} }