2004-06-16 00:35:30 +04:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-06-16 00:35:30 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2004-06-16 00:35:30 +04:00
|
|
|
#include "mca/mca.h"
|
|
|
|
#include "mca/base/base.h"
|
2004-11-05 10:52:30 +03:00
|
|
|
#include "include/constants.h"
|
2004-06-16 00:35:30 +04:00
|
|
|
#include "mca/base/mca_base_msgbuf_internal.h"
|
|
|
|
|
2004-06-16 03:31:37 +04:00
|
|
|
/*
|
|
|
|
* local prototypes
|
|
|
|
*/
|
|
|
|
int mca_base_msgbuf_init (void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* local variables
|
|
|
|
*/
|
|
|
|
static bool initialized = false;
|
|
|
|
|
2004-06-16 00:35:30 +04:00
|
|
|
|
|
|
|
/* blank prototypes for now that return unimplemented */
|
|
|
|
|
|
|
|
|
|
|
|
/* get/create a free buffer */
|
|
|
|
/* if reqsize = MCA_BASE_MSGBUF_GETBUF, then the system gives an unlimited buffer. */
|
|
|
|
/* Giving a req size just makes it more memory efficient. */
|
|
|
|
mca_base_msgbuf_t mca_base_msgbuf_new (size_t reqsize)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return ((mca_base_msgbuf_t)OMPI_ERR_NOT_SUPPORTED);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* make a copy of an existing buffer */
|
|
|
|
/* this is usefull for the registry and is needed as unpack is */
|
|
|
|
/* destructive */
|
2004-06-16 04:26:32 +04:00
|
|
|
int mca_base_msgbuf_copy (mca_base_msgbuf_t* copybufid,
|
2004-06-16 00:35:30 +04:00
|
|
|
mca_base_msgbuf_t orgbufid)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 04:26:32 +04:00
|
|
|
return (OMPI_ERR_NOT_SUPPORTED);
|
2004-06-16 00:35:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* set a buffer. As base_pack send/recv handles buffer you might not want */
|
|
|
|
/* to pack a buffer but do a send from memory directly */
|
|
|
|
/* a free on this special buffer just frees its structure not the memory */
|
|
|
|
mca_base_msgbuf_t mca_base_msgbuf_construct (void* ptr, size_t datasize)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return ((mca_base_msgbuf_t)OMPI_ERR_NOT_SUPPORTED);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* explicit free of a buffer when not auto freeing them */
|
2004-06-16 04:26:32 +04:00
|
|
|
int mca_base_msgbuf_free (mca_base_msgbuf_t* bufid)
|
2004-06-16 00:35:30 +04:00
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* pack and unpack non-string typed data */
|
|
|
|
int mca_base_msgbuf_pack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items,
|
|
|
|
mca_base_msgbuf_data_t datatype)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mca_base_msgbuf_unpack (mca_base_msgbuf_t bufid, void* ptr,
|
|
|
|
size_t num_items, mca_base_msgbuf_data_t datatype)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* handles strings */
|
|
|
|
/* note this takes NULL terminated strings and returns null terminated strings */
|
|
|
|
int mca_base_msgbuf_pack_string (mca_base_msgbuf_t bufid, char* strptr)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
int mca_base_msgbuf_unpack_string (mca_base_msgbuf_t bufid, char* strptr,
|
|
|
|
size_t maxlen)
|
|
|
|
{
|
2004-06-16 03:31:37 +04:00
|
|
|
if (!initialized) mca_base_msgbuf_init ();
|
2004-06-16 00:35:30 +04:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
2004-06-16 03:31:37 +04:00
|
|
|
|
|
|
|
/* private functions just inside this code */
|
|
|
|
|
|
|
|
int mca_base_msgbuf_init ()
|
|
|
|
{
|
|
|
|
if (initialized) return (0);
|
2004-06-17 08:38:32 +04:00
|
|
|
return OMPI_ERR_NOT_SUPPORTED;
|
2004-06-16 03:31:37 +04:00
|
|
|
}
|