From bdaaf01d8ab5ea211ab6c486223de637f8837731 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 23 Jun 2008 16:14:05 +0000 Subject: [PATCH] Fixes trac:1338: Have the MCA base specifically check for all requested components. If they are not found / able to be opened, a warning will be printed and the mca_base_component_find() will return OPAL_ERR_NOT_FOUND. It is the upper-layer's responsibility to handle this error appropriately. This commit was SVN r18707. The following Trac tickets were found above: Ticket 1338 --> https://svn.open-mpi.org/trac/ompi/ticket/1338 --- opal/mca/base/help-mca-base.txt | 15 ++++++++++---- opal/mca/base/mca_base_component_find.c | 27 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/opal/mca/base/help-mca-base.txt b/opal/mca/base/help-mca-base.txt index a5ff1e6143..f3ca6aa7c1 100644 --- a/opal/mca/base/help-mca-base.txt +++ b/opal/mca/base/help-mca-base.txt @@ -10,6 +10,7 @@ # University of Stuttgart. All rights reserved. # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. +# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -29,12 +30,18 @@ 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! +A requested component was not found, or was unable to be opened. This +means that this component is either not installed or is unable to be +used on your system (e.g., sometimes this means that shared libraries +that the component requires are unable to be found/loaded). Note that +Open MPI stopped checking at the first component that it did not find. -This means that this component is either not installed, or unable to be -used on your system. +Host: %s +Framework: %s +Component: %s +# [framework-param:too-many-negates] MCA framework parameters can only take a single negation operator ("^"), and it must be at the beginning of the value. The following diff --git a/opal/mca/base/mca_base_component_find.c b/opal/mca/base/mca_base_component_find.c index 3fa25dd254..10e094126c 100644 --- a/opal/mca/base/mca_base_component_find.c +++ b/opal/mca/base/mca_base_component_find.c @@ -23,12 +23,14 @@ #include #include #include +#include #if OMPI_WANT_LIBLTDL #include "opal/libltdl/ltdl.h" #endif #include "opal/util/output.h" +#include "opal/util/show_help.h" #include "opal/class/opal_list.h" #include "opal/mca/mca.h" #include "opal/mca/base/base.h" @@ -132,6 +134,7 @@ int mca_base_component_find(const char *directory, const char *type, bool open_dso_components) { int i; + opal_list_item_t *item; mca_base_component_list_item_t *cli; /* Find all the components that were statically linked in */ @@ -168,6 +171,30 @@ int mca_base_component_find(const char *directory, const char *type, } #endif + /* Ensure that *all* requested components exist. Print a warning + and abort if they do not. */ + for (i = 0; NULL != requested_component_names && + NULL != requested_component_names[i]; ++i) { + for (item = opal_list_get_first(found_components); + opal_list_get_end(found_components) != item; + item = opal_list_get_next(item)) { + cli = (mca_base_component_list_item_t*) item; + if (0 == strcmp(requested_component_names[i], + cli->cli_component->mca_component_name)) { + break; + } + } + + if (opal_list_get_end(found_components) == item) { + char h[HOST_NAME_MAX]; + gethostname(h, sizeof(h)); + opal_show_help("help-mca-base.txt", + "find-available:not-valid", true, + h, type, requested_component_names[i]); + return OPAL_ERR_NOT_FOUND; + } + } + /* All done */ return OPAL_SUCCESS;