Make the request lock recursive.
If during the request completion callback we post another request that completes right away (such a small send or a match for an unexpected short message) we will try to complete the second request while holding the lock for the completion of the first. For performance reasons (mainly to avoid unlocking and locking the request mutex several times) we have made the request lock recursive.
Этот коммит содержится в:
родитель
163cb65bb2
Коммит
bf190671e9
@ -123,8 +123,8 @@ do { \
|
||||
*/
|
||||
#define MCA_PML_OB1_RECV_REQUEST_MPI_COMPLETE( recvreq ) \
|
||||
do { \
|
||||
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_COMPLETE, \
|
||||
&(recvreq->req_recv.req_base), PERUSE_RECV ); \
|
||||
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_COMPLETE, \
|
||||
&(recvreq->req_recv.req_base), PERUSE_RECV ); \
|
||||
ompi_request_complete( &(recvreq->req_recv.req_base.req_ompi), true ); \
|
||||
} while (0)
|
||||
|
||||
|
@ -209,10 +209,10 @@ do {
|
||||
(sendreq)->req_send.req_base.req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; \
|
||||
(sendreq)->req_send.req_base.req_ompi.req_status._ucount = \
|
||||
(sendreq)->req_send.req_bytes_packed; \
|
||||
ompi_request_complete( &((sendreq)->req_send.req_base.req_ompi), (with_signal) ); \
|
||||
\
|
||||
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_COMPLETE, \
|
||||
&(sendreq->req_send.req_base), PERUSE_SEND); \
|
||||
\
|
||||
ompi_request_complete( &((sendreq)->req_send.req_base.req_ompi), (with_signal) ); \
|
||||
} while(0)
|
||||
|
||||
static inline void mca_pml_ob1_send_request_fini (mca_pml_ob1_send_request_t *sendreq)
|
||||
|
@ -36,7 +36,7 @@ opal_pointer_array_t ompi_request_f_to_c_table = {{0}};
|
||||
size_t ompi_request_waiting = 0;
|
||||
size_t ompi_request_completed = 0;
|
||||
size_t ompi_request_failed = 0;
|
||||
opal_mutex_t ompi_request_lock = {{0}};
|
||||
opal_recursive_mutex_t ompi_request_lock = {{0}};
|
||||
opal_condition_t ompi_request_cond = {{0}};
|
||||
ompi_predefined_request_t ompi_request_null = {{{{{0}}}}};
|
||||
ompi_predefined_request_t *ompi_request_null_addr = &ompi_request_null;
|
||||
@ -109,7 +109,7 @@ OBJ_CLASS_INSTANCE(
|
||||
|
||||
int ompi_request_init(void)
|
||||
{
|
||||
OBJ_CONSTRUCT(&ompi_request_lock, opal_mutex_t);
|
||||
OBJ_CONSTRUCT(&ompi_request_lock, opal_recursive_mutex_t);
|
||||
OBJ_CONSTRUCT(&ompi_request_cond, opal_condition_t);
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_request_null, ompi_request_t);
|
||||
|
@ -306,18 +306,18 @@ typedef struct ompi_request_fns_t {
|
||||
/**
|
||||
* Globals used for tracking requests and request completion.
|
||||
*/
|
||||
OMPI_DECLSPEC extern opal_pointer_array_t ompi_request_f_to_c_table;
|
||||
OMPI_DECLSPEC extern size_t ompi_request_waiting;
|
||||
OMPI_DECLSPEC extern size_t ompi_request_completed;
|
||||
OMPI_DECLSPEC extern size_t ompi_request_failed;
|
||||
OMPI_DECLSPEC extern int32_t ompi_request_poll;
|
||||
OMPI_DECLSPEC extern opal_mutex_t ompi_request_lock;
|
||||
OMPI_DECLSPEC extern opal_condition_t ompi_request_cond;
|
||||
OMPI_DECLSPEC extern opal_pointer_array_t ompi_request_f_to_c_table;
|
||||
OMPI_DECLSPEC extern size_t ompi_request_waiting;
|
||||
OMPI_DECLSPEC extern size_t ompi_request_completed;
|
||||
OMPI_DECLSPEC extern size_t ompi_request_failed;
|
||||
OMPI_DECLSPEC extern int32_t ompi_request_poll;
|
||||
OMPI_DECLSPEC extern opal_recursive_mutex_t ompi_request_lock;
|
||||
OMPI_DECLSPEC extern opal_condition_t ompi_request_cond;
|
||||
OMPI_DECLSPEC extern ompi_predefined_request_t ompi_request_null;
|
||||
OMPI_DECLSPEC extern ompi_predefined_request_t *ompi_request_null_addr;
|
||||
OMPI_DECLSPEC extern ompi_request_t ompi_request_empty;
|
||||
OMPI_DECLSPEC extern ompi_status_public_t ompi_status_empty;
|
||||
OMPI_DECLSPEC extern ompi_request_fns_t ompi_request_functions;
|
||||
OMPI_DECLSPEC extern ompi_request_t ompi_request_empty;
|
||||
OMPI_DECLSPEC extern ompi_status_public_t ompi_status_empty;
|
||||
OMPI_DECLSPEC extern ompi_request_fns_t ompi_request_functions;
|
||||
|
||||
/**
|
||||
* Initialize the MPI_Request subsystem; invoked during MPI_INIT.
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user