21
21
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
22
22
* Copyright (c) 2019-2021 IBM Corporation. All rights reserved.
23
23
* Copyright (c) 2019-2020 Inria. All rights reserved.
24
+ * Copyright (c) 2021 Nanook Consulting. All rights reserved.
24
25
* $COPYRIGHT$
25
26
*
26
27
* Additional copyrights may follow
@@ -369,25 +370,28 @@ int opal_hwloc_base_get_topology(void)
369
370
return OPAL_ERROR ;
370
371
}
371
372
if (0 != hwloc_topology_set_xmlbuffer (opal_hwloc_topology , val , strlen (val ) + 1 )) {
373
+ /* default to discovery */
372
374
free (val );
373
375
hwloc_topology_destroy (opal_hwloc_topology );
374
- return OPAL_ERROR ;
376
+ goto discover ;
375
377
}
376
378
/* since we are loading this from an external source, we have to
377
379
* explicitly set a flag so hwloc sets things up correctly
378
380
*/
379
381
if (0
380
382
!= opal_hwloc_base_topology_set_flags (opal_hwloc_topology ,
381
383
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM , true)) {
384
+ /* default to discovery */
382
385
hwloc_topology_destroy (opal_hwloc_topology );
383
386
free (val );
384
- return OPAL_ERROR ;
387
+ goto discover ;
385
388
}
386
389
/* now load the topology */
387
390
if (0 != hwloc_topology_load (opal_hwloc_topology )) {
391
+ /* default to discovery */
388
392
hwloc_topology_destroy (opal_hwloc_topology );
389
393
free (val );
390
- return OPAL_ERROR ;
394
+ goto discover ;
391
395
}
392
396
free (val );
393
397
/* filter the cpus thru any default cpu set */
@@ -396,6 +400,7 @@ int opal_hwloc_base_get_topology(void)
396
400
return rc ;
397
401
}
398
402
} else {
403
+ discover :
399
404
opal_output_verbose (1 , opal_hwloc_base_framework .framework_output ,
400
405
"hwloc:base discovering topology" );
401
406
if (0 != hwloc_topology_init (& opal_hwloc_topology )
0 commit comments