From 24316b77cf8062f9192f5b72e89b3f04005d45d5 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 25 Jun 2008 03:35:07 +0000 Subject: [PATCH] This commit is related to ticket #1362. The following devices respect the behavior described on the ticket: elan, gm, mx, self, sm, tcp. This commit was SVN r18734. --- ompi/mca/btl/elan/btl_elan_component.c | 4 ++++ ompi/mca/btl/gm/btl_gm_component.c | 6 ++---- ompi/mca/btl/mx/btl_mx_component.c | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ompi/mca/btl/elan/btl_elan_component.c b/ompi/mca/btl/elan/btl_elan_component.c index 45a964f48f..2d6e1919ff 100644 --- a/ompi/mca/btl/elan/btl_elan_component.c +++ b/ompi/mca/btl/elan/btl_elan_component.c @@ -338,6 +338,7 @@ int mca_btl_elan_component_progress( void ) OPAL_THREAD_UNLOCK(&elan_btl->elan_lock); } /* If there are any pending sends check their completion */ + recheck_send_list: if( !opal_list_is_empty( &(elan_btl->send_list) ) && !OPAL_THREAD_TRYLOCK(&elan_btl->elan_lock) ) { mca_btl_elan_frag_t* frag = (mca_btl_elan_frag_t*)opal_list_get_first( &(elan_btl->send_list) ); if( (NULL != frag) && elan_poll(frag->elan_event, 0) ) { @@ -352,10 +353,12 @@ int mca_btl_elan_component_progress( void ) if( btl_ownership ) { MCA_BTL_ELAN_FRAG_RETURN(frag); } + goto recheck_send_list; } else { OPAL_THREAD_UNLOCK(&elan_btl->elan_lock); } } + recheck_rdma_list: /* If any RDMA have been posted, check their status */ if( !opal_list_is_empty( &(elan_btl->rdma_list) ) && !OPAL_THREAD_TRYLOCK(&elan_btl->elan_lock) ) { mca_btl_elan_frag_t* frag = (mca_btl_elan_frag_t*)opal_list_get_first( &(elan_btl->rdma_list) ); @@ -371,6 +374,7 @@ int mca_btl_elan_component_progress( void ) if( btl_ownership ) { MCA_BTL_ELAN_FRAG_RETURN(frag); } + goto recheck_rdma_list; } else { OPAL_THREAD_UNLOCK(&elan_btl->elan_lock); } diff --git a/ompi/mca/btl/gm/btl_gm_component.c b/ompi/mca/btl/gm/btl_gm_component.c index bf2d881f74..797f49c2fd 100644 --- a/ompi/mca/btl/gm/btl_gm_component.c +++ b/ompi/mca/btl/gm/btl_gm_component.c @@ -607,8 +607,7 @@ int mca_btl_gm_component_progress() reg->cbfunc(&btl->super, hdr->tag, &frag->base, reg->cbdata); OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock); } else { - btl->error_cb(&btl->super, - MCA_BTL_ERROR_FLAGS_FATAL); + btl->error_cb(&btl->super, MCA_BTL_ERROR_FLAGS_FATAL); return 0; } MCA_BTL_GM_FRAG_POST(btl,frag); @@ -634,8 +633,7 @@ int mca_btl_gm_component_progress() MCA_BTL_GM_FRAG_POST(btl,frag); } else { - btl->error_cb(&btl->super, - MCA_BTL_ERROR_FLAGS_FATAL); + btl->error_cb(&btl->super, MCA_BTL_ERROR_FLAGS_FATAL); return 0; } count++; diff --git a/ompi/mca/btl/mx/btl_mx_component.c b/ompi/mca/btl/mx/btl_mx_component.c index 383866ff04..ff56f17a13 100644 --- a/ompi/mca/btl/mx/btl_mx_component.c +++ b/ompi/mca/btl/mx/btl_mx_component.c @@ -594,6 +594,7 @@ int mca_btl_mx_component_progress(void) mca_btl_mx_module_t* mx_btl = mca_btl_mx_component.mx_btls[i]; uint32_t mx_result = 0; + recheck_device: mx_return = mx_ipeek( mx_btl->mx_endpoint, &mx_request, &mx_result ); if( OPAL_UNLIKELY(mx_return != MX_SUCCESS) ) { opal_output( 0, "mca_btl_mx_component_progress: mx_ipeek() failed with status %d (%s)\n", @@ -616,6 +617,7 @@ int mca_btl_mx_component_progress(void) * are supposed to do next. */ frag = mx_status.context; + num_progressed++; if( NULL != frag ) { if( MCA_BTL_MX_SEND == frag->type ) { /* it's a send */ int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP); @@ -627,6 +629,7 @@ int mca_btl_mx_component_progress(void) if( btl_ownership ) { MCA_BTL_MX_FRAG_RETURN( mx_btl, frag ); } + goto recheck_device; } else if( !mca_btl_mx_component.mx_use_unexpected ) { /* and this one is a receive */ mca_btl_active_message_callback_t* reg; mx_segment_t mx_segment; @@ -651,7 +654,6 @@ int mca_btl_mx_component_progress(void) } } } - num_progressed++; } return num_progressed; }