From ec28040c581fb1234a315433d78781676e67518f Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Tue, 20 Jun 2006 14:16:52 +0000 Subject: [PATCH] Remove all useless assignment (now they are done inside the macro). Protect one call to the _UNPACK macro, in the case where the length of the received data is zero. This might happens on the PUT protocol. This commit was SVN r10431. --- ompi/mca/pml/ob1/pml_ob1_recvreq.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/ompi/mca/pml/ob1/pml_ob1_recvreq.c b/ompi/mca/pml/ob1/pml_ob1_recvreq.c index 4396de4d10..38da1645ea 100644 --- a/ompi/mca/pml/ob1/pml_ob1_recvreq.c +++ b/ompi/mca/pml/ob1/pml_ob1_recvreq.c @@ -474,7 +474,6 @@ void mca_pml_ob1_recv_request_progress( bytes_received -= sizeof(mca_pml_ob1_match_hdr_t); recvreq->req_recv.req_bytes_packed = bytes_received; - recvreq->req_bytes_delivered = bytes_received; MCA_PML_OB1_RECV_REQUEST_MATCHED(recvreq,&hdr->hdr_match); MCA_PML_OB1_RECV_REQUEST_UNPACK( recvreq, @@ -490,24 +489,29 @@ void mca_pml_ob1_recv_request_progress( bytes_received -= sizeof(mca_pml_ob1_rendezvous_hdr_t); recvreq->req_recv.req_bytes_packed = hdr->hdr_rndv.hdr_msg_length; - recvreq->req_bytes_delivered = hdr->hdr_rndv.hdr_msg_length; recvreq->req_send = hdr->hdr_rndv.hdr_src_req; MCA_PML_OB1_RECV_REQUEST_MATCHED(recvreq,&hdr->hdr_match); mca_pml_ob1_recv_request_ack(recvreq, &hdr->hdr_rndv, bytes_received); - MCA_PML_OB1_RECV_REQUEST_UNPACK( - recvreq, - segments, - num_segments, - sizeof(mca_pml_ob1_rendezvous_hdr_t), - data_offset, - bytes_received, - bytes_delivered); + /** + * The PUT protocol do not attach any data to the original request. + * Therefore, we might want to avoid unpacking if there is nothing to + * unpack. + */ + if( 0 < bytes_received ) { + MCA_PML_OB1_RECV_REQUEST_UNPACK( + recvreq, + segments, + num_segments, + sizeof(mca_pml_ob1_rendezvous_hdr_t), + data_offset, + bytes_received, + bytes_delivered); + } break; case MCA_PML_OB1_HDR_TYPE_RGET: recvreq->req_recv.req_bytes_packed = hdr->hdr_rndv.hdr_msg_length; - recvreq->req_bytes_delivered = hdr->hdr_rndv.hdr_msg_length; MCA_PML_OB1_RECV_REQUEST_MATCHED(recvreq,&hdr->hdr_match); mca_pml_ob1_recv_request_rget(recvreq, btl, &hdr->hdr_rget); return;