diff --git a/ompi/mca/btl/portals/btl_portals.c b/ompi/mca/btl/portals/btl_portals.c index bd2fd8ff20..9d49c48755 100644 --- a/ompi/mca/btl/portals/btl_portals.c +++ b/ompi/mca/btl/portals/btl_portals.c @@ -251,7 +251,7 @@ mca_btl_portals_alloc(struct mca_btl_base_module_t* btl_base, } frag->base.des_src_cnt = 1; - frag->base.des_flags = flags; + frag->base.des_flags = flags | MCA_BTL_DES_SEND_ALWAYS_CALLBACK; frag->base.order = MCA_BTL_NO_ORDER; return &frag->base; @@ -411,7 +411,7 @@ mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base, frag->base.des_src = frag->segments; frag->base.des_dst = NULL; frag->base.des_dst_cnt = 0; - frag->base.des_flags = flags; + frag->base.des_flags = flags | MCA_BTL_DES_SEND_ALWAYS_CALLBACK; frag->base.order = MCA_BTL_NO_ORDER; return &frag->base; } @@ -455,8 +455,8 @@ mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base, frag->base.des_src_cnt = 0; frag->base.des_dst = frag->segments; frag->base.des_dst_cnt = 1; - frag->base.des_flags = flags; - + frag->base.des_flags = flags | MCA_BTL_DES_SEND_ALWAYS_CALLBACK; + OPAL_OUTPUT_VERBOSE((90, mca_btl_portals_component.portals_output, "rdma dest posted for frag 0x%lx, callback 0x%lx, bits %" PRIu64 " flags %d", (unsigned long) frag, diff --git a/ompi/mca/btl/portals/btl_portals_component.c b/ompi/mca/btl/portals/btl_portals_component.c index 141a8ba6c6..713be0c968 100644 --- a/ompi/mca/btl/portals/btl_portals_component.c +++ b/ompi/mca/btl/portals/btl_portals_component.c @@ -535,10 +535,12 @@ mca_btl_portals_component_progress(void) if (ev.ni_fail_type != PTL_NI_OK) { opal_output(mca_btl_portals_component.portals_output, "Failure to end send event\n"); - frag->base.des_cbfunc(&mca_btl_portals_module.super, - frag->endpoint, - &frag->base, - OMPI_ERROR); + if( MCA_BTL_DES_SEND_ALWAYS_CALLBACK & frag->base.des_flags ){ + frag->base.des_cbfunc(&mca_btl_portals_module.super, + frag->endpoint, + &frag->base, + OMPI_ERROR); + } if( btl_ownership ) { mca_btl_portals_free(&mca_btl_portals_module.super, &frag->base); @@ -547,10 +549,12 @@ mca_btl_portals_component_progress(void) #endif if(!mca_btl_portals_component.portals_need_ack) { /* my part's done, in portals we trust! */ - frag->base.des_cbfunc(&mca_btl_portals_module.super, - frag->endpoint, - &frag->base, - OMPI_SUCCESS); + if( MCA_BTL_DES_SEND_ALWAYS_CALLBACK & frag->base.des_flags ){ + frag->base.des_cbfunc(&mca_btl_portals_module.super, + frag->endpoint, + &frag->base, + OMPI_SUCCESS); + } if( btl_ownership ) { mca_btl_portals_free(&mca_btl_portals_module.super, &frag->base); @@ -583,10 +587,12 @@ mca_btl_portals_component_progress(void) if (ev.ni_fail_type != PTL_NI_OK) { opal_output(mca_btl_portals_component.portals_output, "Failure to ack event\n"); - frag->base.des_cbfunc(&mca_btl_portals_module.super, - frag->endpoint, - &frag->base, - OMPI_ERROR); + if( MCA_BTL_DES_SEND_ALWAYS_CALLBACK & frag->base.des_flags ){ + frag->base.des_cbfunc(&mca_btl_portals_module.super, + frag->endpoint, + &frag->base, + OMPI_ERROR); + } if( btl_ownership ) { mca_btl_portals_free(&mca_btl_portals_module.super, &frag->base); @@ -611,10 +617,12 @@ mca_btl_portals_component_progress(void) /* other side received the message. should have received entire thing */ /* let the PML know we're done */ - frag->base.des_cbfunc(&mca_btl_portals_module.super, - frag->endpoint, - &frag->base, - OMPI_SUCCESS); + if( MCA_BTL_DES_SEND_ALWAYS_CALLBACK & frag->base.des_flags ) { + frag->base.des_cbfunc(&mca_btl_portals_module.super, + frag->endpoint, + &frag->base, + OMPI_SUCCESS); + } if( btl_ownership ) { mca_btl_portals_free(&mca_btl_portals_module.super, &frag->base);