2008-10-31 21:10:00 +00:00
|
|
|
/*
|
2011-11-26 02:33:05 +00:00
|
|
|
* Copyright (c) 2007-2011 Los Alamos National Security, LLC.
|
2008-10-31 21:10:00 +00:00
|
|
|
* All rights reserved.
|
2011-06-23 20:38:02 +00:00
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2012-06-08 00:35:36 +00:00
|
|
|
* Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
|
2013-12-19 00:40:36 +00:00
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2013 Intel, Inc. All rights reserved.
|
2008-10-31 21:10:00 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
|
2010-07-20 04:22:45 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
#include "opal/dss/dss.h"
|
|
|
|
#include "opal/class/opal_hash_table.h"
|
|
|
|
#include "opal/class/opal_bitmap.h"
|
2012-04-06 14:23:13 +00:00
|
|
|
#include "opal/runtime/opal_progress.h"
|
2009-02-14 02:26:12 +00:00
|
|
|
#include "opal/util/output.h"
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "orte/mca/ess/ess.h"
|
|
|
|
#include "orte/mca/rml/rml.h"
|
2009-02-14 02:26:12 +00:00
|
|
|
#include "orte/mca/rml/rml_types.h"
|
2008-10-31 21:10:00 +00:00
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
|
|
|
#include "orte/runtime/orte_wait.h"
|
|
|
|
#include "orte/runtime/runtime.h"
|
2011-08-26 22:16:14 +00:00
|
|
|
#include "orte/runtime/data_type_support/orte_dt_support.h"
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
#include "orte/mca/rml/base/rml_contact.h"
|
|
|
|
|
|
|
|
#include "orte/mca/routed/base/base.h"
|
|
|
|
#include "routed_radix.h"
|
|
|
|
|
|
|
|
|
|
|
|
static int init(void);
|
|
|
|
static int finalize(void);
|
|
|
|
static int delete_route(orte_process_name_t *proc);
|
|
|
|
static int update_route(orte_process_name_t *target,
|
|
|
|
orte_process_name_t *route);
|
|
|
|
static orte_process_name_t get_route(orte_process_name_t *target);
|
|
|
|
static int init_routes(orte_jobid_t job, opal_buffer_t *ndat);
|
|
|
|
static int route_lost(const orte_process_name_t *route);
|
|
|
|
static bool route_is_defined(const orte_process_name_t *target);
|
2012-04-06 14:23:13 +00:00
|
|
|
static void update_routing_plan(void);
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 18:56:47 +00:00
|
|
|
static void get_routing_list(opal_list_t *coll);
|
2008-10-31 21:10:00 +00:00
|
|
|
static int get_wireup_info(opal_buffer_t *buf);
|
2008-12-20 23:23:11 +00:00
|
|
|
static int set_lifeline(orte_process_name_t *proc);
|
2010-07-17 21:03:27 +00:00
|
|
|
static size_t num_routes(void);
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2010-03-12 23:57:50 +00:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-10-31 21:10:00 +00:00
|
|
|
static int radix_ft_event(int state);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
orte_routed_module_t orte_routed_radix_module = {
|
|
|
|
init,
|
|
|
|
finalize,
|
|
|
|
delete_route,
|
|
|
|
update_route,
|
|
|
|
get_route,
|
|
|
|
init_routes,
|
|
|
|
route_lost,
|
|
|
|
route_is_defined,
|
2008-12-20 23:23:11 +00:00
|
|
|
set_lifeline,
|
2012-04-06 14:23:13 +00:00
|
|
|
update_routing_plan,
|
|
|
|
get_routing_list,
|
2008-10-31 21:10:00 +00:00
|
|
|
get_wireup_info,
|
2010-07-17 21:03:27 +00:00
|
|
|
num_routes,
|
2010-03-12 23:57:50 +00:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-10-31 21:10:00 +00:00
|
|
|
radix_ft_event
|
|
|
|
#else
|
|
|
|
NULL
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/* local globals */
|
|
|
|
static orte_process_name_t *lifeline=NULL;
|
2008-12-20 23:23:11 +00:00
|
|
|
static orte_process_name_t local_lifeline;
|
2008-10-31 21:10:00 +00:00
|
|
|
static int num_children;
|
|
|
|
static opal_list_t my_children;
|
2011-11-26 02:33:05 +00:00
|
|
|
static bool hnp_direct=true;
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
static int init(void)
|
|
|
|
{
|
|
|
|
lifeline = NULL;
|
|
|
|
|
|
|
|
/* setup the list of children */
|
|
|
|
OBJ_CONSTRUCT(&my_children, opal_list_t);
|
|
|
|
num_children = 0;
|
2011-07-07 18:54:30 +00:00
|
|
|
ORTE_PROC_MY_PARENT->jobid = ORTE_PROC_MY_NAME->jobid;
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int finalize(void)
|
|
|
|
{
|
|
|
|
opal_list_item_t *item;
|
2010-07-20 04:47:31 +00:00
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
lifeline = NULL;
|
|
|
|
|
|
|
|
/* deconstruct the list of children */
|
|
|
|
while (NULL != (item = opal_list_remove_first(&my_children))) {
|
|
|
|
OBJ_RELEASE(item);
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&my_children);
|
|
|
|
num_children = 0;
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int delete_route(orte_process_name_t *proc)
|
|
|
|
{
|
2010-07-20 04:47:31 +00:00
|
|
|
int i;
|
|
|
|
orte_routed_jobfam_t *jfam;
|
|
|
|
uint16_t jfamily;
|
|
|
|
|
2011-10-12 20:18:57 +00:00
|
|
|
if (proc->jobid == ORTE_JOBID_INVALID ||
|
|
|
|
proc->vpid == ORTE_VPID_INVALID) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
2011-10-12 20:18:57 +00:00
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* if I am an application process, I don't have any routes
|
|
|
|
* so there is nothing for me to do
|
|
|
|
*/
|
2009-05-04 11:07:40 +00:00
|
|
|
if (!ORTE_PROC_IS_HNP && !ORTE_PROC_IS_DAEMON &&
|
|
|
|
!ORTE_PROC_IS_TOOL) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix_delete_route for %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(proc)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* if this is from a different job family, then I need to
|
|
|
|
* look it up appropriately
|
|
|
|
*/
|
|
|
|
if (ORTE_JOB_FAMILY(proc->jobid) != ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) {
|
|
|
|
|
|
|
|
/* if I am a daemon, then I will automatically route
|
|
|
|
* anything to this job family via my HNP - so I have nothing
|
|
|
|
* in my routing table and thus have nothing to do
|
|
|
|
* here, just return
|
|
|
|
*/
|
2009-05-04 11:07:40 +00:00
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2010-07-20 04:47:31 +00:00
|
|
|
/* see if this job family is present */
|
|
|
|
jfamily = ORTE_JOB_FAMILY(proc->jobid);
|
2010-07-20 08:30:47 +00:00
|
|
|
for (i=0; i < orte_routed_jobfams.size; i++) {
|
|
|
|
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
|
2010-07-20 04:47:31 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (jfam->job_family == jfamily) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2010-07-20 04:47:31 +00:00
|
|
|
"%s routed_binomial: deleting route to %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOB_FAMILY_PRINT(proc->jobid)));
|
2010-07-20 08:30:47 +00:00
|
|
|
opal_pointer_array_set_item(&orte_routed_jobfams, i, NULL);
|
2010-07-20 04:47:31 +00:00
|
|
|
OBJ_RELEASE(jfam);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
/* not present - nothing to do */
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* THIS CAME FROM OUR OWN JOB FAMILY...there is nothing
|
|
|
|
* to do here. The routes will be redefined when we update
|
|
|
|
* the routing tree
|
|
|
|
*/
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int update_route(orte_process_name_t *target,
|
|
|
|
orte_process_name_t *route)
|
|
|
|
{
|
2010-07-20 04:47:31 +00:00
|
|
|
int i;
|
|
|
|
orte_routed_jobfam_t *jfam;
|
|
|
|
uint16_t jfamily;
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2011-10-12 20:18:57 +00:00
|
|
|
if (target->jobid == ORTE_JOBID_INVALID ||
|
|
|
|
target->vpid == ORTE_VPID_INVALID) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if I am an application process, we don't update the route since
|
|
|
|
* we automatically route everything through the local daemon
|
|
|
|
*/
|
2009-05-11 14:11:44 +00:00
|
|
|
if (ORTE_PROC_IS_APP) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix_update: %s --> %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(target),
|
|
|
|
ORTE_NAME_PRINT(route)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
|
2011-11-26 02:33:05 +00:00
|
|
|
/* if I am a daemon and the target is my HNP, then check
|
|
|
|
* the route - if it isn't direct, then we just flag that
|
|
|
|
* we have a route to the HNP
|
|
|
|
*/
|
|
|
|
if (OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, ORTE_PROC_MY_HNP, target) &&
|
|
|
|
OPAL_EQUAL != orte_util_compare_name_fields(ORTE_NS_CMP_ALL, ORTE_PROC_MY_HNP, route)) {
|
|
|
|
hnp_direct = false;
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* if this is from a different job family, then I need to
|
|
|
|
* track how to send messages to it
|
|
|
|
*/
|
|
|
|
if (ORTE_JOB_FAMILY(target->jobid) != ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) {
|
|
|
|
|
|
|
|
/* if I am a daemon, then I will automatically route
|
|
|
|
* anything to this job family via my HNP - so nothing to do
|
|
|
|
* here, just return
|
|
|
|
*/
|
2009-05-04 11:07:40 +00:00
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix_update: diff job family routing job %s --> %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(target->jobid),
|
|
|
|
ORTE_NAME_PRINT(route)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2010-07-20 04:47:31 +00:00
|
|
|
/* see if this target is already present */
|
|
|
|
jfamily = ORTE_JOB_FAMILY(target->jobid);
|
2010-07-20 08:30:47 +00:00
|
|
|
for (i=0; i < orte_routed_jobfams.size; i++) {
|
|
|
|
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
|
2010-07-20 04:47:31 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (jfam->job_family == jfamily) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2010-07-20 04:47:31 +00:00
|
|
|
"%s routed_radix: updating route to %s via %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOB_FAMILY_PRINT(target->jobid),
|
|
|
|
ORTE_NAME_PRINT(route)));
|
|
|
|
jfam->route.jobid = route->jobid;
|
|
|
|
jfam->route.vpid = route->vpid;
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
2010-07-20 04:47:31 +00:00
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* not there, so add the route FOR THE JOB FAMILY*/
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2010-07-20 04:47:31 +00:00
|
|
|
"%s routed_radix: adding route to %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOB_FAMILY_PRINT(target->jobid)));
|
|
|
|
jfam = OBJ_NEW(orte_routed_jobfam_t);
|
|
|
|
jfam->job_family = jfamily;
|
|
|
|
jfam->route.jobid = route->jobid;
|
|
|
|
jfam->route.vpid = route->vpid;
|
2010-07-20 08:30:47 +00:00
|
|
|
opal_pointer_array_add(&orte_routed_jobfams, jfam);
|
2010-07-20 04:47:31 +00:00
|
|
|
return ORTE_SUCCESS;
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
2013-12-19 00:40:36 +00:00
|
|
|
return ORTE_SUCCESS;
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static orte_process_name_t get_route(orte_process_name_t *target)
|
|
|
|
{
|
|
|
|
orte_process_name_t *ret, daemon;
|
|
|
|
opal_list_item_t *item;
|
|
|
|
orte_routed_tree_t *child;
|
2010-07-20 04:47:31 +00:00
|
|
|
int i;
|
|
|
|
orte_routed_jobfam_t *jfam;
|
|
|
|
uint16_t jfamily;
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2011-12-15 15:32:09 +00:00
|
|
|
if (!orte_routing_is_enabled) {
|
|
|
|
ret = target;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
2011-09-22 09:32:53 +00:00
|
|
|
/* initialize */
|
|
|
|
daemon.jobid = ORTE_PROC_MY_DAEMON->jobid;
|
|
|
|
daemon.vpid = ORTE_PROC_MY_DAEMON->vpid;
|
|
|
|
|
2011-10-12 20:18:57 +00:00
|
|
|
if (target->jobid == ORTE_JOBID_INVALID ||
|
|
|
|
target->vpid == ORTE_VPID_INVALID) {
|
2011-09-22 09:32:53 +00:00
|
|
|
ret = ORTE_NAME_INVALID;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* if it is me, then the route is just direct */
|
|
|
|
if (OPAL_EQUAL == opal_dss.compare(ORTE_PROC_MY_NAME, target, ORTE_NAME)) {
|
|
|
|
ret = target;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if I am an application process, always route via my local daemon */
|
2009-05-11 14:11:44 +00:00
|
|
|
if (ORTE_PROC_IS_APP) {
|
2008-10-31 21:10:00 +00:00
|
|
|
ret = ORTE_PROC_MY_DAEMON;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
2011-09-22 09:32:53 +00:00
|
|
|
/* if I am a tool, the route is direct if target is in
|
|
|
|
* my own job family, and to the target's HNP if not
|
|
|
|
*/
|
|
|
|
if (ORTE_PROC_IS_TOOL) {
|
|
|
|
if (ORTE_JOB_FAMILY(target->jobid) == ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) {
|
|
|
|
ret = target;
|
|
|
|
goto found;
|
|
|
|
} else {
|
|
|
|
ORTE_HNP_NAME_FROM_JOB(&daemon, target->jobid);
|
|
|
|
ret = &daemon;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/****** HNP AND DAEMONS ONLY ******/
|
|
|
|
|
|
|
|
/* IF THIS IS FOR A DIFFERENT JOB FAMILY... */
|
|
|
|
if (ORTE_JOB_FAMILY(target->jobid) != ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) {
|
|
|
|
/* if I am a daemon, route this via the HNP */
|
2009-05-04 11:07:40 +00:00
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
2008-10-31 21:10:00 +00:00
|
|
|
ret = ORTE_PROC_MY_HNP;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if I am the HNP or a tool, then I stored a route to
|
|
|
|
* this job family, so look it up
|
|
|
|
*/
|
2010-07-20 04:47:31 +00:00
|
|
|
jfamily = ORTE_JOB_FAMILY(target->jobid);
|
2010-07-20 08:30:47 +00:00
|
|
|
for (i=0; i < orte_routed_jobfams.size; i++) {
|
|
|
|
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
|
2010-07-20 04:47:31 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (jfam->job_family == jfamily) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2010-07-20 04:47:31 +00:00
|
|
|
"%s routed_binomial: route to %s found",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOB_FAMILY_PRINT(target->jobid)));
|
|
|
|
ret = &jfam->route;
|
|
|
|
goto found;
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
/* not found - so we have no route */
|
|
|
|
ret = ORTE_NAME_INVALID;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* THIS CAME FROM OUR OWN JOB FAMILY... */
|
|
|
|
|
2012-06-08 00:35:36 +00:00
|
|
|
/* if this is going to the HNP, then send it direct if we don't know
|
|
|
|
* how to get there - otherwise, send it via the tree
|
|
|
|
*/
|
2011-07-13 22:49:56 +00:00
|
|
|
if (OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, ORTE_PROC_MY_HNP, target)) {
|
2013-03-20 15:07:43 +00:00
|
|
|
if (!hnp_direct || orte_static_ports) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2011-07-13 22:49:56 +00:00
|
|
|
"%s routing to the HNP through my parent %s",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_PARENT)));
|
|
|
|
ret = ORTE_PROC_MY_PARENT;
|
|
|
|
goto found;
|
|
|
|
} else {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2011-07-13 22:49:56 +00:00
|
|
|
"%s routing direct to the HNP",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
|
|
|
ret = ORTE_PROC_MY_HNP;
|
|
|
|
goto found;
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
daemon.jobid = ORTE_PROC_MY_NAME->jobid;
|
|
|
|
/* find out what daemon hosts this proc */
|
2012-06-27 14:53:55 +00:00
|
|
|
if (ORTE_VPID_INVALID == (daemon.vpid = orte_get_proc_daemon_vpid(target))) {
|
2008-11-18 15:35:50 +00:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
|
|
|
|
ret = ORTE_NAME_INVALID;
|
2008-10-31 21:10:00 +00:00
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if the daemon is me, then send direct to the target! */
|
|
|
|
if (ORTE_PROC_MY_NAME->vpid == daemon.vpid) {
|
|
|
|
ret = target;
|
|
|
|
goto found;
|
2012-06-08 00:35:36 +00:00
|
|
|
} else if (orte_process_info.num_procs < mca_routed_radix_component.max_connections) {
|
|
|
|
/* if the job is small enough, send direct to the target's daemon */
|
|
|
|
ret = &daemon;
|
|
|
|
goto found;
|
2008-10-31 21:10:00 +00:00
|
|
|
} else {
|
|
|
|
/* search routing tree for next step to that daemon */
|
|
|
|
for (item = opal_list_get_first(&my_children);
|
|
|
|
item != opal_list_get_end(&my_children);
|
|
|
|
item = opal_list_get_next(item)) {
|
|
|
|
child = (orte_routed_tree_t*)item;
|
|
|
|
if (child->vpid == daemon.vpid) {
|
|
|
|
/* the child is hosting the proc - just send it there */
|
|
|
|
ret = &daemon;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
/* otherwise, see if the daemon we need is below the child */
|
|
|
|
if (opal_bitmap_is_set_bit(&child->relatives, daemon.vpid)) {
|
|
|
|
/* yep - we need to step through this child */
|
|
|
|
daemon.vpid = child->vpid;
|
|
|
|
ret = &daemon;
|
|
|
|
goto found;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if we get here, then the target daemon is not beneath
|
|
|
|
* any of our children, so we have to step up through our parent
|
|
|
|
*/
|
2011-07-07 18:54:30 +00:00
|
|
|
daemon.vpid = ORTE_PROC_MY_PARENT->vpid;
|
2011-06-23 20:38:02 +00:00
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
ret = &daemon;
|
|
|
|
|
|
|
|
found:
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix_get(%s) --> %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(target),
|
|
|
|
ORTE_NAME_PRINT(ret)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
return *ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void recv_ack(int status, orte_process_name_t* sender,
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
opal_buffer_t *buffer,
|
|
|
|
orte_rml_tag_t tag, void *cbdata)
|
2008-10-31 21:10:00 +00:00
|
|
|
{
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
bool *ack_waiting = (bool*)cbdata;
|
2008-10-31 21:10:00 +00:00
|
|
|
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
/* flag as complete */
|
|
|
|
*ack_waiting = false;
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
static int init_routes(orte_jobid_t job, opal_buffer_t *ndat)
|
|
|
|
{
|
|
|
|
/* the radix module routes all proc communications through
|
|
|
|
* the local daemon. Daemons must identify which of their
|
|
|
|
* daemon-peers is "hosting" the specified recipient and
|
|
|
|
* route the message to that daemon. Daemon contact info
|
|
|
|
* is handled elsewhere, so all we need to do here is
|
|
|
|
* ensure that the procs are told to route through their
|
|
|
|
* local daemon, and that daemons are told how to route
|
|
|
|
* for each proc
|
|
|
|
*/
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
/* if I am a tool, then I stand alone - there is nothing to do */
|
2009-05-04 11:07:40 +00:00
|
|
|
if (ORTE_PROC_IS_TOOL) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if I am a daemon or HNP, then I have to extract the routing info for this job
|
|
|
|
* from the data sent to me for launch and update the routing tables to
|
|
|
|
* point at the daemon for each proc
|
|
|
|
*/
|
2009-05-04 11:07:40 +00:00
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix: init routes for daemon job %s\n\thnp_uri %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(job),
|
2009-03-05 21:56:03 +00:00
|
|
|
(NULL == orte_process_info.my_hnp_uri) ? "NULL" : orte_process_info.my_hnp_uri));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
if (NULL == ndat) {
|
|
|
|
/* indicates this is being called during orte_init.
|
|
|
|
* Get the HNP's name for possible later use
|
|
|
|
*/
|
2009-03-05 21:56:03 +00:00
|
|
|
if (NULL == orte_process_info.my_hnp_uri) {
|
2008-10-31 21:10:00 +00:00
|
|
|
/* fatal error */
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_FATAL);
|
|
|
|
return ORTE_ERR_FATAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* extract the hnp name and store it */
|
2009-03-05 21:56:03 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_rml_base_parse_uris(orte_process_info.my_hnp_uri,
|
2008-10-31 21:10:00 +00:00
|
|
|
ORTE_PROC_MY_HNP, NULL))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
Get the direct routed component to work with both TCP and USOCK OOB components. We previously had setup the direct component so it would only support direct-launched applications. Thus, all routes went direct between processes. However, if the job had been launched by mpirun, this made no sense - what you wanted instead was to have each app proc talk directly to its daemon, but have the daemons all directly connect to each other.
So we need all the routing code for dealing with cross-job communications, lifelines, etc. The HNP will be directly connected to all daemons as they must callback at startup, and so we need to track those children correctly so we know when it is okay to terminate.
We still have to support direct launch, though, as this is the only component we can use in that scenario. So if the app doesn't have daemon URI info, then it must fall back to directly connecting to everything.
2014-12-05 15:33:40 -08:00
|
|
|
/* set the contact info into the hash table */
|
|
|
|
orte_rml.set_contact_info(orte_process_info.my_hnp_uri);
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2011-07-07 18:54:30 +00:00
|
|
|
/* if we are using static ports, set my lifeline to point at my parent */
|
|
|
|
if (orte_static_ports) {
|
|
|
|
lifeline = ORTE_PROC_MY_PARENT;
|
|
|
|
} else {
|
|
|
|
/* set our lifeline to the HNP - we will abort if that connection is lost */
|
|
|
|
lifeline = ORTE_PROC_MY_HNP;
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
/* daemons will send their contact info back to the HNP as
|
|
|
|
* part of the message confirming they are read to go. HNP's
|
|
|
|
* load their contact info during orte_init
|
|
|
|
*/
|
|
|
|
} else {
|
|
|
|
/* ndat != NULL means we are getting an update of RML info
|
|
|
|
* for the daemons - so update our contact info and routes
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_rml_base_update_contact_info(ndat))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix: completed init routes",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-05-04 11:07:40 +00:00
|
|
|
if (ORTE_PROC_IS_HNP) {
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix: init routes for HNP job %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOBID_PRINT(job)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
|
|
|
if (NULL == ndat) {
|
|
|
|
/* the HNP has no lifeline */
|
|
|
|
lifeline = NULL;
|
|
|
|
} else {
|
|
|
|
/* if this is for my own jobid, then I am getting an update of RML info
|
|
|
|
* for the daemons - so update our contact info and routes
|
|
|
|
*/
|
|
|
|
if (ORTE_PROC_MY_NAME->jobid == job) {
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_rml_base_update_contact_info(ndat))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* if not, then I need to process the callback */
|
2009-12-17 19:39:53 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_routed_base_process_callback(job, ndat))) {
|
2008-10-31 21:10:00 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
{ /* MUST BE A PROC */
|
2014-07-24 22:46:17 +00:00
|
|
|
/* if we are a singleton and have not yet exec'd our HNP, then
|
|
|
|
* just return success */
|
|
|
|
if (ORTE_PROC_IS_SINGLETON && !orte_routing_is_enabled) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* if ndat != NULL, then this is being invoked by the proc to
|
|
|
|
* init a route to a specified process that is outside of our
|
|
|
|
* job family. We want that route to go through our HNP, routed via
|
|
|
|
* out local daemon - however, we cannot know for
|
|
|
|
* certain that the HNP already knows how to talk to the specified
|
|
|
|
* procs. For example, in OMPI's publish/subscribe procedures, the
|
|
|
|
* DPM framework looks for an mca param containing the global ompi-server's
|
|
|
|
* uri. This info will come here so the proc can setup a route to
|
|
|
|
* the server - we need to pass the routing info to our HNP
|
|
|
|
*/
|
|
|
|
if (NULL != ndat) {
|
2010-07-20 08:30:47 +00:00
|
|
|
int rc;
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
opal_buffer_t *xfer;
|
2010-07-20 04:22:45 +00:00
|
|
|
orte_rml_cmd_flag_t cmd=ORTE_RML_UPDATE_CMD;
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
bool ack_waiting;
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix: init routes w/non-NULL data",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2008-11-18 15:35:50 +00:00
|
|
|
if (ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid) != ORTE_JOB_FAMILY(job)) {
|
|
|
|
/* if this is for a different job family, then we route via our HNP
|
|
|
|
* to minimize connection counts to entities such as ompi-server, so
|
|
|
|
* start by sending the contact info to the HNP for update
|
|
|
|
*/
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-11-18 15:35:50 +00:00
|
|
|
"%s routed_radix_init_routes: diff job family - sending update to %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_HNP)));
|
2008-11-18 15:35:50 +00:00
|
|
|
|
2010-07-20 04:22:45 +00:00
|
|
|
/* prep the buffer for transmission to the HNP */
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
xfer = OBJ_NEW(opal_buffer_t);
|
|
|
|
opal_dss.pack(xfer, &cmd, 1, ORTE_RML_CMD);
|
|
|
|
opal_dss.copy_payload(xfer, ndat);
|
2010-07-20 04:22:45 +00:00
|
|
|
|
|
|
|
/* save any new connections for use in subsequent connect_accept calls */
|
2010-07-20 08:30:47 +00:00
|
|
|
orte_routed_base_update_hnps(ndat);
|
2010-07-20 04:22:45 +00:00
|
|
|
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
if (0 > (rc = orte_rml.send_buffer_nb(ORTE_PROC_MY_HNP, xfer,
|
|
|
|
ORTE_RML_TAG_RML_INFO_UPDATE,
|
|
|
|
orte_rml_send_callback, NULL))) {
|
2008-10-31 21:10:00 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
OBJ_RELEASE(xfer);
|
2008-10-31 21:10:00 +00:00
|
|
|
return rc;
|
|
|
|
}
|
2010-07-20 04:22:45 +00:00
|
|
|
|
2008-11-18 15:35:50 +00:00
|
|
|
/* wait right here until the HNP acks the update to ensure that
|
2008-10-31 21:10:00 +00:00
|
|
|
* any subsequent messaging can succeed
|
|
|
|
*/
|
As per the RFC, bring in the ORTE async progress code and the rewrite of OOB:
*** THIS RFC INCLUDES A MINOR CHANGE TO THE MPI-RTE INTERFACE ***
Note: during the course of this work, it was necessary to completely separate the MPI and RTE progress engines. There were multiple places in the MPI layer where ORTE_WAIT_FOR_COMPLETION was being used. A new OMPI_WAIT_FOR_COMPLETION macro was created (defined in ompi/mca/rte/rte.h) that simply cycles across opal_progress until the provided flag becomes false. Places where the MPI layer blocked waiting for RTE to complete an event have been modified to use this macro.
***************************************************************************************
I am reissuing this RFC because of the time that has passed since its original release. Since its initial release and review, I have debugged it further to ensure it fully supports tests like loop_spawn. It therefore seems ready for merge back to the trunk. Given its prior review, I have set the timeout for one week.
The code is in https://bitbucket.org/rhc/ompi-oob2
WHAT: Rewrite of ORTE OOB
WHY: Support asynchronous progress and a host of other features
WHEN: Wed, August 21
SYNOPSIS:
The current OOB has served us well, but a number of limitations have been identified over the years. Specifically:
* it is only progressed when called via opal_progress, which can lead to hangs or recursive calls into libevent (which is not supported by that code)
* we've had issues when multiple NICs are available as the code doesn't "shift" messages between transports - thus, all nodes had to be available via the same TCP interface.
* the OOB "unloads" incoming opal_buffer_t objects during the transmission, thus preventing use of OBJ_RETAIN in the code when repeatedly sending the same message to multiple recipients
* there is no failover mechanism across NICs - if the selected NIC (or its attached switch) fails, we are forced to abort
* only one transport (i.e., component) can be "active"
The revised OOB resolves these problems:
* async progress is used for all application processes, with the progress thread blocking in the event library
* each available TCP NIC is supported by its own TCP module. The ability to asynchronously progress each module independently is provided, but not enabled by default (a runtime MCA parameter turns it "on")
* multi-address TCP NICs (e.g., a NIC with both an IPv4 and IPv6 address, or with virtual interfaces) are supported - reachability is determined by comparing the contact info for a peer against all addresses within the range covered by the address/mask pairs for the NIC.
* a message that arrives on one TCP NIC is automatically shifted to whatever NIC that is connected to the next "hop" if that peer cannot be reached by the incoming NIC. If no TCP module will reach the peer, then the OOB attempts to send the message via all other available components - if none can reach the peer, then an "error" is reported back to the RML, which then calls the errmgr for instructions.
* opal_buffer_t now conforms to standard object rules re OBJ_RETAIN as we no longer "unload" the incoming object
* NIC failure is reported to the TCP component, which then tries to resend the message across any other available TCP NIC. If that doesn't work, then the message is given back to the OOB base to try using other components. If all that fails, then the error is reported to the RML, which reports to the errmgr for instructions
* obviously from the above, multiple OOB components (e.g., TCP and UD) can be active in parallel
* the matching code has been moved to the RML (and out of the OOB/TCP component) so it is independent of transport
* routing is done by the individual OOB modules (as opposed to the RML). Thus, both routed and non-routed transports can simultaneously be active
* all blocking send/recv APIs have been removed. Everything operates asynchronously.
KNOWN LIMITATIONS:
* although provision is made for component failover as described above, the code for doing so has not been fully implemented yet. At the moment, if all connections for a given peer fail, the errmgr is notified of a "lost connection", which by default results in termination of the job if it was a lifeline
* the IPv6 code is present and compiles, but is not complete. Since the current IPv6 support in the OOB doesn't work anyway, I don't consider this a blocker
* routing is performed at the individual module level, yet the active routed component is selected on a global basis. We probably should update that to reflect that different transports may need/choose to route in different ways
* obviously, not every error path has been tested nor necessarily covered
* determining abnormal termination is more challenging than in the old code as we now potentially have multiple ways of connecting to a process. Ideally, we would declare "connection failed" when *all* transports can no longer reach the process, but that requires some additional (possibly complex) code. For now, the code replicates the old behavior only somewhat modified - i.e., if a module sees its connection fail, it checks to see if it is a lifeline. If so, it notifies the errmgr that the lifeline is lost - otherwise, it notifies the errmgr that a non-lifeline connection was lost.
* reachability is determined solely on the basis of a shared subnet address/mask - more sophisticated algorithms (e.g., the one used in the tcp btl) are required to handle routing via gateways
* the RML needs to assign sequence numbers to each message on a per-peer basis. The receiving RML will then deliver messages in order, thus preventing out-of-order messaging in the case where messages travel across different transports or a message needs to be redirected/resent due to failure of a NIC
This commit was SVN r29058.
2013-08-22 16:37:40 +00:00
|
|
|
ack_waiting = true;
|
|
|
|
orte_rml.recv_buffer_nb(ORTE_NAME_WILDCARD,
|
|
|
|
ORTE_RML_TAG_UPDATE_ROUTE_ACK,
|
|
|
|
ORTE_RML_NON_PERSISTENT,
|
|
|
|
recv_ack, &ack_waiting);
|
|
|
|
ORTE_WAIT_FOR_COMPLETION(ack_waiting);
|
2012-04-06 14:23:13 +00:00
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix_init_routes: ack recvd",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2008-11-18 15:35:50 +00:00
|
|
|
/* our get_route function automatically routes all messages for
|
|
|
|
* other job families via the HNP, so nothing more to do here
|
2008-10-31 21:10:00 +00:00
|
|
|
*/
|
|
|
|
}
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if ndat=NULL, then we are being called during orte_init. In this
|
|
|
|
* case, we need to setup a few critical pieces of info
|
|
|
|
*/
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
|
2008-10-31 21:10:00 +00:00
|
|
|
"%s routed_radix: init routes for proc job %s\n\thnp_uri %s\n\tdaemon uri %s",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_JOBID_PRINT(job),
|
2009-03-05 21:56:03 +00:00
|
|
|
(NULL == orte_process_info.my_hnp_uri) ? "NULL" : orte_process_info.my_hnp_uri,
|
|
|
|
(NULL == orte_process_info.my_daemon_uri) ? "NULL" : orte_process_info.my_daemon_uri));
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2009-03-05 21:56:03 +00:00
|
|
|
if (NULL == orte_process_info.my_daemon_uri) {
|
2008-10-31 21:10:00 +00:00
|
|
|
/* in this module, we absolutely MUST have this information - if
|
|
|
|
* we didn't get it, then error out
|
|
|
|
*/
|
|
|
|
opal_output(0, "%s ERROR: Failed to identify the local daemon's URI",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
2008-10-31 21:10:00 +00:00
|
|
|
opal_output(0, "%s ERROR: This is a fatal condition when the radix router",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
2008-10-31 21:10:00 +00:00
|
|
|
opal_output(0, "%s ERROR: has been selected - either select the unity router",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
2008-10-31 21:10:00 +00:00
|
|
|
opal_output(0, "%s ERROR: or ensure that the local daemon info is provided",
|
2009-03-05 21:50:47 +00:00
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_ERR_FATAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we have to set the HNP's name, even though we won't route messages directly
|
|
|
|
* to it. This is required to ensure that we -do- send messages to the correct
|
|
|
|
* HNP name
|
|
|
|
*/
|
2009-03-05 21:56:03 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_rml_base_parse_uris(orte_process_info.my_hnp_uri,
|
2008-10-31 21:10:00 +00:00
|
|
|
ORTE_PROC_MY_HNP, NULL))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* extract the daemon's name so we can update the routing table */
|
2009-03-05 21:56:03 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_rml_base_parse_uris(orte_process_info.my_daemon_uri,
|
2008-10-31 21:10:00 +00:00
|
|
|
ORTE_PROC_MY_DAEMON, NULL))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
Get the direct routed component to work with both TCP and USOCK OOB components. We previously had setup the direct component so it would only support direct-launched applications. Thus, all routes went direct between processes. However, if the job had been launched by mpirun, this made no sense - what you wanted instead was to have each app proc talk directly to its daemon, but have the daemons all directly connect to each other.
So we need all the routing code for dealing with cross-job communications, lifelines, etc. The HNP will be directly connected to all daemons as they must callback at startup, and so we need to track those children correctly so we know when it is okay to terminate.
We still have to support direct launch, though, as this is the only component we can use in that scenario. So if the app doesn't have daemon URI info, then it must fall back to directly connecting to everything.
2014-12-05 15:33:40 -08:00
|
|
|
/* Set the contact info in the RML - this won't actually establish
|
|
|
|
* the connection, but just tells the RML how to reach the daemon
|
|
|
|
* if/when we attempt to send to it
|
|
|
|
*/
|
|
|
|
orte_rml.set_contact_info(orte_process_info.my_daemon_uri);
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* set our lifeline to the local daemon - we will abort if this connection is lost */
|
|
|
|
lifeline = ORTE_PROC_MY_DAEMON;
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int route_lost(const orte_process_name_t *route)
|
|
|
|
{
|
2010-07-17 21:03:27 +00:00
|
|
|
opal_list_item_t *item;
|
|
|
|
orte_routed_tree_t *child;
|
2011-09-22 09:32:53 +00:00
|
|
|
orte_routed_jobfam_t *jfam;
|
|
|
|
uint16_t jfamily;
|
|
|
|
int i;
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2011-09-22 09:32:53 +00:00
|
|
|
"%s route to %s lost",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(route)));
|
|
|
|
|
|
|
|
/* if the route is to a different job family and we are the HNP, look it up */
|
|
|
|
if ((ORTE_JOB_FAMILY(route->jobid) != ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) &&
|
|
|
|
ORTE_PROC_IS_HNP) {
|
|
|
|
jfamily = ORTE_JOB_FAMILY(route->jobid);
|
|
|
|
for (i=0; i < orte_routed_jobfams.size; i++) {
|
|
|
|
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (jfam->job_family == jfamily) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2011-09-22 09:32:53 +00:00
|
|
|
"%s routed_radix: route to %s lost",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOB_FAMILY_PRINT(route->jobid)));
|
|
|
|
opal_pointer_array_set_item(&orte_routed_jobfams, i, NULL);
|
|
|
|
OBJ_RELEASE(jfam);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-07-17 21:03:27 +00:00
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* if we lose the connection to the lifeline and we are NOT already,
|
|
|
|
* in finalize, tell the OOB to abort.
|
|
|
|
* NOTE: we cannot call abort from here as the OOB needs to first
|
|
|
|
* release a thread-lock - otherwise, we will hang!!
|
|
|
|
*/
|
|
|
|
if (!orte_finalizing &&
|
|
|
|
NULL != lifeline &&
|
|
|
|
OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, route, lifeline)) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2012-04-06 14:23:13 +00:00
|
|
|
"%s routed:radix: Connection to lifeline %s lost",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_NAME_PRINT(lifeline)));
|
2008-10-31 21:10:00 +00:00
|
|
|
return ORTE_ERR_FATAL;
|
|
|
|
}
|
|
|
|
|
2010-07-17 21:03:27 +00:00
|
|
|
/* if we are the HNP or daemon, and the route is a daemon,
|
|
|
|
* see if it is one of our children - if so, remove it
|
|
|
|
*/
|
|
|
|
if ((ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) &&
|
|
|
|
route->jobid == ORTE_PROC_MY_NAME->jobid) {
|
|
|
|
for (item = opal_list_get_first(&my_children);
|
|
|
|
item != opal_list_get_end(&my_children);
|
|
|
|
item = opal_list_get_next(item)) {
|
|
|
|
child = (orte_routed_tree_t*)item;
|
|
|
|
if (child->vpid == route->vpid) {
|
|
|
|
opal_list_remove_item(&my_children, item);
|
|
|
|
OBJ_RELEASE(item);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* we don't care about this one, so return success */
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool route_is_defined(const orte_process_name_t *target)
|
|
|
|
{
|
2011-09-22 09:32:53 +00:00
|
|
|
int i;
|
|
|
|
orte_routed_jobfam_t *jfam;
|
|
|
|
uint16_t jfamily;
|
|
|
|
|
|
|
|
/* if the route is to a different job family and we are the HNP, look it up */
|
|
|
|
if (ORTE_JOB_FAMILY(target->jobid) != ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) {
|
|
|
|
if (ORTE_PROC_IS_HNP) {
|
|
|
|
jfamily = ORTE_JOB_FAMILY(target->jobid);
|
|
|
|
for (i=0; i < orte_routed_jobfams.size; i++) {
|
|
|
|
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (jfam->job_family == jfamily) {
|
2013-03-27 21:14:43 +00:00
|
|
|
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
|
2011-09-22 09:32:53 +00:00
|
|
|
"%s routed_radix: route to %s is defined",
|
|
|
|
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
|
|
|
ORTE_JOB_FAMILY_PRINT(target->jobid)));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
/* if we are not the HNP, then the answer is always true as
|
|
|
|
* we send it via the HNP
|
|
|
|
*/
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
/* find out what daemon hosts this proc */
|
2012-06-27 14:53:55 +00:00
|
|
|
if (ORTE_VPID_INVALID == orte_get_proc_daemon_vpid((orte_process_name_t*)target)) {
|
2008-10-31 21:10:00 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-12-20 23:23:11 +00:00
|
|
|
static int set_lifeline(orte_process_name_t *proc)
|
|
|
|
{
|
|
|
|
/* we have to copy the proc data because there is no
|
|
|
|
* guarantee that it will be preserved
|
|
|
|
*/
|
|
|
|
local_lifeline.jobid = proc->jobid;
|
|
|
|
local_lifeline.vpid = proc->vpid;
|
|
|
|
lifeline = &local_lifeline;
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2008-10-31 21:10:00 +00:00
|
|
|
static void radix_tree(int rank, int *num_children,
|
|
|
|
opal_list_t *children, opal_bitmap_t *relatives)
|
|
|
|
{
|
2009-01-03 15:37:00 +00:00
|
|
|
int i, peer, Sum, NInLevel;
|
2008-10-31 21:10:00 +00:00
|
|
|
orte_routed_tree_t *child;
|
|
|
|
opal_bitmap_t *relations;
|
|
|
|
|
|
|
|
/* compute how many procs are at my level */
|
|
|
|
Sum=1;
|
|
|
|
NInLevel=1;
|
|
|
|
|
|
|
|
while ( Sum < (rank+1) ) {
|
|
|
|
NInLevel *= mca_routed_radix_component.radix;
|
|
|
|
Sum += NInLevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* our children start at our rank + num_in_level */
|
|
|
|
peer = rank + NInLevel;
|
|
|
|
for (i = 0; i < mca_routed_radix_component.radix; i++) {
|
2009-03-05 21:56:03 +00:00
|
|
|
if (peer < (int)orte_process_info.num_procs) {
|
2008-10-31 21:10:00 +00:00
|
|
|
child = OBJ_NEW(orte_routed_tree_t);
|
|
|
|
child->vpid = peer;
|
|
|
|
if (NULL != children) {
|
|
|
|
/* this is a direct child - add it to my list */
|
|
|
|
opal_list_append(children, &child->super);
|
|
|
|
(*num_children)++;
|
|
|
|
/* setup the relatives bitmap */
|
2009-03-05 21:56:03 +00:00
|
|
|
opal_bitmap_init(&child->relatives, orte_process_info.num_procs);
|
2008-10-31 21:10:00 +00:00
|
|
|
/* point to the relatives */
|
|
|
|
relations = &child->relatives;
|
|
|
|
} else {
|
|
|
|
/* we are recording someone's relatives - set the bit */
|
2009-01-03 15:37:00 +00:00
|
|
|
if (OPAL_SUCCESS != opal_bitmap_set_bit(relatives, peer)) {
|
2009-03-05 21:50:47 +00:00
|
|
|
opal_output(0, "%s Error: could not set relations bit!", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME));
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
/* point to this relations */
|
|
|
|
relations = relatives;
|
|
|
|
}
|
|
|
|
/* search for this child's relatives */
|
|
|
|
radix_tree(peer, NULL, NULL, relations);
|
|
|
|
}
|
|
|
|
peer += NInLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-06 14:23:13 +00:00
|
|
|
static void update_routing_plan(void)
|
2008-10-31 21:10:00 +00:00
|
|
|
{
|
|
|
|
orte_routed_tree_t *child;
|
|
|
|
int j;
|
|
|
|
opal_list_item_t *item;
|
|
|
|
int Level,Sum,NInLevel,Ii;
|
|
|
|
int NInPrevLevel;
|
|
|
|
|
|
|
|
/* if I am anything other than a daemon or the HNP, this
|
|
|
|
* is a meaningless command as I am not allowed to route
|
|
|
|
*/
|
2009-05-04 11:07:40 +00:00
|
|
|
if (!ORTE_PROC_IS_DAEMON && !ORTE_PROC_IS_HNP) {
|
2012-04-06 14:23:13 +00:00
|
|
|
return;
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* clear the list of children if any are already present */
|
|
|
|
while (NULL != (item = opal_list_remove_first(&my_children))) {
|
|
|
|
OBJ_RELEASE(item);
|
|
|
|
}
|
|
|
|
num_children = 0;
|
|
|
|
|
|
|
|
/* compute my parent */
|
|
|
|
Ii = ORTE_PROC_MY_NAME->vpid;
|
|
|
|
Level=0;
|
|
|
|
Sum=1;
|
|
|
|
NInLevel=1;
|
|
|
|
|
|
|
|
while ( Sum < (Ii+1) ) {
|
|
|
|
Level++;
|
|
|
|
NInLevel *= mca_routed_radix_component.radix;
|
|
|
|
Sum += NInLevel;
|
|
|
|
}
|
|
|
|
Sum -= NInLevel;
|
|
|
|
|
|
|
|
NInPrevLevel = NInLevel/mca_routed_radix_component.radix;
|
|
|
|
|
|
|
|
if( 0 == Ii ) {
|
2011-07-07 18:54:30 +00:00
|
|
|
ORTE_PROC_MY_PARENT->vpid = -1;
|
2008-10-31 21:10:00 +00:00
|
|
|
} else {
|
2011-07-07 18:54:30 +00:00
|
|
|
ORTE_PROC_MY_PARENT->vpid = (Ii-Sum) % NInPrevLevel;
|
|
|
|
ORTE_PROC_MY_PARENT->vpid += (Sum - NInPrevLevel);
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* compute my direct children and the bitmap that shows which vpids
|
|
|
|
* lie underneath their branch
|
|
|
|
*/
|
|
|
|
radix_tree(Ii, &num_children, &my_children, NULL);
|
|
|
|
|
2013-03-27 21:14:43 +00:00
|
|
|
if (0 < opal_output_get_verbosity(orte_routed_base_framework.framework_output)) {
|
2011-07-07 18:54:30 +00:00
|
|
|
opal_output(0, "%s: parent %d num_children %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_PROC_MY_PARENT->vpid, num_children);
|
2008-10-31 21:10:00 +00:00
|
|
|
for (item = opal_list_get_first(&my_children);
|
|
|
|
item != opal_list_get_end(&my_children);
|
|
|
|
item = opal_list_get_next(item)) {
|
|
|
|
child = (orte_routed_tree_t*)item;
|
2009-03-05 21:50:47 +00:00
|
|
|
opal_output(0, "%s: \tchild %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), child->vpid);
|
2009-03-05 21:56:03 +00:00
|
|
|
for (j=0; j < (int)orte_process_info.num_procs; j++) {
|
2008-10-31 21:10:00 +00:00
|
|
|
if (opal_bitmap_is_set_bit(&child->relatives, j)) {
|
2009-03-05 21:50:47 +00:00
|
|
|
opal_output(0, "%s: \t\trelation %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), j);
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 18:56:47 +00:00
|
|
|
static void get_routing_list(opal_list_t *coll)
|
2008-10-31 21:10:00 +00:00
|
|
|
{
|
|
|
|
/* if I am anything other than a daemon or the HNP, this
|
|
|
|
* is a meaningless command as I am not allowed to route
|
|
|
|
*/
|
2009-05-04 11:07:40 +00:00
|
|
|
if (!ORTE_PROC_IS_DAEMON && !ORTE_PROC_IS_HNP) {
|
2012-04-06 14:23:13 +00:00
|
|
|
return;
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 18:56:47 +00:00
|
|
|
orte_routed_base_xcast_routing(coll, &my_children);
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int get_wireup_info(opal_buffer_t *buf)
|
|
|
|
{
|
|
|
|
int rc;
|
2010-07-20 08:30:47 +00:00
|
|
|
int i;
|
|
|
|
orte_routed_jobfam_t *jfam;
|
|
|
|
|
2010-07-20 04:22:45 +00:00
|
|
|
if (ORTE_PROC_IS_HNP) {
|
|
|
|
/* if we are not using static ports, then we need to share the
|
|
|
|
* comm info - otherwise, just return
|
|
|
|
*/
|
|
|
|
if (orte_static_ports) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2008-10-31 21:10:00 +00:00
|
|
|
|
2010-07-20 04:22:45 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_rml_base_get_contact_info(ORTE_PROC_MY_NAME->jobid, buf))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
|
|
|
return rc;
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
2010-07-20 04:22:45 +00:00
|
|
|
/* if I am an application, this is occurring during connect_accept.
|
|
|
|
* We need to return the stored information of other HNPs we
|
|
|
|
* know about, if any
|
|
|
|
*/
|
|
|
|
if (ORTE_PROC_IS_APP) {
|
2010-07-20 08:30:47 +00:00
|
|
|
for (i=0; i < orte_routed_jobfams.size; i++) {
|
|
|
|
if (NULL != (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
|
|
|
|
opal_dss.pack(buf, &(jfam->hnp_uri), 1, OPAL_STRING);
|
|
|
|
}
|
2010-07-20 04:22:45 +00:00
|
|
|
}
|
2010-07-20 08:30:47 +00:00
|
|
|
return ORTE_SUCCESS;
|
2008-10-31 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2010-07-17 21:03:27 +00:00
|
|
|
static size_t num_routes(void)
|
|
|
|
{
|
|
|
|
return opal_list_get_size(&my_children);
|
|
|
|
}
|
|
|
|
|
2010-03-12 23:57:50 +00:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
2008-10-31 21:10:00 +00:00
|
|
|
static int radix_ft_event(int state)
|
|
|
|
{
|
|
|
|
int ret, exit_status = ORTE_SUCCESS;
|
|
|
|
|
|
|
|
/******** Checkpoint Prep ********/
|
|
|
|
if(OPAL_CRS_CHECKPOINT == state) {
|
|
|
|
}
|
|
|
|
/******** Continue Recovery ********/
|
|
|
|
else if (OPAL_CRS_CONTINUE == state ) {
|
|
|
|
}
|
|
|
|
/******** Restart Recovery ********/
|
|
|
|
else if (OPAL_CRS_RESTART == state ) {
|
|
|
|
/*
|
|
|
|
* Re-exchange the routes
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_routed.init_routes(ORTE_PROC_MY_NAME->jobid, NULL))) {
|
|
|
|
exit_status = ret;
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (OPAL_CRS_TERM == state ) {
|
|
|
|
/* Nothing */
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Error state = Nothing */
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanup:
|
|
|
|
return exit_status;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|