1616 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1717 * reserved.
1818 * Copyright (c) 2017 IBM Corporation. All rights reserved.
19- * Copyright (c) 2018 Triad National Security, LLC. All rights
19+ * Copyright (c) 2018-2025 Triad National Security, LLC. All rights
2020 * reserved.
2121 * $COPYRIGHT$
2222 *
@@ -471,16 +471,6 @@ int mca_pml_base_bsend_flush(ompi_bsend_buffer_type_t type, void *obj)
471471 return ret ;
472472}
473473
474- #if 0
475- static int mca_pml_base_bsend_request_free (ompi_request_t * * request )
476- {
477- (* request )-> req_state = OMPI_REQUEST_INVALID ;
478- OBJ_RELEASE (* request );
479- * request = MPI_REQUEST_NULL ;
480- return OMPI_SUCCESS ;
481- }
482- #endif
483-
484474/*
485475 * TODO: right now treating this as blocking
486476 */
@@ -527,14 +517,6 @@ int mca_pml_base_bsend_iflush(ompi_bsend_buffer_type_t type, void *obj, ompi_req
527517 break ;
528518 }
529519
530- #if 0
531- /* Set up request */
532- flush_request = OBJ_NEW (ompi_request_t );
533- OMPI_REQUEST_INIT (flush_request , 0 );
534- flush_request -> req_type = OMPI_REQUEST_BUF ;
535- flush_request -> req_free = mca_pml_base_bsend_request_free ;
536- flush_request -> req_status = (ompi_status_public_t ){0 };
537- #endif
538520
539521 while (buf_instance -> bsend_count != 0 ) {
540522 opal_condition_wait (& buf_instance -> bsend_condition , & buf_instance -> bsend_mutex );
@@ -580,8 +562,6 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request)
580562 return OMPI_ERR_BUFFER ;
581563 }
582564
583- OPAL_THREAD_UNLOCK (& buffer -> bsend_mutex );
584-
585565 /* The convertor is already initialized in the beginning so we just have to
586566 * pack the data in the newly allocated buffer.
587567 */
@@ -593,6 +573,7 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request)
593573 & iov ,
594574 & iov_count ,
595575 & max_data )) < 0 ) {
576+ OPAL_THREAD_UNLOCK (& buffer -> bsend_mutex );
596577 return OMPI_ERROR ;
597578 }
598579
@@ -601,6 +582,9 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request)
601582 max_data , sendreq -> req_addr );
602583 /* increment count of pending requests */
603584 buffer -> bsend_count ++ ;
585+
586+ OPAL_THREAD_UNLOCK (& buffer -> bsend_mutex );
587+
604588 }
605589 return OMPI_SUCCESS ;
606590}
0 commit comments