diff --git a/ompi/mca/bml/r2/bml_r2_ft.c b/ompi/mca/bml/r2/bml_r2_ft.c index ab75862963..18a54c3709 100644 --- a/ompi/mca/bml/r2/bml_r2_ft.c +++ b/ompi/mca/bml/r2/bml_r2_ft.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2007 The University of Tennessee and The University @@ -40,19 +40,24 @@ #include "bml_r2.h" #include "bml_r2_ft.h" -int mca_bml_r2_ft_event(int state) { +int mca_bml_r2_ft_event(int state) +{ ompi_proc_t** procs = NULL; size_t num_procs; size_t btl_idx; int ret, p; - + int loc_state; + if(OPAL_CRS_CHECKPOINT == state) { /* Do nothing for now */ } else if(OPAL_CRS_CONTINUE == state) { /* Since nothing in Checkpoint, we are fine here */ } - else if(OPAL_CRS_RESTART == state) { + else if(OPAL_CRS_RESTART_PRE == state ) { + /* Nothing here */ + } + else if(OPAL_CRS_RESTART == state ) { procs = ompi_proc_all(&num_procs); if(NULL == procs) { return OMPI_ERR_OUT_OF_RESOURCE; @@ -64,38 +69,53 @@ int mca_bml_r2_ft_event(int state) { else { ; } - - /* - * Call ft_event in: - * - BTL modules - * - MPool modules - * - * These should be cleaning out stale state, and memory references in - * preparation for being shut down. + + /* Never call the ft_event functions attached to the BTLs on the second + * pass of RESTART since on the first pass they were unloaded and therefore + * no longer exist. */ - for(btl_idx = 0; btl_idx < mca_bml_r2.num_btl_modules; btl_idx++) { - /* - * Notify BTL + if( OPAL_CRS_RESTART != state ) { + /* Since we only ever call into the BTLs once during the first restart + * pass, just lie to them on this pass for a bit of local clarity. */ - if( NULL != (mca_bml_r2.btl_modules[btl_idx])->btl_ft_event) { - opal_output_verbose(10, ompi_cr_output, - "bml:r2: ft_event: Notify the %s BTL.\n", - (mca_bml_r2.btl_modules[btl_idx])->btl_component->btl_version.mca_component_name); - if(OMPI_SUCCESS != (ret = (mca_bml_r2.btl_modules[btl_idx])->btl_ft_event(state) ) ) { - continue; - } + if( OPAL_CRS_RESTART_PRE == state ) { + loc_state = OPAL_CRS_RESTART; + } else { + loc_state = state; } - + /* - * Notify Mpool + * Call ft_event in: + * - BTL modules + * - MPool modules + * + * These should be cleaning out stale state, and memory references in + * preparation for being shut down. */ - if( NULL != (mca_bml_r2.btl_modules[btl_idx])->btl_mpool && - NULL != (mca_bml_r2.btl_modules[btl_idx])->btl_mpool->mpool_ft_event ) { - opal_output_verbose(10, ompi_cr_output, - "bml:r2: ft_event: Notify the %s MPool.\n", - (mca_bml_r2.btl_modules[btl_idx])->btl_mpool->mpool_component->mpool_version.mca_component_name); - if(OMPI_SUCCESS != (ret = (mca_bml_r2.btl_modules[btl_idx])->btl_mpool->mpool_ft_event(state) ) ) { - continue; + for(btl_idx = 0; btl_idx < mca_bml_r2.num_btl_modules; btl_idx++) { + /* + * Notify BTL + */ + if( NULL != (mca_bml_r2.btl_modules[btl_idx])->btl_ft_event) { + opal_output_verbose(10, ompi_cr_output, + "bml:r2: ft_event: Notify the %s BTL.\n", + (mca_bml_r2.btl_modules[btl_idx])->btl_component->btl_version.mca_component_name); + if(OMPI_SUCCESS != (ret = (mca_bml_r2.btl_modules[btl_idx])->btl_ft_event(loc_state) ) ) { + continue; + } + } + + /* + * Notify Mpool + */ + if( NULL != (mca_bml_r2.btl_modules[btl_idx])->btl_mpool && + NULL != (mca_bml_r2.btl_modules[btl_idx])->btl_mpool->mpool_ft_event ) { + opal_output_verbose(10, ompi_cr_output, + "bml:r2: ft_event: Notify the %s MPool.\n", + (mca_bml_r2.btl_modules[btl_idx])->btl_mpool->mpool_component->mpool_version.mca_component_name); + if(OMPI_SUCCESS != (ret = (mca_bml_r2.btl_modules[btl_idx])->btl_mpool->mpool_ft_event(loc_state) ) ) { + continue; + } } } } @@ -106,8 +126,7 @@ int mca_bml_r2_ft_event(int state) { else if(OPAL_CRS_CONTINUE == state) { ; } - else if(OPAL_CRS_RESTART == state) { - + else if(OPAL_CRS_RESTART_PRE == state ) { mca_bml_r2.num_btl_modules = 0; mca_bml_r2.num_btl_progress = 0; @@ -136,6 +155,8 @@ int mca_bml_r2_ft_event(int state) { return ret; } + } + else if(OPAL_CRS_RESTART == state ) { /* * Re-open the BTL framework to get the full list of components. */ diff --git a/ompi/mca/pml/ob1/pml_ob1.c b/ompi/mca/pml/ob1/pml_ob1.c index 4afbd25ddf..71c7a1b40d 100644 --- a/ompi/mca/pml/ob1/pml_ob1.c +++ b/ompi/mca/pml/ob1/pml_ob1.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2008 The University of Tennessee and The University @@ -465,7 +465,10 @@ int mca_pml_ob1_ft_event( int state ) else if(OPAL_CRS_CONTINUE == state) { ; } - else if(OPAL_CRS_RESTART == state) { + else if(OPAL_CRS_RESTART_PRE == state ) { + /* Nothing here */ + } + else if(OPAL_CRS_RESTART == state ) { /* * Get a list of processes */ @@ -519,7 +522,10 @@ int mca_pml_ob1_ft_event( int state ) else if(OPAL_CRS_CONTINUE == state) { ; } - else if(OPAL_CRS_RESTART == state) { + else if(OPAL_CRS_RESTART_PRE == state ) { + /* Nothing here */ + } + else if(OPAL_CRS_RESTART == state ) { /* * Exchange the modex information once again. * BTLs will have republished their modex information. diff --git a/ompi/runtime/ompi_cr.c b/ompi/runtime/ompi_cr.c index f1f89fc036..08afd3d46e 100644 --- a/ompi/runtime/ompi_cr.c +++ b/ompi/runtime/ompi_cr.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; -*- */ /* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2007 The University of Tennessee and The University @@ -294,14 +294,25 @@ static int ompi_cr_coord_pre_ckpt(void) { } static int ompi_cr_coord_pre_restart(void) { - /* - * Can not really do much until ORTE is up and running, - * so defer action until the post_restart function. - */ + int ret, exit_status = OMPI_SUCCESS; + opal_output_verbose(10, ompi_cr_output, "ompi_cr: coord_pre_restart: ompi_cr_coord_pre_restart()"); - - return OMPI_SUCCESS; + + /* + * Notify PML + * - Will notify BML and BTL's + * - The intention here is to have the PML shutdown all the old components + * and handles. On the second pass (once ORTE is restarted) we can + * reconnect processes. + */ + if( ORTE_SUCCESS != (ret = mca_pml.pml_ft_event(OPAL_CRS_RESTART_PRE))) { + exit_status = ret; + goto cleanup; + } + + cleanup: + return exit_status; } static int ompi_cr_coord_pre_continue(void) { diff --git a/opal/mca/crs/crs.h b/opal/mca/crs/crs.h index 0eecf2dc4e..e70bf8c562 100644 --- a/opal/mca/crs/crs.h +++ b/opal/mca/crs/crs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * Copyright (c) 2004-2008 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 @@ -60,7 +60,8 @@ extern "C" { */ enum opal_crs_state_type_t { OPAL_CRS_CHECKPOINT, - OPAL_CRS_RESTART, + OPAL_CRS_RESTART_PRE, + OPAL_CRS_RESTART, /* RESTART_POST */ OPAL_CRS_CONTINUE, OPAL_CRS_TERM, OPAL_CRS_RUNNING, diff --git a/opal/runtime/opal_cr.c b/opal/runtime/opal_cr.c index 862f5be398..ae262195bc 100644 --- a/opal/runtime/opal_cr.c +++ b/opal/runtime/opal_cr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * Copyright (c) 2004-2008 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 @@ -810,9 +810,9 @@ static void opal_cr_sigpipe_debug_signal_handler (int signo) return; } - opal_output_verbose(10, opal_cr_output, - "opal_cr: sigpipe_debug: Debug SIGPIPE [%d]: PID (%d)\n", - signo, getpid()); + opal_output(0, + "opal_cr: sigpipe_debug: Debug SIGPIPE [%d]: PID (%d)\n", + signo, getpid()); while(sleeper == 1 ) { sleep(1); } diff --git a/orte/mca/oob/tcp/oob_tcp_msg.c b/orte/mca/oob/tcp/oob_tcp_msg.c index 60495c4160..f40114cc7a 100644 --- a/orte/mca/oob/tcp/oob_tcp_msg.c +++ b/orte/mca/oob/tcp/oob_tcp_msg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2007 The University of Tennessee and The University @@ -273,11 +273,12 @@ bool mca_oob_tcp_msg_send_handler(mca_oob_tcp_msg_t* msg, struct mca_oob_tcp_pee else if (opal_socket_errno == EAGAIN || opal_socket_errno == EWOULDBLOCK) return false; else { - opal_output(0, "%s-%s mca_oob_tcp_msg_send_handler: writev failed: %s (%d)", + opal_output(0, "%s-%s mca_oob_tcp_msg_send_handler: writev failed: %s (%d) [sd = %d]", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(&(peer->peer_name)), strerror(opal_socket_errno), - opal_socket_errno); + opal_socket_errno, + peer->peer_sd); mca_oob_tcp_peer_close(peer); msg->msg_rc = ORTE_ERR_CONNECTION_FAILED; return true;