From 7473d04a9a9090e8f6c114129bb43fe647b5ed29 Mon Sep 17 00:00:00 2001 From: Galen Shipman Date: Wed, 16 Aug 2006 22:32:18 +0000 Subject: [PATCH] Simple failover is working.. ;-) This commit was SVN r11237. --- ompi/mca/pml/dr/pml_dr_sendreq.c | 18 ++++++++++++----- ompi/mca/pml/dr/pml_dr_vfrag.c | 33 ++++++++++++++++---------------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/ompi/mca/pml/dr/pml_dr_sendreq.c b/ompi/mca/pml/dr/pml_dr_sendreq.c index 2035c75d58..7124669f43 100644 --- a/ompi/mca/pml/dr/pml_dr_sendreq.c +++ b/ompi/mca/pml/dr/pml_dr_sendreq.c @@ -173,7 +173,9 @@ static void mca_pml_dr_match_completion( /* return descriptor */ if(NULL != sendreq->req_descriptor) { - mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor); + if(NULL != sendreq->req_descriptor->des_context) { + mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor); + } sendreq->req_descriptor = NULL; } @@ -238,7 +240,9 @@ static void mca_pml_dr_rndv_completion( OPAL_THREAD_LOCK(&ompi_request_lock); if(vfrag->vf_ack == vfrag->vf_mask) { if(sendreq->req_descriptor) { - mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor); + if(NULL != sendreq->req_descriptor->des_context) { + mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor); + } sendreq->req_descriptor = NULL; } @@ -670,7 +674,7 @@ int mca_pml_dr_send_request_start_rndv( if(NULL == des) { return OMPI_ERR_OUT_OF_RESOURCE; } - sendreq->req_descriptor = des; /* hang on to this for later */ + sendreq->req_descriptor = des; /*hang on to this for later */ segment = des->des_src; /* build hdr */ @@ -986,7 +990,9 @@ void mca_pml_dr_send_request_match_ack( /* if already have local completion free descriptor and complete message */ /* return descriptor */ if(NULL != sendreq->req_descriptor) { - mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor ); + if(NULL != sendreq->req_descriptor->des_context) { + mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor ); + } sendreq->req_descriptor = NULL; } @@ -1040,7 +1046,9 @@ void mca_pml_dr_send_request_rndv_ack( } else { /* return descriptor of first fragment */ if(NULL != sendreq->req_descriptor) { - mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor); + if(NULL != sendreq->req_descriptor->des_context) { + mca_bml_base_free(sendreq->req_descriptor->des_context, sendreq->req_descriptor); + } sendreq->req_descriptor = NULL; } diff --git a/ompi/mca/pml/dr/pml_dr_vfrag.c b/ompi/mca/pml/dr/pml_dr_vfrag.c index e9f4d55f3b..4415484eba 100644 --- a/ompi/mca/pml/dr/pml_dr_vfrag.c +++ b/ompi/mca/pml/dr/pml_dr_vfrag.c @@ -24,7 +24,7 @@ static void mca_pml_dr_vfrag_wdog_timeout(int fd, short event, void* vfrag); static void mca_pml_dr_vfrag_ack_timeout(int fd, short event, void* vfrag); - +static void mca_pml_dr_vfrag_cleanup_active_desc(mca_bml_base_btl_t* bml_btl); static void mca_pml_dr_vfrag_construct(mca_pml_dr_vfrag_t* vfrag) { @@ -82,6 +82,7 @@ static void mca_pml_dr_vfrag_wdog_timeout(int fd, short event, void* data) /* declare btl dead */ opal_output(0, "%s:%d:%s: failing BTL: %s", __FILE__, __LINE__, __func__, vfrag->bml_btl->btl->btl_component->btl_version.mca_component_name); + mca_pml_dr_vfrag_cleanup_active_desc(vfrag->bml_btl); mca_bml.bml_del_btl(vfrag->bml_btl->btl); mca_pml_dr_vfrag_reset(vfrag); } @@ -101,21 +102,6 @@ static void mca_pml_dr_vfrag_wdog_timeout(int fd, short event, void* data) } -static void mca_pml_dr_vfrag_cleanup_active_desc(mca_bml_base_btl_t* bml_btl) { - opal_list_item_t* item; - - for (item = opal_list_get_first(&mca_pml_dr.send_active) ; - item != opal_list_get_end(&mca_pml_dr.send_active) ; - item = opal_list_get_next(item)) { - mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*) item; - mca_btl_base_descriptor_t* des = sendreq->req_descriptor; - if( des->des_context == bml_btl) { - des->des_context = NULL; - } - - } -} - /** * The ack timer expired, better do something about it, like resend the entire vfrag? */ @@ -212,3 +198,18 @@ void mca_pml_dr_vfrag_reschedule(mca_pml_dr_vfrag_t* vfrag) } } + +static void mca_pml_dr_vfrag_cleanup_active_desc(mca_bml_base_btl_t* bml_btl) { + opal_list_item_t* item; + + for (item = opal_list_get_first(&mca_pml_dr.send_active) ; + item != opal_list_get_end(&mca_pml_dr.send_active) ; + item = opal_list_get_next(item)) { + mca_pml_dr_send_request_t* sendreq = (mca_pml_dr_send_request_t*) item; + mca_btl_base_descriptor_t* des = sendreq->req_descriptor; + if( des->des_context == bml_btl) { + des->des_context = NULL; + } + + } +}