1
1

The (I hope) final solution for the convertor problem. As all the PML inherit

the base send and receive request from the pml_base, we can solve our problem
if we construct the convertor attached to any request in the pml_base_construct
function. At the end of the life time for each request (here life time is 
related to one utilisation, without taking in account the cache) we release
all information attached to the convertors in the _FINI macro by calling the
ompi_convertor_cleanup.

This commit was SVN r7910.
Этот коммит содержится в:
George Bosilca 2005-10-28 03:26:36 +00:00
родитель f8ae2767cf
Коммит d916e0c5b4
8 изменённых файлов: 16 добавлений и 7 удалений

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

@ -37,10 +37,15 @@ static void mca_pml_base_recv_request_construct(mca_pml_base_recv_request_t* req
{
/* no need to reinit for every recv -- never changes */
request->req_base.req_type = MCA_PML_REQUEST_RECV;
OBJ_CONSTRUCT(&request->req_convertor, ompi_convertor_t);
}
static void mca_pml_base_recv_request_destruct(mca_pml_base_recv_request_t* request)
{
/* For each request the convertor get cleaned after each message
* (in the base _FINI macro). Therefore, as the convertor is a static object
* we don't have to call OBJ_DESTRUCT here.
*/
}

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

@ -39,6 +39,9 @@ static void mca_pml_base_send_request_construct(mca_pml_base_send_request_t* req
static void mca_pml_base_send_request_destruct(mca_pml_base_send_request_t* req)
{
OBJ_DESTRUCT(&req->req_convertor);
/* For each request the convertor get cleaned after each message
* (in the base _FINI macro). Therefore, as the convertor is a static object
* we don't have to call OBJ_DESTRUCT here.
*/
}

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

@ -95,7 +95,6 @@ static void mca_pml_ob1_recv_request_construct(mca_pml_ob1_recv_request_t* reque
request->req_recv.req_base.req_ompi.req_fini = mca_pml_ob1_recv_request_fini;
request->req_recv.req_base.req_ompi.req_free = mca_pml_ob1_recv_request_free;
request->req_recv.req_base.req_ompi.req_cancel = mca_pml_ob1_recv_request_cancel;
OBJ_CONSTRUCT(&request->req_recv.req_convertor, ompi_convertor_t);
}
static void mca_pml_ob1_recv_request_destruct(mca_pml_ob1_recv_request_t* request)

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

@ -77,7 +77,6 @@ static void mca_pml_ob1_send_request_construct(mca_pml_ob1_send_request_t* req)
req->req_send.req_base.req_ompi.req_fini = mca_pml_ob1_send_request_fini;
req->req_send.req_base.req_ompi.req_free = mca_pml_ob1_send_request_free;
req->req_send.req_base.req_ompi.req_cancel = mca_pml_ob1_send_request_cancel;
OBJ_CONSTRUCT(&req->req_send.req_convertor, ompi_convertor_t);
}
static void mca_pml_ob1_send_request_destruct(mca_pml_ob1_send_request_t* req)
@ -731,6 +730,12 @@ int mca_pml_ob1_send_request_schedule(mca_pml_ob1_send_request_t* sendreq)
if(sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) {
ompi_convertor_t convertor;
size_t position = sendreq->req_send_offset + size;
/*
* We need this local convertor in order to correctly compute
* the correct position. Therefore we have to correctly construct and
* destruct it.
*/
OBJ_CONSTRUCT( &convertor, ompi_convertor_t );
ompi_convertor_copy_and_prepare_for_send(
&sendreq->req_send.req_convertor,
sendreq->req_send.req_base.req_datatype,
@ -738,6 +743,7 @@ int mca_pml_ob1_send_request_schedule(mca_pml_ob1_send_request_t* sendreq)
sendreq->req_send.req_base.req_addr,
&convertor);
ompi_convertor_set_position(&convertor, &position);
OBJ_DESTRUCT( &convertor );
size = position - sendreq->req_send_offset;
}
}

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

@ -83,7 +83,6 @@ static void mca_pml_teg_recv_request_construct(mca_ptl_base_recv_request_t* requ
request->req_recv.req_base.req_ompi.req_fini = mca_pml_teg_recv_request_fini;
request->req_recv.req_base.req_ompi.req_free = mca_pml_teg_recv_request_free;
request->req_recv.req_base.req_ompi.req_cancel = mca_pml_teg_recv_request_cancel;
OBJ_CONSTRUCT( &(request->req_recv.req_convertor), ompi_convertor_t );
}
static void mca_pml_teg_recv_request_destruct(mca_ptl_base_recv_request_t* request)

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

@ -53,7 +53,6 @@ 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 );
}

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

@ -85,7 +85,6 @@ static void mca_pml_uniq_recv_request_construct(mca_pml_base_recv_request_t* req
request->req_base.req_ompi.req_fini = mca_pml_uniq_recv_request_fini;
request->req_base.req_ompi.req_free = mca_pml_uniq_recv_request_free;
request->req_base.req_ompi.req_cancel = mca_pml_uniq_recv_request_cancel;
OBJ_CONSTRUCT( &(request->req_convertor), ompi_convertor_t );
}
static void mca_pml_uniq_recv_request_destruct(mca_pml_base_recv_request_t* request)

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

@ -53,7 +53,6 @@ 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 );
}