|
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
|
@@ -424,29 +425,31 @@ int mca_pml_ob1_send_request_start_buffered(
|
424 | 425 | des->des_cbfunc = mca_pml_ob1_rndv_completion;
|
425 | 426 | des->des_cbdata = sendreq;
|
426 | 427 |
|
427 |
| - /* buffer the remainder of the message */ |
428 |
| - rc = mca_pml_base_bsend_request_alloc((ompi_request_t*)sendreq); |
429 |
| - if( OPAL_UNLIKELY(OMPI_SUCCESS != rc) ) { |
430 |
| - mca_bml_base_free(bml_btl, des); |
431 |
| - return rc; |
432 |
| - } |
| 428 | + /* buffer the remainder of the message if it is not buffered yet */ |
| 429 | + if( OPAL_LIKELY(sendreq->req_send.req_addr == sendreq->req_send.req_base.req_addr) ) { |
| 430 | + rc = mca_pml_base_bsend_request_alloc((ompi_request_t*)sendreq); |
| 431 | + if( OPAL_UNLIKELY(OMPI_SUCCESS != rc) ) { |
| 432 | + mca_bml_base_free(bml_btl, des); |
| 433 | + return rc; |
| 434 | + } |
433 | 435 |
|
434 |
| - iov.iov_base = (IOVBASE_TYPE*)(((unsigned char*)sendreq->req_send.req_addr) + max_data); |
435 |
| - iov.iov_len = max_data = sendreq->req_send.req_bytes_packed - max_data; |
| 436 | + iov.iov_base = (IOVBASE_TYPE*)(((unsigned char*)sendreq->req_send.req_addr) + max_data); |
| 437 | + iov.iov_len = max_data = sendreq->req_send.req_bytes_packed - max_data; |
436 | 438 |
|
437 |
| - if((rc = opal_convertor_pack( &sendreq->req_send.req_base.req_convertor, |
438 |
| - &iov, |
439 |
| - &iov_count, |
440 |
| - &max_data)) < 0) { |
441 |
| - mca_bml_base_free(bml_btl, des); |
442 |
| - return rc; |
443 |
| - } |
| 439 | + if((rc = opal_convertor_pack( &sendreq->req_send.req_base.req_convertor, |
| 440 | + &iov, |
| 441 | + &iov_count, |
| 442 | + &max_data)) < 0) { |
| 443 | + mca_bml_base_free(bml_btl, des); |
| 444 | + return rc; |
| 445 | + } |
444 | 446 |
|
445 |
| - /* re-init convertor for packed data */ |
446 |
| - opal_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, |
447 |
| - &(ompi_mpi_byte.dt.super), |
448 |
| - sendreq->req_send.req_bytes_packed, |
449 |
| - sendreq->req_send.req_addr ); |
| 447 | + /* re-init convertor for packed data */ |
| 448 | + opal_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, |
| 449 | + &(ompi_mpi_byte.dt.super), |
| 450 | + sendreq->req_send.req_bytes_packed, |
| 451 | + sendreq->req_send.req_addr ); |
| 452 | + } |
450 | 453 |
|
451 | 454 | /* wait for ack and completion */
|
452 | 455 | sendreq->req_state = 2;
|
|
0 commit comments