2004-08-15 03:33:13 +00:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
2005-11-05 19:57:48 +00:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2005-09-01 01:07:30 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 20:09:25 +00:00
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 01:38:40 +00:00
|
|
|
* $COPYRIGHT$
|
2005-09-01 01:07:30 +00:00
|
|
|
*
|
2004-11-22 01:38:40 +00:00
|
|
|
* Additional copyrights may follow
|
2005-09-01 01:07:30 +00:00
|
|
|
*
|
2004-08-15 03:33:13 +00:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/** @file:
|
|
|
|
*
|
|
|
|
* The Open MPI General Purpose Registry - Replica component
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* includes
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
#include "orte_config.h"
|
|
|
|
|
2005-09-19 15:29:14 +00:00
|
|
|
#include "orte/class/orte_bitmap.h"
|
2005-07-03 16:06:07 +00:00
|
|
|
#include "opal/class/opal_object.h"
|
2005-07-03 23:31:27 +00:00
|
|
|
#include "opal/util/output.h"
|
2005-09-19 15:29:14 +00:00
|
|
|
#include "opal/util/trace.h"
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2005-09-19 15:29:14 +00:00
|
|
|
#include "orte/util/proc_info.h"
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-09-19 15:29:14 +00:00
|
|
|
#include "orte/mca/rml/rml.h"
|
|
|
|
|
|
|
|
#include "orte/mca/gpr/replica/gpr_replica.h"
|
|
|
|
#include "orte/mca/gpr/replica/api_layer/gpr_replica_api.h"
|
|
|
|
#include "orte/mca/gpr/replica/communications/gpr_replica_comm.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2004-08-15 03:33:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Struct of function pointers that need to be initialized
|
|
|
|
*/
|
2006-08-20 15:54:04 +00:00
|
|
|
mca_gpr_base_component_t mca_gpr_replica_component = {
|
2004-08-15 03:33:13 +00:00
|
|
|
{
|
2005-09-01 01:07:30 +00:00
|
|
|
MCA_GPR_BASE_VERSION_1_0_0,
|
|
|
|
|
|
|
|
"replica", /* MCA module name */
|
|
|
|
ORTE_MAJOR_VERSION, /* MCA module major version */
|
|
|
|
ORTE_MINOR_VERSION, /* MCA module minor version */
|
|
|
|
ORTE_RELEASE_VERSION, /* MCA module release version */
|
|
|
|
orte_gpr_replica_open, /* module open */
|
|
|
|
orte_gpr_replica_close /* module close */
|
2004-08-15 03:33:13 +00:00
|
|
|
},
|
|
|
|
{
|
2005-09-01 01:07:30 +00:00
|
|
|
false /* checkpoint / restart */
|
2004-08-15 03:33:13 +00:00
|
|
|
},
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_init, /* module init */
|
|
|
|
orte_gpr_replica_finalize /* module shutdown */
|
2004-08-15 03:33:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* setup the function pointers for the module
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
static orte_gpr_base_module_t orte_gpr_replica_module = {
|
|
|
|
/* INIT */
|
|
|
|
orte_gpr_replica_module_init,
|
|
|
|
/* BLOCKING OPERATIONS */
|
|
|
|
orte_gpr_replica_get,
|
2005-10-28 00:30:58 +00:00
|
|
|
orte_gpr_replica_get_conditional,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_put,
|
2005-08-01 16:38:15 +00:00
|
|
|
orte_gpr_base_put_1,
|
|
|
|
orte_gpr_base_put_N,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_delete_entries,
|
|
|
|
orte_gpr_replica_delete_segment,
|
|
|
|
orte_gpr_replica_index,
|
|
|
|
/* NON-BLOCKING OPERATIONS */
|
|
|
|
orte_gpr_replica_get_nb,
|
|
|
|
orte_gpr_replica_put_nb,
|
|
|
|
orte_gpr_replica_delete_entries_nb,
|
|
|
|
orte_gpr_replica_delete_segment_nb,
|
|
|
|
orte_gpr_replica_index_nb,
|
|
|
|
/* GENERAL OPERATIONS */
|
2006-02-07 03:32:36 +00:00
|
|
|
orte_gpr_base_create_value,
|
|
|
|
orte_gpr_base_create_keyval,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_preallocate_segment,
|
2005-09-01 01:07:30 +00:00
|
|
|
orte_gpr_replica_deliver_notify_msg,
|
2005-03-14 20:57:21 +00:00
|
|
|
/* ARITHMETIC OPERATIONS */
|
|
|
|
orte_gpr_replica_increment_value,
|
|
|
|
orte_gpr_replica_decrement_value,
|
|
|
|
/* SUBSCRIBE OPERATIONS */
|
|
|
|
orte_gpr_replica_subscribe,
|
2005-08-01 16:38:15 +00:00
|
|
|
orte_gpr_base_subscribe_1,
|
|
|
|
orte_gpr_base_subscribe_N,
|
|
|
|
orte_gpr_base_define_trigger,
|
2005-09-01 01:07:30 +00:00
|
|
|
orte_gpr_base_define_trigger_level,
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_unsubscribe,
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica_cancel_trigger,
|
2005-03-14 20:57:21 +00:00
|
|
|
/* COMPOUND COMMANDS */
|
|
|
|
orte_gpr_replica_begin_compound_cmd,
|
|
|
|
orte_gpr_replica_stop_compound_cmd,
|
|
|
|
orte_gpr_replica_exec_compound_cmd,
|
|
|
|
/* DIAGNOSTIC OPERATIONS */
|
|
|
|
orte_gpr_replica_dump_all,
|
|
|
|
orte_gpr_replica_dump_segments,
|
|
|
|
orte_gpr_replica_dump_triggers,
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica_dump_subscriptions,
|
2005-09-01 01:07:30 +00:00
|
|
|
orte_gpr_replica_dump_a_trigger,
|
|
|
|
orte_gpr_replica_dump_a_subscription,
|
2005-08-01 16:38:15 +00:00
|
|
|
orte_gpr_replica_dump_local_triggers,
|
|
|
|
orte_gpr_replica_dump_local_subscriptions,
|
2005-03-28 22:37:54 +00:00
|
|
|
orte_gpr_replica_dump_callbacks,
|
|
|
|
orte_gpr_replica_dump_notify_msg,
|
|
|
|
orte_gpr_replica_dump_notify_data,
|
2005-05-01 00:53:00 +00:00
|
|
|
orte_gpr_replica_dump_value,
|
2006-02-07 03:32:36 +00:00
|
|
|
orte_gpr_replica_dump_segment_size,
|
2005-03-14 20:57:21 +00:00
|
|
|
/* CLEANUP OPERATIONS */
|
|
|
|
orte_gpr_replica_cleanup_job,
|
|
|
|
orte_gpr_replica_cleanup_proc
|
2004-08-15 03:33:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Whether or not we allowed this component to be selected
|
|
|
|
*/
|
|
|
|
static bool initialized = false;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* globals needed within replica component
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_t orte_gpr_replica;
|
|
|
|
|
|
|
|
orte_gpr_replica_globals_t orte_gpr_replica_globals;
|
|
|
|
|
2005-06-24 16:59:37 +00:00
|
|
|
/* instantiate the classes */
|
2005-09-19 15:29:14 +00:00
|
|
|
#include "orte/mca/gpr/replica/gpr_replica_class_instances.h"
|
2004-11-20 19:12:43 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_replica_open(void)
|
2004-08-15 03:33:13 +00:00
|
|
|
{
|
2005-03-14 20:57:21 +00:00
|
|
|
int id, tmp;
|
2004-08-28 01:59:56 +00:00
|
|
|
|
2005-09-19 15:29:14 +00:00
|
|
|
OPAL_TRACE(5);
|
|
|
|
|
2004-08-28 01:59:56 +00:00
|
|
|
id = mca_base_param_register_int("gpr", "replica", "debug", NULL, 0);
|
2005-03-14 20:57:21 +00:00
|
|
|
mca_base_param_lookup_int(id, &tmp);
|
|
|
|
if (tmp) {
|
|
|
|
orte_gpr_replica_globals.debug = true;
|
|
|
|
} else {
|
|
|
|
orte_gpr_replica_globals.debug = false;
|
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
id = mca_base_param_register_int("gpr", "replica", "isolate", NULL, 0);
|
|
|
|
mca_base_param_lookup_int(id, &tmp);
|
|
|
|
if (tmp) {
|
|
|
|
orte_gpr_replica_globals.isolate = true;
|
|
|
|
} else {
|
|
|
|
orte_gpr_replica_globals.isolate = false;
|
|
|
|
}
|
2004-08-28 01:59:56 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-08-15 03:33:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2005-03-14 20:57:21 +00:00
|
|
|
* close function
|
2004-08-15 03:33:13 +00:00
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_replica_close(void)
|
2004-08-15 03:33:13 +00:00
|
|
|
{
|
2005-09-19 15:29:14 +00:00
|
|
|
OPAL_TRACE(5);
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-08-15 03:33:13 +00:00
|
|
|
}
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_base_module_t *orte_gpr_replica_init(bool *allow_multi_user_threads, bool *have_hidden_threads, int *priority)
|
2004-08-15 03:33:13 +00:00
|
|
|
{
|
2005-05-24 13:39:15 +00:00
|
|
|
int rc;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-09-19 15:29:14 +00:00
|
|
|
OPAL_TRACE(5);
|
|
|
|
|
Not as bad as this all may look. Tim and I made a significant change to the way we handle the startup of the oob, the seed, etc. We have made it backwards-compatible so that mpirun2 and singleton operations remain working. We had to adjust the name server and gpr as well, plus the process_info structure.
This also includes a checkpoint update to openmpi.c and ompid.c. I have re-enabled the ompid compile.
This latter raises an important point. The trunk compiles the programs like ompid just fine under Linux. It also does just fine for OSX under the dynamic libraries. However, we are seeing errors when compiling under OSX for the static case - the linker seems to have trouble resolving some variable names, even though linker diagnostics show the variables as being defined. Thus, a warning to Mac users that you may have to locally turn things off if you are trying to do static compiles. We ask, however, that you don't commit those changes that turn things off for everyone else - instead, let's try to figure out why the static compile is having a problem, and let everyone else continue to work.
Thanks
Ralph
This commit was SVN r2534.
2004-09-08 03:59:06 +00:00
|
|
|
/* If we are to host a replica, then we want to be selected, so do all the
|
2004-08-15 03:33:13 +00:00
|
|
|
setup and return the module */
|
|
|
|
|
2005-05-05 19:14:51 +00:00
|
|
|
if (NULL == orte_process_info.gpr_replica_uri) {
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2005-09-01 01:07:30 +00:00
|
|
|
/* Return a module (choose an arbitrary, positive priority --
|
|
|
|
it's only relevant compared to other ns components). If
|
|
|
|
we're not the seed, then we don't want to be selected, so
|
|
|
|
return NULL. */
|
|
|
|
|
|
|
|
*priority = 50;
|
|
|
|
|
|
|
|
/* We allow multi user threads but don't have any hidden threads */
|
|
|
|
|
|
|
|
*allow_multi_user_threads = true;
|
|
|
|
*have_hidden_threads = false;
|
|
|
|
|
|
|
|
/* setup the thread locks and condition variables */
|
|
|
|
OBJ_CONSTRUCT(&orte_gpr_replica_globals.mutex, opal_mutex_t);
|
|
|
|
|
|
|
|
/* initialize the registry head */
|
2005-06-24 16:59:37 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica.segments),
|
2006-10-20 02:25:50 +00:00
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_max_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size))) {
|
2005-06-24 16:59:37 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
orte_gpr_replica.num_segs = 0;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-06-24 16:59:37 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica.triggers),
|
2006-10-20 02:25:50 +00:00
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_max_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size))) {
|
2005-06-24 16:59:37 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
orte_gpr_replica.num_trigs = 0;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-06-24 16:59:37 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica.subscriptions),
|
2006-10-20 02:25:50 +00:00
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_max_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size))) {
|
2005-06-24 16:59:37 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
orte_gpr_replica.num_subs = 0;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
|
|
|
/* initialize the callback list head */
|
|
|
|
OBJ_CONSTRUCT(&orte_gpr_replica.callbacks, opal_list_t);
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica.processing_callbacks = false;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-06-24 16:59:37 +00:00
|
|
|
/* initialize the local subscription and trigger trackers */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(
|
|
|
|
&(orte_gpr_replica_globals.local_subscriptions),
|
2006-10-20 02:25:50 +00:00
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_max_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size))) {
|
2005-06-24 16:59:37 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
orte_gpr_replica_globals.num_local_subs = 0;
|
2005-07-18 18:49:00 +00:00
|
|
|
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(
|
|
|
|
&(orte_gpr_replica_globals.local_triggers),
|
2006-10-20 02:25:50 +00:00
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_max_size,
|
|
|
|
(orte_std_cntr_t)orte_gpr_array_block_size))) {
|
2005-07-18 18:49:00 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
orte_gpr_replica_globals.num_local_trigs = 0;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
/* initialize the search arrays for temporarily storing search results */
|
2005-06-24 16:59:37 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica_globals.sub_ptrs),
|
2006-10-20 02:25:50 +00:00
|
|
|
100, (orte_std_cntr_t)orte_gpr_array_max_size, 100))) {
|
2005-06-24 16:59:37 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2005-05-24 13:39:15 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica_globals.srch_cptr),
|
2006-10-20 02:25:50 +00:00
|
|
|
100, (orte_std_cntr_t)orte_gpr_array_max_size, 100))) {
|
2005-05-24 13:39:15 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica_globals.num_srch_cptr = 0;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-07-16 23:08:15 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica_globals.overwritten),
|
2006-10-20 02:25:50 +00:00
|
|
|
20, (orte_std_cntr_t)orte_gpr_array_max_size, 20))) {
|
2005-07-16 23:08:15 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
orte_gpr_replica_globals.num_overwritten = 0;
|
|
|
|
|
2005-05-24 13:39:15 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica_globals.srch_ival),
|
2006-10-20 02:25:50 +00:00
|
|
|
100, (orte_std_cntr_t)orte_gpr_array_max_size, 100))) {
|
2005-05-24 13:39:15 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
2005-03-14 20:57:21 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica_globals.num_srch_ival = 0;
|
|
|
|
|
2005-06-08 19:40:38 +00:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_pointer_array_init(&(orte_gpr_replica_globals.acted_upon),
|
2006-10-20 02:25:50 +00:00
|
|
|
100, (orte_std_cntr_t)orte_gpr_array_max_size, 100))) {
|
2005-06-08 19:40:38 +00:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica_globals.num_acted_upon = 0;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-09-01 17:38:04 +00:00
|
|
|
OBJ_CONSTRUCT(&(orte_gpr_replica_globals.srch_itag), orte_bitmap_t);
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
if (orte_gpr_replica_globals.debug) {
|
2005-07-03 23:31:27 +00:00
|
|
|
opal_output(0, "nb receive setup");
|
2005-03-14 20:57:21 +00:00
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
|
|
|
/* Return the module */
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
initialized = true;
|
|
|
|
return &orte_gpr_replica_module;
|
|
|
|
} else {
|
2005-09-01 01:07:30 +00:00
|
|
|
return NULL;
|
2005-03-14 20:57:21 +00:00
|
|
|
}
|
|
|
|
}
|
2004-08-19 15:14:29 +00:00
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_replica_module_init(void)
|
|
|
|
{
|
2005-09-19 15:29:14 +00:00
|
|
|
OPAL_TRACE(5);
|
|
|
|
|
2005-09-01 01:07:30 +00:00
|
|
|
/* issue the non-blocking receive */
|
2005-03-14 20:57:21 +00:00
|
|
|
if (!orte_gpr_replica_globals.isolate) {
|
2005-10-20 22:06:11 +00:00
|
|
|
int rc = orte_rml.recv_buffer_nb(
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 19:34:59 +00:00
|
|
|
ORTE_NAME_WILDCARD, ORTE_RML_TAG_GPR, ORTE_RML_PERSISTENT, orte_gpr_replica_recv, NULL);
|
2005-03-24 15:45:44 +00:00
|
|
|
if(rc < 0) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2004-08-15 03:33:13 +00:00
|
|
|
}
|
2005-03-14 20:57:21 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-08-15 03:33:13 +00:00
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* finalize routine
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_gpr_replica_finalize(void)
|
2004-08-15 03:33:13 +00:00
|
|
|
{
|
2006-08-15 19:54:10 +00:00
|
|
|
orte_std_cntr_t i;
|
2005-09-02 18:50:01 +00:00
|
|
|
orte_gpr_subscription_id_t j;
|
|
|
|
orte_gpr_trigger_id_t k;
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_segment_t** seg;
|
2005-06-24 16:59:37 +00:00
|
|
|
orte_gpr_replica_trigger_t** trig;
|
2005-09-01 17:38:04 +00:00
|
|
|
orte_gpr_replica_subscription_t** subs;
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_gpr_replica_callbacks_t* cb;
|
2005-09-01 17:38:04 +00:00
|
|
|
orte_gpr_replica_local_subscriber_t **lsubs;
|
|
|
|
orte_gpr_replica_local_trigger_t **ltrigs;
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-09-19 15:29:14 +00:00
|
|
|
OPAL_TRACE(5);
|
2004-08-27 15:36:53 +00:00
|
|
|
|
2005-09-02 18:50:01 +00:00
|
|
|
/* destruct the thread lock */
|
|
|
|
OBJ_DESTRUCT(&orte_gpr_replica_globals.mutex);
|
|
|
|
|
2005-09-01 17:38:04 +00:00
|
|
|
if (NULL != orte_gpr_replica.segments) {
|
|
|
|
seg = (orte_gpr_replica_segment_t**)(orte_gpr_replica.segments)->addr;
|
|
|
|
for (i=0, j=0; j < orte_gpr_replica.num_segs &&
|
|
|
|
i < (orte_gpr_replica.segments)->size; i++) {
|
|
|
|
if (NULL != seg[i]) {
|
|
|
|
j++;
|
|
|
|
OBJ_RELEASE(seg[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_gpr_replica.segments);
|
2005-03-14 20:57:21 +00:00
|
|
|
}
|
2005-09-01 17:38:04 +00:00
|
|
|
|
|
|
|
if (NULL != orte_gpr_replica.triggers) {
|
|
|
|
trig = (orte_gpr_replica_trigger_t**)(orte_gpr_replica.triggers)->addr;
|
|
|
|
for (i=0, j=0; j < orte_gpr_replica.num_trigs &&
|
|
|
|
i < (orte_gpr_replica.triggers)->size; i++) {
|
|
|
|
if (NULL != trig[i]) {
|
|
|
|
j++;
|
|
|
|
OBJ_RELEASE(trig[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_gpr_replica.triggers);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != orte_gpr_replica.subscriptions) {
|
|
|
|
subs = (orte_gpr_replica_subscription_t**)(orte_gpr_replica.subscriptions)->addr;
|
|
|
|
for (i=0, j=0; j < orte_gpr_replica.num_subs &&
|
|
|
|
i < (orte_gpr_replica.subscriptions)->size; i++) {
|
|
|
|
if (NULL != subs[i]) {
|
|
|
|
j++;
|
|
|
|
OBJ_RELEASE(subs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_gpr_replica.subscriptions);
|
2005-03-14 20:57:21 +00:00
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-07-03 16:22:16 +00:00
|
|
|
while (NULL != (cb = (orte_gpr_replica_callbacks_t*)opal_list_remove_first(&orte_gpr_replica.callbacks))) {
|
2005-03-14 20:57:21 +00:00
|
|
|
OBJ_RELEASE(cb);
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&orte_gpr_replica.callbacks);
|
2004-09-03 13:54:34 +00:00
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
|
2005-09-01 17:38:04 +00:00
|
|
|
/* clear the local subscriptions and triggers */
|
|
|
|
if (NULL != orte_gpr_replica_globals.local_subscriptions) {
|
2005-09-02 18:50:01 +00:00
|
|
|
lsubs = (orte_gpr_replica_local_subscriber_t**)(orte_gpr_replica_globals.local_subscriptions)->addr;
|
|
|
|
for (i=0, k=0; k < orte_gpr_replica_globals.num_local_subs &&
|
2005-09-01 17:38:04 +00:00
|
|
|
i < (orte_gpr_replica_globals.local_subscriptions)->size; i++) {
|
|
|
|
if (NULL != lsubs[i]) {
|
2005-09-02 18:50:01 +00:00
|
|
|
k++;
|
2005-09-01 17:38:04 +00:00
|
|
|
OBJ_RELEASE(lsubs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.local_subscriptions);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != orte_gpr_replica_globals.local_triggers) {
|
2005-09-02 18:50:01 +00:00
|
|
|
ltrigs = (orte_gpr_replica_local_trigger_t**)(orte_gpr_replica_globals.local_triggers)->addr;
|
2005-09-01 17:38:04 +00:00
|
|
|
for (i=0, j=0; j < orte_gpr_replica_globals.num_local_trigs &&
|
|
|
|
i < (orte_gpr_replica_globals.local_triggers)->size; i++) {
|
|
|
|
if (NULL != ltrigs[i]) {
|
|
|
|
j++;
|
|
|
|
OBJ_RELEASE(ltrigs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.local_triggers);
|
|
|
|
}
|
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
/* clean up the globals */
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-03-31 21:32:12 +00:00
|
|
|
if (NULL != orte_gpr_replica_globals.srch_cptr) {
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.srch_cptr);
|
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-07-16 23:08:15 +00:00
|
|
|
if (NULL != orte_gpr_replica_globals.overwritten) {
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.overwritten);
|
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
2005-09-01 17:38:04 +00:00
|
|
|
if (NULL != orte_gpr_replica_globals.sub_ptrs) {
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.sub_ptrs);
|
|
|
|
}
|
|
|
|
|
2005-03-31 21:32:12 +00:00
|
|
|
if (NULL != orte_gpr_replica_globals.srch_ival) {
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.srch_ival);
|
|
|
|
}
|
|
|
|
|
2005-06-08 19:40:38 +00:00
|
|
|
if (NULL != orte_gpr_replica_globals.acted_upon) {
|
|
|
|
OBJ_RELEASE(orte_gpr_replica_globals.acted_upon);
|
|
|
|
}
|
|
|
|
|
2005-09-01 17:38:04 +00:00
|
|
|
OBJ_DESTRUCT(&(orte_gpr_replica_globals.srch_itag));
|
|
|
|
|
2004-08-15 03:33:13 +00:00
|
|
|
/* All done */
|
2005-03-14 20:57:21 +00:00
|
|
|
if (orte_gpr_replica_globals.isolate) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2005-09-01 01:07:30 +00:00
|
|
|
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 19:34:59 +00:00
|
|
|
orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_GPR);
|
2006-02-07 03:32:36 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-08-15 03:33:13 +00:00
|
|
|
}
|