|
1 | 1 | /*
|
2 | 2 | * Copyright © 2009 CNRS
|
3 |
| - * Copyright © 2009-2019 Inria. All rights reserved. |
| 3 | + * Copyright © 2009-2020 Inria. All rights reserved. |
4 | 4 | * Copyright © 2009-2012 Université Bordeaux
|
5 | 5 | * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
|
6 | 6 | * See COPYING in top-level directory.
|
@@ -225,14 +225,17 @@ static void output_distances(struct lstopo_output *loutput)
|
225 | 225 | if (!err) {
|
226 | 226 | for(j=0; j<nr; j++) {
|
227 | 227 | const char *kindmeans = (dist[j]->kind & HWLOC_DISTANCES_KIND_MEANS_LATENCY) ? "latency" : (dist[j]->kind & HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH) ? "bandwidth" : "distance";
|
| 228 | + const char *name = hwloc_distances_get_name(topology, dist[j]); |
| 229 | + if (!name) |
| 230 | + name = "(null)"; |
228 | 231 | if (dist[j]->kind & HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES) {
|
229 | 232 | fprintf(output, "Relative %s matrix (name %s kind %lu) between %u heterogeneous objects by %s indexes:\n",
|
230 |
| - kindmeans, hwloc_distances_get_name(topology, dist[j]), dist[j]->kind, |
| 233 | + kindmeans, name, dist[j]->kind, |
231 | 234 | dist[j]->nbobjs,
|
232 | 235 | index_type != LSTOPO_INDEX_TYPE_PHYSICAL ? "logical" : "physical");
|
233 | 236 | } else {
|
234 | 237 | fprintf(output, "Relative %s matrix (name %s kind %lu) between %u %ss (depth %d) by %s indexes:\n",
|
235 |
| - kindmeans, hwloc_distances_get_name(topology, dist[j]), dist[j]->kind, |
| 238 | + kindmeans, name, dist[j]->kind, |
236 | 239 | dist[j]->nbobjs,
|
237 | 240 | hwloc_obj_type_string(dist[j]->objs[0]->type),
|
238 | 241 | dist[j]->objs[0]->depth,
|
|
0 commit comments