sio_perf.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * All rights reserved.                                                      *
00004  *                                                                           *
00005  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00006  * terms governing use, modification, and redistribution, is contained in    *
00007  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00008  * of the source code distribution tree; Copyright.html can be found at the  *
00009  * root level of an installed copy of the electronic HDF5 document set and   *
00010  * is linked from the top-level documents page.  It can also be found at     *
00011  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00012  * access to either file, you may request a copy from help@hdfgroup.org.     *
00013  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00014 
00015 #ifndef SIO_PERF_H__
00016 #define SIO_PERF_H__
00017 
00018 #include "sio_timer.h"
00019 #ifndef STANDALONE
00020 #include "H5private.h"
00021 #include "h5test.h"
00022 #include "h5tools_utils.h"
00023 #else
00024 #include "sio_standalone.h"
00025 #endif
00026 
00027 /* setup the dataset no fill option if this is v1.5 or more */
00028 #if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
00029 #define H5_HAVE_NOFILL 1
00030 #endif
00031 
00032 #define MAX_DIMS 32
00033 
00034 typedef enum iotype_ {
00035     POSIXIO,
00036     HDF5
00037     /*NUM_TYPES*/
00038 } iotype;
00039 
00040 typedef enum vfdtype_ {
00041     sec2,
00042     stdio,
00043     core,
00044     split,
00045     multi,
00046     family,
00047     direct
00048     /*NUM_TYPES*/
00049 } vfdtype;
00050 
00051 typedef struct parameters_ {
00052     iotype      io_type;        /* The type of IO test to perform       */
00053     vfdtype     vfd;
00054     long        num_files;      /* Number of files to create            */
00055     long        num_dsets;      /* Number of datasets to create         */
00056     off_t       num_bytes;      /* Number of bytes in each dset         */
00057     int         num_iters;      /* Number of times to loop doing the IO */
00058     int         rank;           /* Rank of dataset */
00059     off_t       dset_size[MAX_DIMS]; /* Dataset size             */
00060     size_t      buf_size[MAX_DIMS]; /* Buffer size               */
00061     size_t      chk_size[MAX_DIMS]; /* Chunk size               */
00062     int         order[MAX_DIMS]; /* Buffer size               */
00063     hsize_t     h5_align;       /* HDF5 object alignment                */
00064     hsize_t     h5_thresh;      /* HDF5 object alignment threshold      */
00065     int         h5_use_chunks;  /* Make HDF5 dataset chunked            */
00066     int         h5_extendable;  /* Make HDF5 dataset chunked            */
00067     int         h5_write_only;  /* Perform the write tests only         */
00068     unsigned    h5_use_mpi_posix;   /* VFD for HDF5 I/O  */
00069     int         verify;         /* Verify data correctness              */
00070 } parameters;
00071 
00072 typedef struct results_ {
00073     herr_t      ret_code;
00074     sio_time   *timers;
00075 } results;
00076 
00077 #ifndef SUCCESS
00078 #define SUCCESS     0
00079 #endif  /* !SUCCESS */
00080 
00081 #ifndef FAIL
00082 #define FAIL        -1
00083 #endif  /* !FAIL */
00084 
00085 extern FILE     *output;            /* output file                          */
00086 extern sio_time *timer_g;           /* timer: global for stub functions     */
00087 extern int      sio_debug_level;    /* The debug level:
00088                                      *   0 - Off
00089                                      *   1 - Minimal
00090                                      *   2 - Some more
00091                                      *   3 - Maximal
00092                                      *   4 - Even More Debugging (timer stuff)
00093                                      */
00094 #ifdef __cplusplus
00095 extern "C" {
00096 #endif  /* __cplusplus */
00097 
00098 extern results do_sio(parameters param);
00099 
00100 #ifdef __cplusplus
00101 }
00102 #endif  /* __cplusplus */
00103 
00104 #endif  /* PIO_PERF_H__ */