2008-02-28 04:57:57 +03:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2006 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.
|
2012-06-24 01:20:09 +04:00
|
|
|
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
2014-02-12 23:37:21 +04:00
|
|
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
2008-02-28 04:57:57 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#ifndef OPAL_DSS_INTERNAL_H_
|
|
|
|
#define OPAL_DSS_INTERNAL_H_
|
|
|
|
|
|
|
|
#include "opal_config.h"
|
|
|
|
#include "opal/constants.h"
|
|
|
|
|
2014-02-12 23:37:21 +04:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
#include <sys/time.h> /* for struct timeval */
|
|
|
|
#endif
|
|
|
|
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "opal/class/opal_pointer_array.h"
|
|
|
|
|
|
|
|
#include "opal/dss/dss.h"
|
|
|
|
|
2009-07-16 22:27:33 +04:00
|
|
|
#ifdef HAVE_STRING_H
|
2008-02-28 04:57:57 +03:00
|
|
|
# if !defined(STDC_HEADERS) && HAVE_MEMORY_H
|
|
|
|
# include <memory.h>
|
|
|
|
# endif
|
|
|
|
# include <string.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
BEGIN_C_DECLS
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The default starting chunk size
|
|
|
|
*/
|
|
|
|
#define OPAL_DSS_DEFAULT_INITIAL_SIZE 128
|
|
|
|
/*
|
|
|
|
* The default threshold size when we switch from doubling the
|
|
|
|
* buffer size to addatively increasing it
|
|
|
|
*/
|
|
|
|
#define OPAL_DSS_DEFAULT_THRESHOLD_SIZE 1024
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal type corresponding to size_t. Do not use this in
|
|
|
|
* interface calls - use OPAL_SIZE instead.
|
|
|
|
*/
|
|
|
|
#if SIZEOF_SIZE_T == 1
|
|
|
|
#define DSS_TYPE_SIZE_T OPAL_UINT8
|
|
|
|
#elif SIZEOF_SIZE_T == 2
|
|
|
|
#define DSS_TYPE_SIZE_T OPAL_UINT16
|
|
|
|
#elif SIZEOF_SIZE_T == 4
|
|
|
|
#define DSS_TYPE_SIZE_T OPAL_UINT32
|
|
|
|
#elif SIZEOF_SIZE_T == 8
|
|
|
|
#define DSS_TYPE_SIZE_T OPAL_UINT64
|
|
|
|
#else
|
|
|
|
#error Unsupported size_t size!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal type corresponding to bool. Do not use this in interface
|
|
|
|
* calls - use OPAL_BOOL instead.
|
|
|
|
*/
|
|
|
|
#if SIZEOF_BOOL == 1
|
|
|
|
#define DSS_TYPE_BOOL OPAL_UINT8
|
|
|
|
#elif SIZEOF_BOOL == 2
|
|
|
|
#define DSS_TYPE_BOOL OPAL_UINT16
|
|
|
|
#elif SIZEOF_BOOL == 4
|
|
|
|
#define DSS_TYPE_BOOL OPAL_UINT32
|
|
|
|
#elif SIZEOF_BOOL == 8
|
|
|
|
#define DSS_TYPE_BOOL OPAL_UINT64
|
|
|
|
#else
|
|
|
|
#error Unsupported bool size!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal type corresponding to int and unsigned int. Do not use
|
|
|
|
* this in interface calls - use OPAL_INT / OPAL_UINT instead.
|
|
|
|
*/
|
|
|
|
#if SIZEOF_INT == 1
|
|
|
|
#define DSS_TYPE_INT OPAL_INT8
|
|
|
|
#define DSS_TYPE_UINT OPAL_UINT8
|
|
|
|
#elif SIZEOF_INT == 2
|
|
|
|
#define DSS_TYPE_INT OPAL_INT16
|
|
|
|
#define DSS_TYPE_UINT OPAL_UINT16
|
|
|
|
#elif SIZEOF_INT == 4
|
|
|
|
#define DSS_TYPE_INT OPAL_INT32
|
|
|
|
#define DSS_TYPE_UINT OPAL_UINT32
|
|
|
|
#elif SIZEOF_INT == 8
|
|
|
|
#define DSS_TYPE_INT OPAL_INT64
|
|
|
|
#define DSS_TYPE_UINT OPAL_UINT64
|
|
|
|
#else
|
|
|
|
#error Unsupported int size!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Internal type corresponding to pid_t. Do not use this in interface
|
|
|
|
* calls - use OPAL_PID instead.
|
|
|
|
*/
|
|
|
|
#if SIZEOF_PID_T == 1
|
|
|
|
#define DSS_TYPE_PID_T OPAL_UINT8
|
|
|
|
#elif SIZEOF_PID_T == 2
|
|
|
|
#define DSS_TYPE_PID_T OPAL_UINT16
|
|
|
|
#elif SIZEOF_PID_T == 4
|
|
|
|
#define DSS_TYPE_PID_T OPAL_UINT32
|
|
|
|
#elif SIZEOF_PID_T == 8
|
|
|
|
#define DSS_TYPE_PID_T OPAL_UINT64
|
|
|
|
#else
|
|
|
|
#error Unsupported pid_t size!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Unpack generic size macros */
|
2012-06-24 01:20:09 +04:00
|
|
|
#define UNPACK_SIZE_MISMATCH(unpack_type, remote_type, ret) \
|
|
|
|
do { \
|
|
|
|
switch(remote_type) { \
|
|
|
|
case OPAL_UINT8: \
|
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint8_t, remote_type); \
|
|
|
|
break; \
|
|
|
|
case OPAL_INT8: \
|
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int8_t, remote_type); \
|
|
|
|
break; \
|
|
|
|
case OPAL_UINT16: \
|
2008-02-28 04:57:57 +03:00
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint16_t, remote_type); \
|
2012-06-24 01:20:09 +04:00
|
|
|
break; \
|
|
|
|
case OPAL_INT16: \
|
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int16_t, remote_type); \
|
|
|
|
break; \
|
|
|
|
case OPAL_UINT32: \
|
2008-02-28 04:57:57 +03:00
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint32_t, remote_type); \
|
2012-06-24 01:20:09 +04:00
|
|
|
break; \
|
|
|
|
case OPAL_INT32: \
|
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int32_t, remote_type); \
|
|
|
|
break; \
|
|
|
|
case OPAL_UINT64: \
|
2008-02-28 04:57:57 +03:00
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, uint64_t, remote_type); \
|
2012-06-24 01:20:09 +04:00
|
|
|
break; \
|
|
|
|
case OPAL_INT64: \
|
|
|
|
UNPACK_SIZE_MISMATCH_FOUND(unpack_type, int64_t, remote_type); \
|
|
|
|
break; \
|
|
|
|
default: \
|
|
|
|
ret = OPAL_ERR_NOT_FOUND; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
/* NOTE: do not need to deal with endianness here, as the unpacking of
|
2012-06-24 01:20:09 +04:00
|
|
|
the underling sender-side type will do that for us. Repeat: the
|
|
|
|
data in tmpbuf[] is already in host byte order. */
|
2008-02-28 04:57:57 +03:00
|
|
|
#define UNPACK_SIZE_MISMATCH_FOUND(unpack_type, tmptype, tmpdsstype) \
|
2012-06-24 01:20:09 +04:00
|
|
|
do { \
|
|
|
|
int32_t i; \
|
|
|
|
tmptype *tmpbuf = (tmptype*)malloc(sizeof(tmptype) * (*num_vals)); \
|
|
|
|
ret = opal_dss_unpack_buffer(buffer, tmpbuf, num_vals, tmpdsstype); \
|
|
|
|
for (i = 0 ; i < *num_vals ; ++i) { \
|
|
|
|
((unpack_type*) dest)[i] = (unpack_type)(tmpbuf[i]); \
|
|
|
|
} \
|
|
|
|
free(tmpbuf); \
|
|
|
|
} while (0)
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal struct used for holding registered dss functions
|
|
|
|
*/
|
|
|
|
struct opal_dss_type_info_t {
|
|
|
|
opal_object_t super;
|
|
|
|
/* type identifier */
|
|
|
|
opal_data_type_t odti_type;
|
|
|
|
/** Debugging string name */
|
|
|
|
char *odti_name;
|
|
|
|
/** Pack function */
|
|
|
|
opal_dss_pack_fn_t odti_pack_fn;
|
|
|
|
/** Unpack function */
|
|
|
|
opal_dss_unpack_fn_t odti_unpack_fn;
|
|
|
|
/** copy function */
|
|
|
|
opal_dss_copy_fn_t odti_copy_fn;
|
|
|
|
/** compare function */
|
|
|
|
opal_dss_compare_fn_t odti_compare_fn;
|
|
|
|
/** print function */
|
|
|
|
opal_dss_print_fn_t odti_print_fn;
|
|
|
|
/** flag to indicate structured data */
|
|
|
|
bool odti_structured;
|
|
|
|
};
|
|
|
|
/**
|
|
|
|
* Convenience typedef
|
|
|
|
*/
|
|
|
|
typedef struct opal_dss_type_info_t opal_dss_type_info_t;
|
|
|
|
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_dss_type_info_t);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* globals needed within dss
|
|
|
|
*/
|
|
|
|
extern bool opal_dss_initialized;
|
|
|
|
extern bool opal_dss_debug;
|
|
|
|
extern int opal_dss_verbose;
|
|
|
|
extern int opal_dss_initial_size;
|
|
|
|
extern int opal_dss_threshold_size;
|
|
|
|
extern opal_pointer_array_t opal_dss_types;
|
|
|
|
extern opal_data_type_t opal_dss_num_reg_types;
|
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Implementations of API functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals,
|
|
|
|
opal_data_type_t type);
|
|
|
|
int opal_dss_unpack(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *max_num_vals,
|
|
|
|
opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy(void **dest, void *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare(const void *value1, const void *value2,
|
|
|
|
opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_print(char **output, char *prefix, void *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_dump(int output_stream, void *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_peek(opal_buffer_t *buffer, opal_data_type_t *type,
|
|
|
|
int32_t *number);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_peek_type(opal_buffer_t *buffer, opal_data_type_t *type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unload(opal_buffer_t *buffer, void **payload,
|
|
|
|
int32_t *bytes_used);
|
|
|
|
int opal_dss_load(opal_buffer_t *buffer, void *payload, int32_t bytes_used);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy_payload(opal_buffer_t *dest, opal_buffer_t *src);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_register(opal_dss_pack_fn_t pack_fn,
|
|
|
|
opal_dss_unpack_fn_t unpack_fn,
|
|
|
|
opal_dss_copy_fn_t copy_fn,
|
|
|
|
opal_dss_compare_fn_t compare_fn,
|
|
|
|
opal_dss_print_fn_t print_fn,
|
|
|
|
bool structured,
|
|
|
|
const char *name, opal_data_type_t *type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
bool opal_dss_structured(opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
char *opal_dss_lookup_data_type(opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
void opal_dss_dump_data_types(int output);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Specialized functions
|
|
|
|
*/
|
2008-06-19 23:08:08 +04:00
|
|
|
OPAL_DECLSPEC int opal_dss_pack_buffer(opal_buffer_t *buffer, const void *src,
|
2012-06-24 01:20:09 +04:00
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2008-06-19 23:08:08 +04:00
|
|
|
OPAL_DECLSPEC int opal_dss_unpack_buffer(opal_buffer_t *buffer, void *dst,
|
2012-06-24 01:20:09 +04:00
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Internal pack functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_null(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_pack_byte(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_bool(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_int(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_pack_int16(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_pack_int32(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_pack_int64(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_sizet(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_pid(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_string(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_data_type(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_byte_object(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_pstat(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_pack_node_stat(opal_buffer_t *buffer, const void *src,
|
2008-12-22 23:23:05 +03:00
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
|
2012-06-27 18:53:55 +04:00
|
|
|
int opal_dss_pack_value(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
|
2012-11-10 18:02:23 +04:00
|
|
|
int opal_dss_pack_buffer_contents(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
|
2012-12-19 04:14:19 +04:00
|
|
|
int opal_dss_pack_float(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
|
|
|
|
int opal_dss_pack_timeval(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
|
2014-02-12 23:37:21 +04:00
|
|
|
int opal_dss_pack_time(opal_buffer_t *buffer, const void *src,
|
|
|
|
int32_t num_vals, opal_data_type_t type);
|
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Internal unpack functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_null(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_unpack_byte(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_bool(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_int(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_unpack_int16(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_unpack_int32(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
int opal_dss_unpack_int64(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_sizet(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_pid(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_string(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_data_type(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_byte_object(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_pstat(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_unpack_node_stat(opal_buffer_t *buffer, void *dest,
|
2008-12-22 23:23:05 +03:00
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
|
2012-06-27 18:53:55 +04:00
|
|
|
int opal_dss_unpack_value(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
|
2012-11-10 18:02:23 +04:00
|
|
|
int opal_dss_unpack_buffer_contents(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
|
2012-12-19 04:14:19 +04:00
|
|
|
int opal_dss_unpack_float(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
|
|
|
|
int opal_dss_unpack_timeval(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
|
2014-02-12 23:37:21 +04:00
|
|
|
int opal_dss_unpack_time(opal_buffer_t *buffer, void *dest,
|
|
|
|
int32_t *num_vals, opal_data_type_t type);
|
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Internal copy functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_std_copy(void **dest, void *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy_null(char **dest, char *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy_string(char **dest, char *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy_byte_object(opal_byte_object_t **dest, opal_byte_object_t *src,
|
|
|
|
opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy_pstat(opal_pstats_t **dest, opal_pstats_t *src,
|
|
|
|
opal_data_type_t type);
|
2008-12-22 23:23:05 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_copy_node_stat(opal_node_stats_t **dest, opal_node_stats_t *src,
|
2008-12-22 23:23:05 +03:00
|
|
|
opal_data_type_t type);
|
|
|
|
|
2012-06-27 18:53:55 +04:00
|
|
|
int opal_dss_copy_value(opal_value_t **dest, opal_value_t *src,
|
|
|
|
opal_data_type_t type);
|
|
|
|
|
2012-11-10 18:02:23 +04:00
|
|
|
int opal_dss_copy_buffer_contents(opal_buffer_t **dest, opal_buffer_t *src,
|
|
|
|
opal_data_type_t type);
|
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Internal compare functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_bool(bool *value1, bool *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_int(int *value1, int *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_uint(unsigned int *value1, unsigned int *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_size(size_t *value1, size_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_pid(pid_t *value1, pid_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_byte(char *value1, char *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_char(char *value1, char *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_int8(int8_t *value1, int8_t *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_uint8(uint8_t *value1, uint8_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_int16(int16_t *value1, int16_t *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_uint16(uint16_t *value1, uint16_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_int32(int32_t *value1, int32_t *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_uint32(uint32_t *value1, uint32_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_int64(int64_t *value1, int64_t *value2, opal_data_type_t type);
|
|
|
|
int opal_dss_compare_uint64(uint64_t *value1, uint64_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_null(char *value1, char *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_string(char *value1, char *value2, opal_data_type_t type);
|
2008-12-22 23:23:05 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_dt(opal_data_type_t *value1, opal_data_type_t *value2, opal_data_type_t type);
|
2011-04-22 02:55:45 +04:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_byte_object(opal_byte_object_t *value1, opal_byte_object_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_pstat(opal_pstats_t *value1, opal_pstats_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_compare_node_stat(opal_node_stats_t *value1, opal_node_stats_t *value2, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-27 18:53:55 +04:00
|
|
|
int opal_dss_compare_value(opal_value_t *value1, opal_value_t *value2, opal_data_type_t type);
|
|
|
|
|
2012-11-10 18:02:23 +04:00
|
|
|
int opal_dss_compare_buffer_contents(opal_buffer_t *value1, opal_buffer_t *value2, opal_data_type_t type);
|
|
|
|
|
2012-12-19 04:14:19 +04:00
|
|
|
int opal_dss_compare_float(float *value1, float *value2, opal_data_type_t type);
|
|
|
|
|
|
|
|
int opal_dss_compare_timeval(struct timeval *value1, struct timeval *value2, opal_data_type_t type);
|
|
|
|
|
2014-02-12 23:37:21 +04:00
|
|
|
int opal_dss_compare_time(time_t *value1, time_t *value2, opal_data_type_t type);
|
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Internal print functions
|
|
|
|
*/
|
|
|
|
int opal_dss_print_byte(char **output, char *prefix, uint8_t *src, opal_data_type_t type);
|
|
|
|
|
|
|
|
int opal_dss_print_string(char **output, char *prefix, char *src, opal_data_type_t type);
|
|
|
|
|
|
|
|
int opal_dss_print_size(char **output, char *prefix, size_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_pid(char **output, char *prefix, pid_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_bool(char **output, char *prefix, bool *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_int(char **output, char *prefix, int *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_uint(char **output, char *prefix, int *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_uint8(char **output, char *prefix, uint8_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_uint16(char **output, char *prefix, uint16_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_uint32(char **output, char *prefix, uint32_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_int8(char **output, char *prefix, int8_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_int16(char **output, char *prefix, int16_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_int32(char **output, char *prefix, int32_t *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
#ifdef HAVE_INT64_T
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_print_uint64(char **output, char *prefix, uint64_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_int64(char **output, char *prefix, int64_t *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
#else
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_print_uint64(char **output, char *prefix, void *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_int64(char **output, char *prefix, void *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
#endif
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_print_null(char **output, char *prefix, void *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_data_type(char **output, char *prefix, opal_data_type_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_byte_object(char **output, char *prefix, opal_byte_object_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_pstat(char **output, char *prefix, opal_pstats_t *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_node_stat(char **output, char *prefix, opal_node_stats_t *src, opal_data_type_t type);
|
2012-06-27 18:53:55 +04:00
|
|
|
int opal_dss_print_value(char **output, char *prefix, opal_value_t *src, opal_data_type_t type);
|
2012-11-10 18:02:23 +04:00
|
|
|
int opal_dss_print_buffer_contents(char **output, char *prefix, opal_buffer_t *src, opal_data_type_t type);
|
2012-12-19 04:14:19 +04:00
|
|
|
int opal_dss_print_float(char **output, char *prefix, float *src, opal_data_type_t type);
|
|
|
|
int opal_dss_print_timeval(char **output, char *prefix, struct timeval *src, opal_data_type_t type);
|
2014-02-12 23:37:21 +04:00
|
|
|
int opal_dss_print_time(char **output, char *prefix, time_t *src, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
/*
|
|
|
|
* Internal helper functions
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
char* opal_dss_buffer_extend(opal_buffer_t *bptr, size_t bytes_to_add);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
bool opal_dss_too_small(opal_buffer_t *buffer, size_t bytes_reqd);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
opal_dss_type_info_t* opal_dss_find_type(opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_store_data_type(opal_buffer_t *buffer, opal_data_type_t type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2012-06-24 01:20:09 +04:00
|
|
|
int opal_dss_get_data_type(opal_buffer_t *buffer, opal_data_type_t *type);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
|
|
|
END_C_DECLS
|
|
|
|
|
|
|
|
#endif
|