1
1

Adapt to the new datatype engine and correct some minor bugs.

This commit was SVN r2753.
Этот коммит содержится в:
George Bosilca 2004-09-19 07:05:58 +00:00
родитель 3482ab96d6
Коммит eb5e5191fa
3 изменённых файлов: 91 добавлений и 82 удалений

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

@ -1,3 +1,5 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* $HEADERS$
*/
@ -25,9 +27,10 @@ static const char FUNC_NAME[] = "MPI_Pack";
int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype,
void *outbuf, int outsize, int *position, MPI_Comm comm)
{
int size, rc;
int size, rc, freeAfter;
ompi_convertor_t *local_convertor;
struct iovec invec;
unsigned int max_data, iov_count;
if (MPI_PARAM_CHECK) {
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);
ompi_convertor_init_for_send(local_convertor, 0, datatype, incount,
inbuf, *position);
inbuf, 0, NULL /*never allocate memory*/);
/* Check for truncation */
@ -63,7 +66,10 @@ int MPI_Pack(void *inbuf, int incount, MPI_Datatype datatype,
/* 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;
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);
ompi_convertor_init_for_send(local_convertor, 0, datatype,
incount, NULL, 0);
ompi_convertor_init_for_send(local_convertor, 0, datatype, incount,
NULL, 0, NULL /* never allocate memory */);
ret = ompi_convertor_get_packed_size(local_convertor, size);
OBJ_RELEASE(local_convertor);

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

@ -26,9 +26,10 @@ int MPI_Unpack(void *inbuf, int insize, int *position,
void *outbuf, int outcount, MPI_Datatype datatype,
MPI_Comm comm)
{
int size, rc;
int size, rc, freeAfter;
ompi_convertor_t *local_convertor;
struct iovec outvec;
unsigned int max_data, iov_count;
if (MPI_PARAM_CHECK) {
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);
ompi_convertor_init_for_recv(local_convertor, 0, datatype, outcount,
outbuf, 0);
outbuf, 0, NULL /* never allocate memory */);
/* Check for truncation */
@ -68,8 +69,10 @@ int MPI_Unpack(void *inbuf, int insize, int *position,
outvec.iov_len = insize - (*position);
/* Do the actual unpacking */
rc = ompi_convertor_unpack(local_convertor, &outvec, 1);
iov_count = 1;
max_data = outvec.iov_len;
rc = ompi_convertor_unpack( local_convertor, &outvec, &iov_count,
&max_data, &freeAfter );
*position += local_convertor->bConverted;
OBJ_RELEASE(local_convertor);