1
1

Fixed bug in packed buffer recv (mca_oob_recv_packed).

-  this code will change again tomorrow when oob allocates memory for me
Started to get ready to remove all the last remains of the old oob pack.
-  ifdefd until we are sure we got them all, and then its delete time.

This commit was SVN r2108.
Этот коммит содержится в:
Graham Fagg 2004-08-13 04:16:33 +00:00
родитель b80731b4d3
Коммит 973c731406
3 изменённых файлов: 14 добавлений и 4 удалений

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

@ -47,6 +47,7 @@ extern ompi_process_name_t mca_oob_name_self;
* OOB API * OOB API
*/ */
#if 0 /* not used anymore */
/** /**
* Supported datatypes for conversion operations. * Supported datatypes for conversion operations.
*/ */
@ -58,6 +59,8 @@ typedef enum {
MCA_OOB_BASE_PACKED /**< already packed data. */ MCA_OOB_BASE_PACKED /**< already packed data. */
} mca_oob_base_type_t; } mca_oob_base_type_t;
#endif
/** /**
* General flags for send/recv * General flags for send/recv
* *
@ -288,6 +291,7 @@ int mca_oob_recv_nb(
mca_oob_callback_fn_t cbfunc, mca_oob_callback_fn_t cbfunc,
void* cbdata); void* cbdata);
#if 0 /* not used any more */
/* /*
* functions for pack and unpack routines * functions for pack and unpack routines
*/ */
@ -318,6 +322,7 @@ int mca_oob_base_pack(void * dest, void * src, size_t n, mca_oob_base_type_t typ
*/ */
int mca_oob_base_unpack(void * dest, void * src, size_t n, mca_oob_base_type_t type); int mca_oob_base_unpack(void * dest, void * src, size_t n, mca_oob_base_type_t type);
#endif
#if defined(c_plusplus) || defined(__cplusplus) #if defined(c_plusplus) || defined(__cplusplus)

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

@ -6,6 +6,9 @@
* *
* The pack and unpack routines for the oob * The pack and unpack routines for the oob
*/ */
#if 0 /* these routines no longer used.. we hope. replaced by higher level util/[buffer] pack routines */
#include "mca/oob/base/base.h" #include "mca/oob/base/base.h"
#include <string.h> #include <string.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -102,3 +105,4 @@ int mca_oob_base_unpack(void * dest, void * src, size_t n, mca_oob_base_type_t t
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
#endif

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

@ -56,12 +56,13 @@ int mca_oob_recv_packed (ompi_process_name_t* peer, ompi_buffer_t *buf, int* tag
if (OMPI_ERROR==insize) { return (rc); } if (OMPI_ERROR==insize) { return (rc); }
rc = ompi_buffer_init (&tmpbuf, insize); targetptr = (void*) malloc (insize);
if (OMPI_ERROR==rc) { return (rc); } if (!targetptr) { return (OMPI_ERROR); }
rc = ompi_buffer_get_ptrs (tmpbuf, &targetptr, NULL, NULL);
rc = ompi_buffer_init_preallocated (&tmpbuf, targetptr, insize);
if (OMPI_ERROR==rc) { return (rc); } if (OMPI_ERROR==rc) { return (rc); }
/* now update the second IOV */ /* now update the IOV */
msg[0].iov_base = (char*) targetptr; msg[0].iov_base = (char*) targetptr;
msg[0].iov_len = insize; msg[0].iov_len = insize;