Adapt to the new datatype engine and correct some minor bugs.
This commit was SVN r2753.
Этот коммит содержится в:
родитель
3482ab96d6
Коммит
eb5e5191fa
@ -1,3 +1,5 @@
|
|||||||
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $HEADERS$
|
* $HEADERS$
|
||||||
*/
|
*/
|
||||||
@ -25,9 +27,10 @@ static const char FUNC_NAME[] = "MPI_Pack";
|
|||||||
int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype,
|
int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype,
|
||||||
void *outbuf, int outsize, int *position, MPI_Comm comm)
|
void *outbuf, int outsize, int *position, MPI_Comm comm)
|
||||||
{
|
{
|
||||||
int size, rc;
|
int size, rc, freeAfter;
|
||||||
ompi_convertor_t *local_convertor;
|
ompi_convertor_t *local_convertor;
|
||||||
struct iovec invec;
|
struct iovec invec;
|
||||||
|
unsigned int max_data, iov_count;
|
||||||
|
|
||||||
if (MPI_PARAM_CHECK) {
|
if (MPI_PARAM_CHECK) {
|
||||||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
||||||
@ -46,7 +49,7 @@ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype,
|
|||||||
|
|
||||||
local_convertor = OBJ_NEW(ompi_convertor_t);
|
local_convertor = OBJ_NEW(ompi_convertor_t);
|
||||||
ompi_convertor_init_for_send(local_convertor, 0, datatype, incount,
|
ompi_convertor_init_for_send(local_convertor, 0, datatype, incount,
|
||||||
inbuf, *position);
|
inbuf, 0, NULL /*never allocate memory*/);
|
||||||
|
|
||||||
/* Check for truncation */
|
/* Check for truncation */
|
||||||
|
|
||||||
@ -63,7 +66,10 @@ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype,
|
|||||||
|
|
||||||
/* Do the actual packing */
|
/* Do the actual packing */
|
||||||
|
|
||||||
rc = ompi_convertor_pack(local_convertor, &invec, 1);
|
iov_count = 1;
|
||||||
|
max_data = invec.iov_len;
|
||||||
|
rc = ompi_convertor_pack( local_convertor, &invec, &iov_count,
|
||||||
|
&max_data, &freeAfter );
|
||||||
*position += local_convertor->bConverted;
|
*position += local_convertor->bConverted;
|
||||||
OBJ_RELEASE(local_convertor);
|
OBJ_RELEASE(local_convertor);
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ int MPI_Pack_size(int incount, MPI_Datatype datatype, MPI_Comm comm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
local_convertor = OBJ_NEW(ompi_convertor_t);
|
local_convertor = OBJ_NEW(ompi_convertor_t);
|
||||||
ompi_convertor_init_for_send(local_convertor, 0, datatype,
|
ompi_convertor_init_for_send(local_convertor, 0, datatype, incount,
|
||||||
incount, NULL, 0);
|
NULL, 0, NULL /* never allocate memory */);
|
||||||
ret = ompi_convertor_get_packed_size(local_convertor, size);
|
ret = ompi_convertor_get_packed_size(local_convertor, size);
|
||||||
OBJ_RELEASE(local_convertor);
|
OBJ_RELEASE(local_convertor);
|
||||||
|
|
||||||
|
@ -26,9 +26,10 @@ int MPI_Unpack(void *inbuf, int insize, int *position,
|
|||||||
void *outbuf, int outcount, MPI_Datatype datatype,
|
void *outbuf, int outcount, MPI_Datatype datatype,
|
||||||
MPI_Comm comm)
|
MPI_Comm comm)
|
||||||
{
|
{
|
||||||
int size, rc;
|
int size, rc, freeAfter;
|
||||||
ompi_convertor_t *local_convertor;
|
ompi_convertor_t *local_convertor;
|
||||||
struct iovec outvec;
|
struct iovec outvec;
|
||||||
|
unsigned int max_data, iov_count;
|
||||||
|
|
||||||
if (MPI_PARAM_CHECK) {
|
if (MPI_PARAM_CHECK) {
|
||||||
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
|
||||||
@ -52,7 +53,7 @@ int MPI_Unpack(void *inbuf, int insize, int *position,
|
|||||||
|
|
||||||
local_convertor = OBJ_NEW(ompi_convertor_t);
|
local_convertor = OBJ_NEW(ompi_convertor_t);
|
||||||
ompi_convertor_init_for_recv(local_convertor, 0, datatype, outcount,
|
ompi_convertor_init_for_recv(local_convertor, 0, datatype, outcount,
|
||||||
outbuf, 0);
|
outbuf, 0, NULL /* never allocate memory */);
|
||||||
|
|
||||||
/* Check for truncation */
|
/* Check for truncation */
|
||||||
|
|
||||||
@ -68,8 +69,10 @@ int MPI_Unpack(void *inbuf, int insize, int *position,
|
|||||||
outvec.iov_len = insize - (*position);
|
outvec.iov_len = insize - (*position);
|
||||||
|
|
||||||
/* Do the actual unpacking */
|
/* Do the actual unpacking */
|
||||||
|
iov_count = 1;
|
||||||
rc = ompi_convertor_unpack(local_convertor, &outvec, 1);
|
max_data = outvec.iov_len;
|
||||||
|
rc = ompi_convertor_unpack( local_convertor, &outvec, &iov_count,
|
||||||
|
&max_data, &freeAfter );
|
||||||
*position += local_convertor->bConverted;
|
*position += local_convertor->bConverted;
|
||||||
OBJ_RELEASE(local_convertor);
|
OBJ_RELEASE(local_convertor);
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user