2004-07-01 14:49:54 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2006-08-23 03:32:36 +00:00
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
2005-11-05 19:57:48 +00:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 20:09:25 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2007-06-10 14:16:05 +00:00
|
|
|
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-07-01 14:49:54 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2005-03-18 03:43:59 +00:00
|
|
|
#include "orte_config.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/constants.h"
|
2004-07-01 14:49:54 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
2004-11-05 07:52:30 +00:00
|
|
|
#include <string.h>
|
2004-07-01 14:49:54 +00:00
|
|
|
|
2005-07-03 23:31:27 +00:00
|
|
|
#include "opal/util/output.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/oob/oob.h"
|
|
|
|
#include "orte/mca/oob/base/base.h"
|
2004-07-01 14:49:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
2004-08-02 21:24:00 +00:00
|
|
|
mca_oob_t,
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t,
|
2004-07-01 14:49:54 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
);
|
2004-08-18 15:51:40 +00:00
|
|
|
|
2004-08-02 00:24:22 +00:00
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_oob_base_info_t,
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t,
|
2004-08-02 00:24:22 +00:00
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
);
|
2004-07-01 14:49:54 +00:00
|
|
|
|
2004-08-16 19:39:54 +00:00
|
|
|
|
2004-07-01 14:49:54 +00:00
|
|
|
/**
|
|
|
|
* Function for selecting one module from all those that are
|
|
|
|
* available.
|
|
|
|
*
|
|
|
|
* Call the init function on all available modules.
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int mca_oob_base_init(void)
|
2004-07-01 14:49:54 +00:00
|
|
|
{
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t *item;
|
2004-08-02 00:24:22 +00:00
|
|
|
mca_base_component_list_item_t *cli;
|
2004-07-01 14:49:54 +00:00
|
|
|
mca_oob_base_component_t *component;
|
2004-08-02 21:24:00 +00:00
|
|
|
mca_oob_t *module;
|
2004-08-28 01:15:19 +00:00
|
|
|
mca_oob_t *s_module = NULL;
|
|
|
|
int s_priority = -1;
|
2004-07-01 14:49:54 +00:00
|
|
|
|
|
|
|
/* Traverse the list of available modules; call their init functions. */
|
2005-07-03 16:22:16 +00:00
|
|
|
for (item = opal_list_get_first(&mca_oob_base_components);
|
|
|
|
item != opal_list_get_end(&mca_oob_base_components);
|
|
|
|
item = opal_list_get_next(item)) {
|
2004-08-02 00:24:22 +00:00
|
|
|
mca_oob_base_info_t *inited;
|
2004-07-01 14:49:54 +00:00
|
|
|
|
2004-08-02 00:24:22 +00:00
|
|
|
cli = (mca_base_component_list_item_t *) item;
|
|
|
|
component = (mca_oob_base_component_t *) cli->cli_component;
|
2004-07-01 14:49:54 +00:00
|
|
|
|
|
|
|
if (NULL == component->oob_init) {
|
2005-07-03 23:31:27 +00:00
|
|
|
opal_output_verbose(10, mca_oob_base_output, "mca_oob_base_init: no init function; ignoring component");
|
2004-07-01 14:49:54 +00:00
|
|
|
} else {
|
2004-08-28 01:15:19 +00:00
|
|
|
int priority = -1;
|
2005-03-14 20:57:21 +00:00
|
|
|
module = component->oob_init(&priority);
|
2004-08-28 01:15:19 +00:00
|
|
|
if (NULL != module) {
|
|
|
|
inited = OBJ_NEW(mca_oob_base_info_t);
|
|
|
|
inited->oob_component = component;
|
|
|
|
inited->oob_module = module;
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_append(&mca_oob_base_modules, &inited->super);
|
2004-08-28 01:15:19 +00:00
|
|
|
|
|
|
|
/* setup highest priority oob channel */
|
|
|
|
if(priority > s_priority) {
|
|
|
|
s_priority = priority;
|
|
|
|
s_module = module;
|
|
|
|
}
|
2004-07-01 14:49:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* set the global variable to point to the first initialize module */
|
2004-08-28 01:15:19 +00:00
|
|
|
if(s_module == NULL) {
|
2005-07-21 20:21:57 +00:00
|
|
|
opal_output_verbose(10, mca_oob_base_output, "mca_oob_base_init: no OOB modules available\n");
|
2005-03-18 03:43:59 +00:00
|
|
|
return ORTE_ERROR;
|
2004-08-28 01:15:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mca_oob = *s_module;
|
2005-03-18 03:43:59 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-07-01 14:49:54 +00:00
|
|
|
}
|
|
|
|
|
2004-08-10 22:11:31 +00:00
|
|
|
|
2004-08-19 19:34:37 +00:00
|
|
|
/**
|
Commit the orted-failed-to-start code. This correctly causes the system to detect the failure of an orted to start and allows the system to terminate all procs/orteds that *did* start.
The primary change that underlies all this is in the OOB. Specifically, the problem in the code until now has been that the OOB attempts to resolve an address when we call the "send" to an unknown recipient. The OOB would then wait forever if that recipient never actually started (and hence, never reported back its OOB contact info). In the case of an orted that failed to start, we would correctly detect that the orted hadn't started, but then we would attempt to order all orteds (including the one that failed to start) to die. This would cause the OOB to "hang" the system.
Unfortunately, revising how the OOB resolves addresses introduced a number of additional problems. Specifically, and most troublesome, was the fact that comm_spawn involved the immediate transmission of the rendezvous point from parent-to-child after the child was spawned. The current code used the OOB address resolution as a "barrier" - basically, the parent would attempt to send the info to the child, and then "hold" there until the child's contact info had arrived (meaning the child had started) and the send could be completed.
Note that this also caused comm_spawn to "hang" the entire system if the child never started... The app-failed-to-start helped improve that behavior - this code provides additional relief.
With this change, the OOB will return an ADDRESSEE_UNKNOWN error if you attempt to send to a recipient whose contact info isn't already in the OOB's hash tables. To resolve comm_spawn issues, we also now force the cross-sharing of connection info between parent and child jobs during spawn.
Finally, to aid in setting triggers to the right values, we introduce the "arith" API for the GPR. This function allows you to atomically change the value in a registry location (either divide, multiply, add, or subtract) by the provided operand. It is equivalent to first fetching the value using a "get", then modifying it, and then putting the result back into the registry via a "put".
This commit was SVN r14711.
2007-05-21 18:31:28 +00:00
|
|
|
* Called to request the selected oob components to
|
|
|
|
* initialize their connections to the HNP (if not an HNP), or
|
|
|
|
* to setup a listener for incoming connections (if an HNP)
|
|
|
|
*/
|
2004-08-25 17:39:08 +00:00
|
|
|
int mca_oob_base_module_init(void)
|
2004-08-19 19:34:37 +00:00
|
|
|
{
|
2005-07-03 16:22:16 +00:00
|
|
|
opal_list_item_t* item;
|
2004-08-19 19:34:37 +00:00
|
|
|
|
2005-07-03 16:22:16 +00:00
|
|
|
for (item = opal_list_get_first(&mca_oob_base_modules);
|
|
|
|
item != opal_list_get_end(&mca_oob_base_modules);
|
|
|
|
item = opal_list_get_next(item)) {
|
2004-08-19 19:34:37 +00:00
|
|
|
mca_oob_base_info_t* base = (mca_oob_base_info_t *) item;
|
|
|
|
if (NULL != base->oob_module->oob_init)
|
|
|
|
base->oob_module->oob_init();
|
|
|
|
}
|
2005-03-18 03:43:59 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-08-19 19:34:37 +00:00
|
|
|
}
|