1
1

remove unused and outdated opal message buffer code

This commit was SVN r16436.
Этот коммит содержится в:
Tim Prins 2007-10-11 22:09:01 +00:00
родитель e9aa15f9d5
Коммит 12d3ad4c5c
5 изменённых файлов: 0 добавлений и 373 удалений

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

@ -31,8 +31,6 @@ dist_pkgdata_DATA = help-mca-base.txt help-mca-param.txt
headers = \
base.h \
mca_base_component_repository.h \
mca_base_msgbuf.h \
mca_base_msgbuf_internal.h \
mca_base_param.h \
mca_base_param_internal.h
@ -48,7 +46,6 @@ libmca_base_la_SOURCES = \
mca_base_components_open.c \
mca_base_components_close.c \
mca_base_list.c \
mca_base_msgbuf.c \
mca_base_open.c \
mca_base_param.c \
mca_base_parse_paramfile.c

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

@ -28,7 +28,6 @@
*/
#include "opal/mca/mca.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/base/mca_base_msgbuf.h"
BEGIN_C_DECLS

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

@ -1,117 +0,0 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "opal_config.h"
#include "opal/util/output.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_msgbuf_internal.h"
#include "opal/constants.h"
/*
* local prototypes
*/
static int mca_base_msgbuf_init (void);
/*
* local variables
*/
static bool initialized = false;
/* 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)
{
if (!initialized) mca_base_msgbuf_init ();
return ((mca_base_msgbuf_t)OPAL_ERR_NOT_SUPPORTED);
}
/* make a copy of an existing buffer */
/* this is usefull for the registry and is needed as unpack is */
/* destructive */
int mca_base_msgbuf_copy (mca_base_msgbuf_t* copybufid,
mca_base_msgbuf_t orgbufid)
{
if (!initialized) mca_base_msgbuf_init ();
return (OPAL_ERR_NOT_SUPPORTED);
}
/* 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)
{
if (!initialized) mca_base_msgbuf_init ();
return ((mca_base_msgbuf_t)OPAL_ERR_NOT_SUPPORTED);
}
/* explicit free of a buffer when not auto freeing them */
int mca_base_msgbuf_free (mca_base_msgbuf_t* bufid)
{
if (!initialized) mca_base_msgbuf_init ();
return OPAL_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)
{
if (!initialized) mca_base_msgbuf_init ();
return OPAL_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)
{
if (!initialized) mca_base_msgbuf_init ();
return OPAL_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)
{
if (!initialized) mca_base_msgbuf_init ();
return OPAL_ERR_NOT_SUPPORTED;
}
int mca_base_msgbuf_unpack_string (mca_base_msgbuf_t bufid, char* strptr,
size_t maxlen)
{
if (!initialized) mca_base_msgbuf_init ();
return OPAL_ERR_NOT_SUPPORTED;
}
/* private functions just inside this code */
static int mca_base_msgbuf_init (void)
{
if (initialized) return (0);
return OPAL_ERR_NOT_SUPPORTED;
}

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

