From ad69d3c6ac7589afee5c19862fd4d3eafe4c8ce6 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Sun, 27 May 2007 08:29:38 +0000 Subject: [PATCH] Fix out of resource handling for FIN packets broken by r14768. This commit was SVN r14780. The following SVN revision numbers were found above: r14768 --> open-mpi/ompi@3401bd2b07b5d205d27d3607657e50445e05402d --- ompi/mca/pml/ob1/pml_ob1.c | 7 +++---- ompi/mca/pml/ob1/pml_ob1.h | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1.c b/ompi/mca/pml/ob1/pml_ob1.c index 47d1b130c9..e582fd93b3 100644 --- a/ompi/mca/pml/ob1/pml_ob1.c +++ b/ompi/mca/pml/ob1/pml_ob1.c @@ -249,7 +249,7 @@ static void mca_pml_ob1_fin_completion( MCA_PML_OB1_PROGRESS_PENDING(bml_btl); } -int mca_pml_ob1_send_fin( +int mca_pml_ob1_send_fin_btl( ompi_proc_t* proc, mca_bml_base_btl_t* bml_btl, void *hdr_des, @@ -260,9 +260,8 @@ int mca_pml_ob1_send_fin( mca_pml_ob1_fin_hdr_t* hdr; int rc; - MCA_PML_OB1_DES_ALLOC(bml_btl, fin, order, sizeof(mca_pml_ob1_fin_hdr_t)); + MCA_PML_OB1_DES_ALLOC(bml_btl, fin, order, sizeof(mca_pml_ob1_fin_hdr_t)); if(NULL == fin) { - MCA_PML_OB1_ADD_FIN_TO_PENDING(proc, hdr_des, bml_btl, order); return OMPI_ERR_OUT_OF_RESOURCE; } fin->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY; @@ -349,7 +348,7 @@ void mca_pml_ob1_process_pending_packets(mca_bml_base_btl_t* bml_btl) } break; case MCA_PML_OB1_HDR_TYPE_FIN: - rc = mca_pml_ob1_send_fin(pckt->proc, send_dst, + rc = mca_pml_ob1_send_fin_btl(pckt->proc, send_dst, pckt->hdr.hdr_fin.hdr_des.pval, pckt->order); MCA_PML_OB1_PCKT_PENDING_RETURN(pckt); diff --git a/ompi/mca/pml/ob1/pml_ob1.h b/ompi/mca/pml/ob1/pml_ob1.h index 61aed86918..39b5c5ce60 100644 --- a/ompi/mca/pml/ob1/pml_ob1.h +++ b/ompi/mca/pml/ob1/pml_ob1.h @@ -283,9 +283,19 @@ do { \ } while(0) -int mca_pml_ob1_send_fin(ompi_proc_t* proc, mca_bml_base_btl_t* bml_btl, - void *hdr_des, uint8_t order); +int mca_pml_ob1_send_fin_btl(ompi_proc_t* proc, mca_bml_base_btl_t* bml_btl, + void *hdr_des, uint8_t order); +static inline int mca_pml_ob1_send_fin(ompi_proc_t* proc, void *hdr_des, + mca_bml_base_btl_t* bml_btl, uint8_t order) +{ + if(mca_pml_ob1_send_fin_btl(proc, bml_btl, hdr_des, order) == OMPI_SUCCESS) + return OMPI_SUCCESS; + + MCA_PML_OB1_ADD_FIN_TO_PENDING(proc, hdr_des, bml_btl, order); + + return OMPI_ERR_OUT_OF_RESOURCE; +} /* This function tries to resend FIN/ACK packets from pckt_pending queue. * Packets are added to the queue when sending of FIN or ACK is failed due to