diff --git a/orte/mca/ras/simulator/Makefile.am b/orte/mca/ras/simulator/Makefile.am index bd03a5526c..771a238ead 100644 --- a/orte/mca/ras/simulator/Makefile.am +++ b/orte/mca/ras/simulator/Makefile.am @@ -7,12 +7,13 @@ # $HEADER$ # +dist_pkgdata_DATA = help-ras-simulator.txt + sources = \ ras_sim.h \ ras_sim_component.c \ ras_sim_module.c - # Make the output library in this directory, and name it either # mca__.la (for DSO builds) or libmca__.la # (for static builds). diff --git a/orte/mca/ras/simulator/help-ras-simulator.txt b/orte/mca/ras/simulator/help-ras-simulator.txt new file mode 100644 index 0000000000..76749662e2 --- /dev/null +++ b/orte/mca/ras/simulator/help-ras-simulator.txt @@ -0,0 +1,33 @@ +# -*- text -*- +# +# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. +# +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +[no hwloc support for topofiles] +The ras_simulator_topo_files MCA parameter was specified, but this +Open MPI installation has no "hwloc" support, meaning that topo files +cannot be used. + +Your job will now abort. +# +[hwloc API fail] +An internal hwloc API call failed in the RAS simulator module. This +is unusual, and should likely be reported to the Open MPI developers. + +Your job will now abort. + + File: %s + Line: %d + API: %s +# +[hwloc failed to load xml] +The RAS simulator module failed to load an XML topology file. This +usually means that the file is either invalid or does not exist. + + Topo file: %s +# diff --git a/orte/mca/ras/simulator/ras_sim_module.c b/orte/mca/ras/simulator/ras_sim_module.c index e72999470d..184e2f871a 100644 --- a/orte/mca/ras/simulator/ras_sim_module.c +++ b/orte/mca/ras/simulator/ras_sim_module.c @@ -86,7 +86,14 @@ static int allocate(opal_list_t *nodes) return ORTE_ERR_SILENT; } } - +#else + /* If we don't have hwloc and hwloc files were specified, then + error out (because we can't deliver that functionality) */ + if (NULL == mca_ras_simulator_component.topofiles) { + orte_show_help("help-ras-simulator.txt", + "no hwloc support for topofiles", true); + return ORTE_ERR_SILENT; + } #endif /* setup the prefix to the node names */ @@ -112,22 +119,33 @@ static int allocate(opal_list_t *nodes) topo = opal_hwloc_topology; } else { if (0 != hwloc_topology_init(&topo)) { - return ORTE_ERROR; + orte_show_help("help-ras-simulator.txt", + "hwloc API fail", true, + __FILE__, __LINE__, "hwloc_topology_init"); + return ORTE_ERR_SILENT; } if (0 != hwloc_topology_set_xml(topo, files[n])) { + orte_show_help("help-ras-simulator.txt", + "hwloc failed to load xml", true, files[n]); hwloc_topology_destroy(topo); - return ORTE_ERROR; + return ORTE_ERR_SILENT; } /* since we are loading this from an external source, we have to * explicitly set a flag so hwloc sets things up correctly */ if (0 != hwloc_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM)) { + orte_show_help("help-ras-simulator.txt", + "hwloc API fail", true, + __FILE__, __LINE__, "hwloc_topology_set_flags"); hwloc_topology_destroy(topo); - return ORTE_ERROR; + return ORTE_ERR_SILENT; } if (0 != hwloc_topology_load(topo)) { + orte_show_help("help-ras-simulator.txt", + "hwloc API fail", true, + __FILE__, __LINE__, "hwloc_topology_load"); hwloc_topology_destroy(topo); - return ORTE_ERROR; + return ORTE_ERR_SILENT; } /* remove the hostname from the topology. Unfortunately, hwloc * decided to add the source hostname to the "topology", thus