Don't reset the convertor when a persistent request complete. Instead reset it
next time then request is used. This will keep the execution path on the default case (not persistent) shorter. This commit was SVN r12134.
Этот коммит содержится в:
родитель
ef66afe45c
Коммит
ed83927025
@ -108,19 +108,18 @@ OBJ_CLASS_DECLARATION(mca_pml_ob1_send_request_t);
|
||||
}
|
||||
|
||||
|
||||
static inline void mca_pml_ob1_free_rdma_resources(
|
||||
mca_pml_ob1_send_request_t* sendreq)
|
||||
static inline void mca_pml_ob1_free_rdma_resources(mca_pml_ob1_send_request_t* sendreq)
|
||||
{
|
||||
size_t r;
|
||||
|
||||
/* return mpool resources */
|
||||
for(r = 0; r < sendreq->req_rdma_cnt; r++) {
|
||||
mca_mpool_base_registration_t* reg = sendreq->req_rdma[r].btl_reg;
|
||||
if( NULL != reg ) {
|
||||
reg->mpool->mpool_release(reg->mpool, reg);
|
||||
}
|
||||
if( NULL != reg ) {
|
||||
reg->mpool->mpool_release(reg->mpool, reg);
|
||||
}
|
||||
sendreq->req_rdma_cnt = 0;
|
||||
}
|
||||
sendreq->req_rdma_cnt = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -151,7 +150,6 @@ do {
|
||||
\
|
||||
PERUSE_TRACE_COMM_EVENT( PERUSE_COMM_REQ_COMPLETE, \
|
||||
&(sendreq->req_send.req_base), PERUSE_SEND); \
|
||||
\
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
@ -174,7 +172,6 @@ do {
|
||||
\
|
||||
/* return mpool resources */ \
|
||||
mca_pml_ob1_free_rdma_resources(sendreq); \
|
||||
sendreq->req_rdma_cnt = 0; \
|
||||
\
|
||||
if (sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED && \
|
||||
sendreq->req_send.req_addr != sendreq->req_send.req_base.req_addr) { \
|
||||
@ -190,13 +187,6 @@ do {
|
||||
\
|
||||
if( sendreq->req_send.req_base.req_free_called ) { \
|
||||
MCA_PML_OB1_SEND_REQUEST_RETURN( sendreq ); \
|
||||
} else { \
|
||||
if(sendreq->req_send.req_base.req_ompi.req_persistent && \
|
||||
(0 != sendreq->req_send.req_bytes_packed) ) { \
|
||||
/* rewind convertor */ \
|
||||
size_t offset = 0; \
|
||||
ompi_convertor_set_position(&sendreq->req_send.req_convertor, &offset); \
|
||||
} \
|
||||
} \
|
||||
OPAL_THREAD_UNLOCK(&ompi_request_lock); \
|
||||
} while (0)
|
||||
|
@ -27,6 +27,8 @@ int mca_pml_ob1_start(size_t count, ompi_request_t** requests)
|
||||
{
|
||||
int rc;
|
||||
size_t i;
|
||||
bool reuse_old_request = true;
|
||||
|
||||
for(i=0; i<count; i++) {
|
||||
mca_pml_base_request_t *pml_request = (mca_pml_base_request_t*)requests[i];
|
||||
if(NULL == pml_request)
|
||||
@ -57,6 +59,7 @@ int mca_pml_ob1_start(size_t count, ompi_request_t** requests)
|
||||
break;
|
||||
}
|
||||
|
||||
reuse_old_request = false;
|
||||
/* allocate a new request */
|
||||
switch(pml_request->req_type) {
|
||||
case MCA_PML_REQUEST_SEND: {
|
||||
@ -103,6 +106,17 @@ int mca_pml_ob1_start(size_t count, ompi_request_t** requests)
|
||||
case MCA_PML_REQUEST_SEND:
|
||||
{
|
||||
mca_pml_ob1_send_request_t* sendreq = (mca_pml_ob1_send_request_t*)pml_request;
|
||||
if( reuse_old_request ) {
|
||||
size_t offset = 0;
|
||||
/**
|
||||
* Reset the convertor in case we're dealing with the original request,
|
||||
* which when completed do not reset the convertor. For the other case
|
||||
* (freshly allocated request) the convertor_set_position is optimized,
|
||||
* it will not do anything is it's not required.
|
||||
*/
|
||||
ompi_convertor_set_position( &sendreq->req_send.req_convertor,
|
||||
&offset );
|
||||
}
|
||||
MCA_PML_OB1_SEND_REQUEST_START(sendreq, rc);
|
||||
if(rc != OMPI_SUCCESS)
|
||||
return rc;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user