diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2005-08-13 15:21:22 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2005-08-13 15:21:22 (GMT) |
commit | 52cfa98120bebabe735367ca22b7ce945080f47c (patch) | |
tree | 573098892bcd8d23634c99080398ef2470560ba9 /perform/pio_standalone.h | |
parent | c5aa1f7a5f55d2e482591ed4f7f4d2f3b84563eb (diff) | |
download | hdf5-52cfa98120bebabe735367ca22b7ce945080f47c.zip hdf5-52cfa98120bebabe735367ca22b7ce945080f47c.tar.gz hdf5-52cfa98120bebabe735367ca22b7ce945080f47c.tar.bz2 |
[svn-r11237] Purpose:
New Feature.
Description:
Added code and changes so that h5perf (pio) can be built by
standalone mode (that is built by just "h5pcc" without all these
internal files.) With the standalone mode, h5perf can be built
against different versions of hdf5 library and to contrast the
performance among them.
(Note that pio_standalone.c and pio_standalone.h are used in
standalone build only.)
Platforms tested:
Tested in copper and heping.
Diffstat (limited to 'perform/pio_standalone.h')
-rw-r--r-- | perform/pio_standalone.h | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h new file mode 100644 index 0000000..bf80544 --- /dev/null +++ b/perform/pio_standalone.h @@ -0,0 +1,189 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef PIO_STANDALONE_H__ +#define PIO_PERF_H__ + +/* Header file for building h5perf by standalone mode. + * Created: Christian Chilan, 2005/5/18. + */ + +/** From H5private.h **/ + +#include "H5public.h" /* Include Public Definitions */ + + +/* + * Include ANSI-C header files. + */ +#ifdef H5_STDC_HEADERS +# include <assert.h> +# include <ctype.h> +# include <errno.h> +# include <fcntl.h> +# include <float.h> +# include <limits.h> +# include <math.h> +# include <signal.h> +# include <stdarg.h> +# include <stdio.h> +# include <stdlib.h> +# include <string.h> +#endif + +/* + * And now for a couple non-Posix functions... Watch out for systems that + * define these in terms of macros. + */ +#ifdef WIN32 +#define HDstrdup(S) _strdup(S) +#else /* WIN32 */ + +#if !defined strdup && !defined H5_HAVE_STRDUP +extern char *strdup(const char *s); +#endif + +#define HDstrdup(S) strdup(S) + +#endif /* WIN32 */ + +#define HDstrcmp(S,T) strcmp(S,T) +#define HDstrlen(S) strlen(S) +#define HDstrncmp(S,T,L) strncmp(S,T,L) +#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) +#define HDstrchr(S,C) strchr(S,C) +#define HDfree(M) free(M) + + +#ifdef _O_BINARY +#define HDopen(S,F,M) open(S,F|_O_BINARY,M) +#else +#define HDopen(S,F,M) open(S,F,M) +#endif +#define HDclose(F) close(F) + +#ifdef WIN32 + #ifdef __MWERKS__ + #define HDlseek(F,O,W) lseek(F,O,W) + #else /*MSVS */ + #define HDlseek(F,O,W) _lseeki64(F,O,W) + #endif +#else +#define HDlseek(F,O,W) lseek(F,O,W) +#endif + +#if defined (__MWERKS__) +/* workaround for a bug in the Metrowerks version 6.0 header file for write + which is not defined as const void* + */ +#define HDwrite(F,M,Z) write(F,(void*)M,Z) +#else +#define HDwrite(F,M,Z) write(F,M,Z) +#endif + +#define HDread(F,M,Z) read(F,M,Z) + +#ifdef WIN32 + #ifdef __MWERKS__ + #define HDstat(S,B) stat(S,B) + #else /*MSVC*/ + #define HDstat(S,B) _stati64(S,B) + #endif +#else +#define HDstat(S,B) stat(S,B) +#endif + +#ifdef WIN32 + #ifdef __MWERKS__ + #define HDfstat(F,B) fstat(F,B) + typedef struct stat h5_stat_t; + typedef off_t h5_stat_size_t; + #else /*MSVC*/ + #define HDfstat(F,B) _fstati64(F,B) + typedef struct _stati64 h5_stat_t; + typedef __int64 h5_stat_size_t; + #endif +#else +#define HDfstat(F,B) fstat(F,B) +typedef struct stat h5_stat_t; +typedef off_t h5_stat_size_t; +#endif + +/* + * HDF Boolean type. + */ +#ifndef FALSE +# define FALSE 0 +#endif +#ifndef TRUE +# define TRUE 1 +#endif + +/* + * Although `long long' is part of the revised ANSI-C some compilers don't + * support it yet. We define `long_long' as the longest integral integer type + * supported by the compiler, usually 64 bits. It must be legal to qualify + * `long_long' with `unsigned'. + */ +#if H5_SIZEOF_LONG_LONG>0 +# define long_long long long +#elif H5_SIZEOF___INT64>0 +# define long_long __int64 /*Win32*/ +# undef H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64 +#else +# define long_long long int +# undef H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG +#endif + + + +/** From h5test.h **/ + +#ifdef H5_HAVE_PARALLEL +extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */ +#endif + +#ifdef H5_HAVE_PARALLEL +H5TEST_DLL int h5_set_info_object(void); +H5TEST_DLL void h5_dump_info_object(MPI_Info info); +#endif + + + +/** From h5tools_utils.h **/ + +extern int opt_err; /* getoption prints errors if this is on */ +extern int opt_ind; /* token pointer */ +extern const char *opt_arg; /* flag argument (or value) */ + + +enum { + no_arg = 0, /* doesn't take an argument */ + require_arg, /* requires an argument */ + optional_arg /* argument is optional */ +}; + + +typedef struct long_options { + const char *name; /* name of the long option */ + int has_arg; /* whether we should look for an arg */ + char shortval; /* the shortname equivalent of long arg + * this gets returned from get_option */ +} long_options; + +extern int get_option(int argc, const char **argv, const char *opt, + const struct long_options *l_opt); +#endif |