@ -1,187 +0,0 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Run-time MCA message buffer interface for packing/unpacking messages
* these routines are used by both the OOB and the registry.
*/
#ifndef OPAL_MCA_BASE_MSGBUF_H
#define OPAL_MCA_BASE_MSGBUF_H
/**************************************************************************/
/*
* packed message buffer interface, moved to mca_base so that all MCA modules can
* access it
*/
/* exposed interface to the packed message buffer system */
typedef enum {
MCA_BASE_MSGBUF_BYTE,
MCA_BASE_MSGBUF_INT32, MCA_BASE_MSGBUF_INT64, MCA_BASE_MSGBUF_INT128,
MCA_BASE_MSGBUF_REAL32, MCA_BASE_MSGBUF_REAL64,
MCA_BASE_MSGBUF_PACKED,
MCA_BASE_MSGBUF_BYTE_BY_REF
} mca_base_msgbuf_data_t;
/*
* The data types are simple and are required for each pack/unpack
* The user is expected to unpack the data in the same order as they packed.
* The system may or maynot type the message.
*
* Special types
* MCA_BASE_MSGBUF_BYTE does not get converted.
* MCA_BASE_MSGBUF_PACKED packs a packed buffer into another buffer.
* MCA_BASE_MSGBUF_PACKED should be unpacked into a new buffer (returned in 'ptr').
* MCA_BASE_MSGBUF_BYTE_BY_REF only has real meaning during packing. The system would
* avoid copying this memory if possible.
* The receiver would need to unpack by using either MCA_BASE_MSGBUF_BYTE/_BY_REF.
*
*/
/*
* the definition of the msgbuf is opaque completely
*/
typedef struct mca_base_msgbuffer_s* mca_base_msgbuf_t;
/*
* get/create a free buffer
*
* @param reqsize requested size for the buffer
*
* @retval mca_base_msgbuf_t handle to a message buffer
*
* if reqsize = MCA_BASE_MSGBUF_GETBUF, then the system gives an
* unlimited buffer.
*
* Giving a req size just makes it more memory efficient. */
OPAL_DECLSPEC mca_base_msgbuf_t mca_base_msgbuf_new (size_t reqsize);
/* make a copy of an existing buffer
*
* @param mca_base_msgbuf_t handle to an existing message buffer
* @param return a new buffer handle via a pointer argument
*
* @retval sucess or failue int
*
* this is usefull for the registry and is needed as unpack is
* destructive */
OPAL_DECLSPEC int mca_base_msgbuf_copy (mca_base_msgbuf_t* copybufid, mca_base_msgbuf_t orgbufid);
/* set a buffer to a block of memory so that you do not pack/memory copy
*
* @param ptr Pointer to users memory to be send
* @param datasize Length of the memory in bytes that needs to be sent
*
* @retval mca_base_msgbuf_t message buffer that points to this userdata
*
* 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
*/
OPAL_DECLSPEC mca_base_msgbuf_t mca_base_msgbuf_construct (void* ptr, size_t datasize);
/* explicit free of a buffer when not auto freeing them
*
* @param mca_base_msgbuf_t buffer handle that you request to be freed
*
* @retval success or error code
*
* This routine resets the handle the user passing inso that they can only
* free it once
*/
OPAL_DECLSPEC int mca_base_msgbuf_free (mca_base_msgbuf_t* bufid);
/* pack and non-string typed data
*
* @param mca_base_msgbuf_t bufid buffer handle where data is packed
* @param void* ptr Pointer to users memory to pack from
* @param size_t num_items Number of items to pack into buffer bufid
* @param mca_base_msgbuf_data_t datatype Type of item being packed
*
* @retval if zero or greater the items packed, if negative error code
*
* If the buffer fills up, it will automatically resize unless allocated
* with fixed buffer size.
*/
OPAL_DECLSPEC int mca_base_msgbuf_pack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, mca_base_msgbuf_data_t datatype);
/* unpack non-string typed data
*
* @param mca_base_msgbuf_t bufid buffer handle where data is packed
* @param void* ptr Pointer to users memory to unpack into
* @param size_t num_items Number of items to unpack from the buffer bufid
* @param mca_base_msgbuf_data_t datatype Type of item being unpacked
*
* @retval if zero or greater the items unpacked, if negative error code
*
* Once the buffer empties, the buffer is freed.
* If the remain data in the buffer is not large enought for the unpack
* request, the routine will unpack what it can and then return an error.
* The user is responsible for unpacking a message correctly.
*/
OPAL_DECLSPEC int mca_base_msgbuf_unpack (mca_base_msgbuf_t bufid, void* ptr, size_t num_items, mca_base_msgbuf_data_t datatype);
/* pack a NULL terminated string
*
* @param mca_base_msgbuf_t bufid buffer handle where data is packed
* @param strptr Pointer to NULL terminated string to pack
*
* @retval if zero or greater the items packed, if negative error code
*
* If the buffer fills up, it will automatically resize unless allocated
* with a fixed buffer size.
*/
OPAL_DECLSPEC int mca_base_msgbuf_pack_string (mca_base_msgbuf_t bufid, char* strptr);
/* unpack a NULL terminated string
*
* @param mca_base_msgbuf_t bufid buffer handle where data is already packed
* @param char* strptr Pointer to memory to unpack string into
* @param maxlen maximum size of the memory available to unpack into
*
* @retval if zero or greater the items (un)packed, if negative error code
*
* If the memory given is smaller than the string (strlen(str)) + 1
* then the routine truncates the string but always NULL terminates it.
*
*/
OPAL_DECLSPEC int mca_base_msgbuf_unpack_string (mca_base_msgbuf_t bufid, char* strptr, size_t maxlen);
/* constants */
#define MCA_BASE_MSGBUF_NULL_BUFID -1 /* default buffer ID returned when freeing */
#define MCA_BASE_MSGBUF_GETBUF -2000 /* default system give me a buffer const */
/* error codes */
#define MCA_BASE_MSGBUF_SUCCESS 0;
/* buffer error codes */
#define MCA_BASE_MSGBUF_BADBUFFER -2010 /* bad buffer id */
#define MCA_BASE_MSGBUF_OUTOFBUFFERS -2011 /* no free msg buffers free */
#define MCA_BASE_MSGBUF_OUTOFMEMORY -2012 /* cannot allocate any more memory for message buffers */
#define MCA_BASE_MSGBUF_BADPARM -2014 /* other parameters are bad/invalid pointers */
#define MCA_BASE_MSGBUF_BADDATA -2015 /* to/from data addr is bad (null etc) */
#endif /* OPAL_MCA_BASE_MSGBUF_H */

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

@ -1,65 +0,0 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file
*
* Run-time MCA message buffer interface for packing/unpacking messages
* these routines are used by both the OOB and the registry.
*/
#ifndef OPAL_MCA_BASE_MSGBUF_INTERNAL_H
#define OPAL_MCA_BASE_MSGBUF_INTERNAL_H
/*
* This contains the internal definitions of the MCA message buffer
* data structures
*/
/* this struct is changing to be a opal_object with a opal_list inside! */
/* and a few locks */
struct mca_base_msgbuffer_s {
int msg_buff_id; /* internal ID of this buffer */
int contiguous; /* if this is a single message buffer */
int in_use; /* zero if free, else 1 */
int resizable; /* whether we are allowed to remalloc if needed */
void* base_ptr; /* start of my memory */
void* data_ptr; /* location of where next data will go */
void* from_ptr; /* location of where to get the next data from */
/* counters */
size_t size; /* total size of this buffer */
size_t len; /* total amount already packed */
size_t space; /* how much space we have left */
/* yep, size=len+space */
size_t toend; /* how many bytes till the end when unpacking :) */
#ifdef MCA_BASE_MSGBUF_PROFILING
/* specialised counters */
long times_sent; /* inc each time we send with it, not used? */
long times_freed; /* how many times has this buffer been freed */
long times_resized; /* how many times has this buffer been resized */
#endif /* used for debugging */
};
#endif /* OPAL_MCA_BASE_MSGBUF_INTERNAL_H */