diff --git a/ompi/mca/btl/base/btl_base_select.c b/ompi/mca/btl/base/btl_base_select.c index 179f42641a..2d836a2cd1 100644 --- a/ompi/mca/btl/base/btl_base_select.c +++ b/ompi/mca/btl/base/btl_base_select.c @@ -18,6 +18,7 @@ #include "opal/util/argv.h" #include "runtime/runtime.h" +#include "opal/util/show_help.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/pml/pml.h" @@ -144,8 +145,9 @@ int mca_btl_base_select(bool enable_progress_threads, /* Finished querying all components. Check for the bozo case. */ if (0 == opal_list_get_size(&mca_btl_base_modules_initialized)) { - /* JMS Replace with show_help */ - orte_abort(1, "No btl components available. This shouldn't happen."); + opal_show_help("help-mca-base.txt", "find-available:none-found", true, + "btl"); + orte_abort(1, ""); } return OMPI_SUCCESS; } diff --git a/ompi/mca/pml/base/pml_base_select.c b/ompi/mca/pml/base/pml_base_select.c index c130fc9d18..9e3cd34c47 100644 --- a/ompi/mca/pml/base/pml_base_select.c +++ b/ompi/mca/pml/base/pml_base_select.c @@ -18,6 +18,7 @@ #include "opal/class/opal_list.h" #include "runtime/runtime.h" +#include "opal/util/show_help.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/pml/pml.h" @@ -110,8 +111,9 @@ int mca_pml_base_select(bool enable_progress_threads, /* Finished querying all components. Check for the bozo case. */ if( NULL == best_component ) { - /* JMS Replace with show_help */ - orte_abort(1, "No pml component available. This shouldn't happen."); + opal_show_help("help-mca-base.txt", "find-available:none-found", true, + "pml"); + orte_abort(1, ""); } /* Finalize all non-selected components */ diff --git a/ompi/mca/ptl/base/ptl_base_select.c b/ompi/mca/ptl/base/ptl_base_select.c index 88c1d77f81..65625aac42 100644 --- a/ompi/mca/ptl/base/ptl_base_select.c +++ b/ompi/mca/ptl/base/ptl_base_select.c @@ -18,6 +18,7 @@ #include "opal/util/argv.h" #include "runtime/runtime.h" +#include "opal/util/show_help.h" #include "mca/mca.h" #include "mca/base/base.h" #include "mca/pml/pml.h" @@ -136,8 +137,9 @@ int mca_ptl_base_select(bool enable_progress_threads, /* Finished querying all components. Check for the bozo case. */ if (0 == opal_list_get_size(&mca_ptl_base_modules_initialized)) { - /* JMS Replace with show_help */ - orte_abort(1, "No ptl components available. This shouldn't happen."); + opal_show_help("help-mca-base.txt", "find-available:none-found", true, + "ptl"); + orte_abort(1, ""); } /* All done */ diff --git a/opal/mca/base/help-mca-base.txt b/opal/mca/base/help-mca-base.txt index d0de3f8c89..b1a410d910 100644 --- a/opal/mca/base/help-mca-base.txt +++ b/opal/mca/base/help-mca-base.txt @@ -27,3 +27,9 @@ output of the "ompi_info" command and ensure that components of this type are available on your system. You may also wish to check the value of the "component_path" MCA parameter and ensure that it has at least one directory that contains valid MCA components. + +[find-available:not-valid] +The %s component was not found! + +This means that this component is either not installed, or unable to be +used on your system. diff --git a/opal/mca/base/mca_base_components_open.c b/opal/mca/base/mca_base_components_open.c index 2a7052ac99..0f29c391a7 100644 --- a/opal/mca/base/mca_base_components_open.c +++ b/opal/mca/base/mca_base_components_open.c @@ -24,6 +24,7 @@ #include "opal/util/strncpy.h" #include "opal/util/argv.h" #include "opal/util/output.h" +#include "opal/util/show_help.h" #include "mca/mca.h" #include "mca/base/base.h" #include "include/constants.h" @@ -161,6 +162,7 @@ static int open_components(const char *type_name, int output_id, const mca_base_component_t *component; mca_base_component_list_item_t *cli; bool acceptable; + bool any_acceptable = true; bool called_open; bool opened; @@ -180,6 +182,47 @@ static int open_components(const char *type_name, int output_id, } } + /* + * Check requested components for validity + */ + if (NULL != requested_component_names) { + any_acceptable = false; + + /* For every requested component ... */ + for (i = 0; NULL != requested_component_names[i]; ++i) { + acceptable = false; + + /* Try to match it to an item in the list */ + for (item = opal_list_get_first(components_found); + opal_list_get_end(components_found) != item; + item = opal_list_get_next(item)) { + + cli = (mca_base_component_list_item_t *) item; + component = cli->cli_component; + + if (0 == strcmp(requested_component_names[i], + component->mca_component_name)) { + acceptable = true; + any_acceptable = true; + break; + } + } + + /* Didn't find it in the list, warn the user */ + if (!acceptable) { + opal_show_help("help-mca-base.txt", "find-available:not-valid", true, + requested_component_names[i]); + } + } + + /* None of the listed components were acceptable :( */ + if(!any_acceptable) { + opal_show_help("help-mca-base.txt", "find-available:none-found", true, + type_name); + return OMPI_ERROR; + } + } + /* Traverse the list of found components */ OBJ_CONSTRUCT(components_available, opal_list_t);