1
1

Solve thee problem with the reference count on the datatype (RT bug 1492). The problem is that the

convertor (when prepared) increase the reference count on the used datatype. This reference count
will be released only when the OBJ_DESTRUCT is called on a convertor. However, having to call
OBJ_CONSTRUCT and OBJ_DESTRUCT on each request every time we want to use it (even when it come
from the cache) is an expensive operation. This can be avoided is the OBJ_DESTRUCT will leave the
convertor in exactly the same state as OBJ_CONSTRUCT. With this approach we just have to call
OBJ_CONSTRUCT for each convertor once when we initially create the request.

This commit was SVN r7813.
Этот коммит содержится в:
George Bosilca 2005-10-19 20:57:39 +00:00
родитель 63c5013fe6
Коммит 1d75b7972f
6 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -85,11 +85,12 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_recv_request_t);
*
* @param request (IN) Receive request.
*/
#define MCA_PML_BASE_RECV_REQUEST_FINI( request ) \
do { \
OMPI_REQUEST_FINI(&(request)->req_base.req_ompi); \
OBJ_RELEASE( (request)->req_base.req_comm); \
OBJ_RELEASE( (request)->req_base.req_datatype ); \
#define MCA_PML_BASE_RECV_REQUEST_FINI( request ) \
do { \
OMPI_REQUEST_FINI(&(request)->req_base.req_ompi); \
OBJ_RELEASE( (request)->req_base.req_comm); \
OBJ_RELEASE( (request)->req_base.req_datatype ); \
OBJ_DESTRUCT( &((request)->req_convertor) ); \
} while (0)
#if defined(c_plusplus) || defined(__cplusplus)

Просмотреть файл

@ -123,6 +123,7 @@ typedef struct mca_pml_base_send_request_t mca_pml_base_send_request_t;
OMPI_REQUEST_FINI(&(request)->req_base.req_ompi); \
OBJ_RELEASE((request)->req_base.req_comm); \
OBJ_RELEASE((request)->req_base.req_datatype); \
OBJ_DESTRUCT( &((request)->req_convertor) ); \
} while (0)

Просмотреть файл

@ -100,7 +100,6 @@ static void mca_pml_ob1_recv_request_construct(mca_pml_ob1_recv_request_t* reque
static void mca_pml_ob1_recv_request_destruct(mca_pml_ob1_recv_request_t* request)
{
OBJ_DESTRUCT(&request->req_recv.req_convertor);
}

Просмотреть файл

@ -82,7 +82,6 @@ static void mca_pml_ob1_send_request_construct(mca_pml_ob1_send_request_t* req)
static void mca_pml_ob1_send_request_destruct(mca_pml_ob1_send_request_t* req)
{
OBJ_DESTRUCT(&req->req_send.req_convertor);
}

Просмотреть файл

@ -53,6 +53,7 @@ static void mca_pml_teg_send_request_construct(mca_pml_teg_send_request_t* req)
req->req_send.req_base.req_ompi.req_fini = mca_pml_teg_send_request_fini;
req->req_send.req_base.req_ompi.req_free = mca_pml_teg_send_request_free;
req->req_send.req_base.req_ompi.req_cancel = mca_pml_teg_send_request_cancel;
OBJ_CONSTRUCT( &(req->req_send.req_convertor), ompi_convertor_t );
}

Просмотреть файл

@ -53,6 +53,7 @@ static void mca_pml_uniq_send_request_construct(mca_pml_base_send_request_t* req
req->req_base.req_ompi.req_fini = mca_pml_uniq_send_request_fini;
req->req_base.req_ompi.req_free = mca_pml_uniq_send_request_free;
req->req_base.req_ompi.req_cancel = mca_pml_uniq_send_request_cancel;
OBJ_CONSTRUCT( &(req->req_convertor), ompi_convertor_t );
}