33 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44 * University Research and Technology
55 * Corporation. All rights reserved.
6- * Copyright (c) 2004-2018 The University of Tennessee and The University
6+ * Copyright (c) 2004-2019 The University of Tennessee and The University
77 * of Tennessee Research Foundation. All rights
88 * reserved.
99 * Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@@ -313,7 +313,12 @@ static int mca_pml_ob1_recv_request_ack(
313313 return OMPI_SUCCESS ;
314314 }
315315
316- /* let know to shedule function there is no need to put ACK flag */
316+ /* let know to shedule function there is no need to put ACK flag. If not all message went over
317+ * RDMA then we cancel the GET protocol in order to switch back to send/recv. In this case send
318+ * back the remote send request, the peer kept a poointer to the frag locally. In the future we
319+ * might want to cancel the fragment itself, in which case we will have to send back the remote
320+ * fragment instead of the remote request.
321+ */
317322 recvreq -> req_ack_sent = true;
318323 return mca_pml_ob1_recv_request_ack_send (proc , hdr -> hdr_src_req .lval ,
319324 recvreq , recvreq -> req_send_offset , 0 ,
@@ -402,6 +407,7 @@ static int mca_pml_ob1_recv_request_put_frag (mca_pml_ob1_rdma_frag_t *frag)
402407#if OPAL_ENABLE_HETEROGENEOUS_SUPPORT
403408 ompi_proc_t * proc = (ompi_proc_t * )recvreq -> req_recv .req_base .req_proc ;
404409#endif
410+ mca_btl_base_registration_handle_t * local_handle = NULL ;
405411 mca_bml_base_btl_t * bml_btl = frag -> rdma_bml ;
406412 mca_btl_base_descriptor_t * ctl ;
407413 mca_pml_ob1_rdma_hdr_t * hdr ;
@@ -410,6 +416,12 @@ static int mca_pml_ob1_recv_request_put_frag (mca_pml_ob1_rdma_frag_t *frag)
410416
411417 reg_size = bml_btl -> btl -> btl_registration_handle_size ;
412418
419+ if (frag -> local_handle ) {
420+ local_handle = frag -> local_handle ;
421+ } else if (recvreq -> local_handle ) {
422+ local_handle = recvreq -> local_handle ;
423+ }
424+
413425 /* prepare a descriptor for rdma control message */
414426 mca_bml_base_alloc (bml_btl , & ctl , MCA_BTL_NO_ORDER , sizeof (mca_pml_ob1_rdma_hdr_t ) + reg_size ,
415427 MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP |
@@ -423,7 +435,7 @@ static int mca_pml_ob1_recv_request_put_frag (mca_pml_ob1_rdma_frag_t *frag)
423435 hdr = (mca_pml_ob1_rdma_hdr_t * ) ctl -> des_segments -> seg_addr .pval ;
424436 mca_pml_ob1_rdma_hdr_prepare (hdr , (!recvreq -> req_ack_sent ) ? MCA_PML_OB1_HDR_TYPE_ACK : 0 ,
425437 recvreq -> remote_req_send .lval , frag , recvreq , frag -> rdma_offset ,
426- frag -> local_address , frag -> rdma_length , frag -> local_handle ,
438+ frag -> local_address , frag -> rdma_length , local_handle ,
427439 reg_size );
428440 ob1_hdr_hton (hdr , MCA_PML_OB1_HDR_TYPE_PUT , proc );
429441
@@ -645,7 +657,6 @@ void mca_pml_ob1_recv_request_progress_rget( mca_pml_ob1_recv_request_t* recvreq
645657 int rc ;
646658
647659 prev_sent = offset = 0 ;
648- bytes_remaining = hdr -> hdr_rndv .hdr_msg_length ;
649660 recvreq -> req_recv .req_bytes_packed = hdr -> hdr_rndv .hdr_msg_length ;
650661 recvreq -> req_send_offset = 0 ;
651662 recvreq -> req_rdma_offset = 0 ;
0 commit comments