Add multi-threaded support.
Этот коммит содержится в:
родитель
b2cf74cabc
Коммит
67b70bb47a
@ -94,14 +94,20 @@ int mca_pml_ob1_recv(void *addr,
|
|||||||
struct ompi_communicator_t *comm,
|
struct ompi_communicator_t *comm,
|
||||||
ompi_status_public_t * status)
|
ompi_status_public_t * status)
|
||||||
{
|
{
|
||||||
mca_pml_ob1_recv_request_t *recvreq = mca_pml_ob1_recvreq;
|
mca_pml_ob1_recv_request_t *recvreq = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if( NULL == recvreq ) {
|
#if !OPAL_ENABLE_MULTI_THREADS
|
||||||
|
recvreq = mca_pml_ob1_recvreq;
|
||||||
|
if( OPAL_UNLIKELY(NULL == recvreq) )
|
||||||
|
#endif /* !OPAL_ENABLE_MULTI_THREADS */
|
||||||
|
{
|
||||||
MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq);
|
MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq);
|
||||||
if (NULL == recvreq)
|
if (NULL == recvreq)
|
||||||
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
||||||
|
#if !OPAL_ENABLE_MULTI_THREADS
|
||||||
mca_pml_ob1_recvreq = recvreq;
|
mca_pml_ob1_recvreq = recvreq;
|
||||||
|
#endif /* !OPAL_ENABLE_MULTI_THREADS */
|
||||||
}
|
}
|
||||||
OBJ_CONSTRUCT(recvreq, mca_pml_ob1_recv_request_t);
|
OBJ_CONSTRUCT(recvreq, mca_pml_ob1_recv_request_t);
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ int mca_pml_ob1_send(void *buf,
|
|||||||
ompi_proc_t *dst_proc = ompi_comm_peer_lookup (comm, dst);
|
ompi_proc_t *dst_proc = ompi_comm_peer_lookup (comm, dst);
|
||||||
mca_bml_base_endpoint_t* endpoint = (mca_bml_base_endpoint_t*)
|
mca_bml_base_endpoint_t* endpoint = (mca_bml_base_endpoint_t*)
|
||||||
dst_proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML];
|
dst_proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML];
|
||||||
mca_pml_ob1_send_request_t *sendreq = mca_pml_ob1_sendreq;
|
mca_pml_ob1_send_request_t *sendreq = NULL;
|
||||||
int16_t seqn;
|
int16_t seqn;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -220,13 +220,18 @@ int mca_pml_ob1_send(void *buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( NULL == sendreq ) {
|
#if !OPAL_ENABLE_MULTI_THREADS
|
||||||
|
sendreq = mca_pml_ob1_sendreq;
|
||||||
|
if( OPAL_UNLIKELY(NULL == sendreq) )
|
||||||
|
#endif /* !OPAL_ENABLE_MULTI_THREADS */
|
||||||
|
{
|
||||||
MCA_PML_OB1_SEND_REQUEST_ALLOC(comm, dst, sendreq);
|
MCA_PML_OB1_SEND_REQUEST_ALLOC(comm, dst, sendreq);
|
||||||
if (NULL == sendreq)
|
if (NULL == sendreq)
|
||||||
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
|
||||||
|
#if !OPAL_ENABLE_MULTI_THREADS
|
||||||
mca_pml_ob1_sendreq = sendreq;
|
mca_pml_ob1_sendreq = sendreq;
|
||||||
|
#endif /* !OPAL_ENABLE_MULTI_THREADS */
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJ_CONSTRUCT(sendreq, mca_pml_ob1_send_request_t);
|
OBJ_CONSTRUCT(sendreq, mca_pml_ob1_send_request_t);
|
||||||
sendreq->req_send.req_base.req_proc = dst_proc;
|
sendreq->req_send.req_base.req_proc = dst_proc;
|
||||||
sendreq->rdma_frag = NULL;
|
sendreq->rdma_frag = NULL;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user