|
18 | 18 | * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. |
19 | 19 | * Copyright (c) 2016 Research Organization for Information Science |
20 | 20 | * and Technology (RIST). All rights reserved. |
| 21 | + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. |
21 | 22 | * $COPYRIGHT$ |
22 | 23 | * |
23 | 24 | * Additional copyrights may follow |
@@ -416,29 +417,31 @@ int mca_pml_ob1_send_request_start_buffered( |
416 | 417 | des->des_cbfunc = mca_pml_ob1_rndv_completion; |
417 | 418 | des->des_cbdata = sendreq; |
418 | 419 |
|
419 | | - /* buffer the remainder of the message */ |
420 | | - rc = mca_pml_base_bsend_request_alloc((ompi_request_t*)sendreq); |
421 | | - if( OPAL_UNLIKELY(OMPI_SUCCESS != rc) ) { |
422 | | - mca_bml_base_free(bml_btl, des); |
423 | | - return rc; |
424 | | - } |
| 420 | + /* buffer the remainder of the message if it is not buffered yet */ |
| 421 | + if( OPAL_LIKELY(sendreq->req_send.req_addr == sendreq->req_send.req_base.req_addr) ) { |
| 422 | + rc = mca_pml_base_bsend_request_alloc((ompi_request_t*)sendreq); |
| 423 | + if( OPAL_UNLIKELY(OMPI_SUCCESS != rc) ) { |
| 424 | + mca_bml_base_free(bml_btl, des); |
| 425 | + return rc; |
| 426 | + } |
425 | 427 |
|
426 | | - iov.iov_base = (IOVBASE_TYPE*)(((unsigned char*)sendreq->req_send.req_addr) + max_data); |
427 | | - iov.iov_len = max_data = sendreq->req_send.req_bytes_packed - max_data; |
| 428 | + iov.iov_base = (IOVBASE_TYPE*)(((unsigned char*)sendreq->req_send.req_addr) + max_data); |
| 429 | + iov.iov_len = max_data = sendreq->req_send.req_bytes_packed - max_data; |
428 | 430 |
|
429 | | - if((rc = opal_convertor_pack( &sendreq->req_send.req_base.req_convertor, |
430 | | - &iov, |
431 | | - &iov_count, |
432 | | - &max_data)) < 0) { |
433 | | - mca_bml_base_free(bml_btl, des); |
434 | | - return rc; |
435 | | - } |
| 431 | + if((rc = opal_convertor_pack( &sendreq->req_send.req_base.req_convertor, |
| 432 | + &iov, |
| 433 | + &iov_count, |
| 434 | + &max_data)) < 0) { |
| 435 | + mca_bml_base_free(bml_btl, des); |
| 436 | + return rc; |
| 437 | + } |
436 | 438 |
|
437 | | - /* re-init convertor for packed data */ |
438 | | - opal_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, |
439 | | - &(ompi_mpi_byte.dt.super), |
440 | | - sendreq->req_send.req_bytes_packed, |
441 | | - sendreq->req_send.req_addr ); |
| 439 | + /* re-init convertor for packed data */ |
| 440 | + opal_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, |
| 441 | + &(ompi_mpi_byte.dt.super), |
| 442 | + sendreq->req_send.req_bytes_packed, |
| 443 | + sendreq->req_send.req_addr ); |
| 444 | + } |
442 | 445 |
|
443 | 446 | /* wait for ack and completion */ |
444 | 447 | sendreq->req_state = 2; |
|
0 commit comments