pio_perf.h

00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00002  * Copyright by The HDF Group.                                               *
00003  * Copyright by the Board of Trustees of the University of Illinois.         *
00004  * All rights reserved.                                                      *
00005  *                                                                           *
00006  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
00007  * terms governing use, modification, and redistribution, is contained in    *
00008  * the files COPYING and Copyright.html.  COPYING can be found at the root   *
00009  * of the source code distribution tree; Copyright.html can be found at the  *
00010  * root level of an installed copy of the electronic HDF5 document set and   *
00011  * is linked from the top-level documents page.  It can also be found at     *
00012  * http://hdfgroup.org/HDF5/doc/Copyright.html.  If you do not have          *
00013  * access to either file, you may request a copy from help@hdfgroup.org.     *
00014  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
00015 
00016 #ifndef PIO_PERF_H__
00017 #define PIO_PERF_H__
00018 
00019 #include "pio_timer.h"
00020 #ifndef STANDALONE
00021 #include "H5private.h"
00022 #include "h5test.h"
00023 #include "h5tools_utils.h"
00024 #else
00025 #include "pio_standalone.h"
00026 #endif
00027 
00028 /* setup the dataset no fill option if this is v1.5 or more */
00029 #if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
00030 #define H5_HAVE_NOFILL 1
00031 #endif
00032 
00033 typedef enum iotype_ {
00034     POSIXIO,
00035     MPIO,
00036     PHDF5
00037     /*NUM_TYPES*/
00038 } iotype;
00039 
00040 typedef struct parameters_ {
00041     iotype      io_type;        /* The type of IO test to perform       */
00042     int         num_procs;      /* Maximum number of processes to use   */
00043     long        num_files;      /* Number of files to create            */
00044     long        num_dsets;      /* Number of datasets to create         */
00045     off_t       num_bytes;      /* Number of bytes in each dset         */
00046     int         num_iters;      /* Number of times to loop doing the IO */
00047     size_t      buf_size;       /* Buffer size                          */
00048     size_t      blk_size;       /* Block size                           */
00049     unsigned    interleaved;    /* Interleaved vs. contiguous blocks    */
00050     unsigned    collective;     /* Collective vs. independent I/O       */
00051     unsigned    dim2d;          /* 1D vs. 2D                            */
00052     hsize_t     h5_align;       /* HDF5 object alignment                */
00053     hsize_t     h5_thresh;      /* HDF5 object alignment threshold      */
00054     int         h5_use_chunks;  /* Make HDF5 dataset chunked            */
00055     int         h5_write_only;  /* Perform the write tests only         */
00056     unsigned    h5_use_mpi_posix;   /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */
00057     int         verify;         /* Verify data correctness              */
00058 } parameters;
00059 
00060 typedef struct results_ {
00061     herr_t      ret_code;
00062     pio_time   *timers;
00063 } results;
00064 
00065 #ifndef SUCCESS
00066 #define SUCCESS     0
00067 #endif  /* !SUCCESS */
00068 
00069 #ifndef FAIL
00070 #define FAIL        -1
00071 #endif  /* !FAIL */
00072 
00073 extern FILE     *output;            /* output file                          */
00074 extern pio_time *timer_g;           /* timer: global for stub functions     */
00075 extern int      comm_world_rank_g;  /* my rank in MPI_COMM_RANK             */
00076 extern int      comm_world_nprocs_g;/* num. of processes of MPI_COMM_WORLD  */
00077 extern MPI_Comm pio_comm_g;         /* Communicator to run the PIO          */
00078 extern int      pio_mpi_rank_g;     /* MPI rank of pio_comm_g               */
00079 extern int      pio_mpi_nprocs_g;   /* number of processes of pio_comm_g    */
00080 extern int      pio_debug_level;    /* The debug level:
00081                                      *   0 - Off
00082                                      *   1 - Minimal
00083                                      *   2 - Some more
00084                                      *   3 - Maximal
00085                                      *   4 - Even More Debugging (timer stuff)
00086                                      */
00087 
00088 #define HDprint_rank(f)              /* print rank in MPI_COMM_WORLD */    \
00089     HDfprintf(f, "%d: ", comm_world_rank_g);
00090 #define HDprint_size(f)              /* print size of MPI_COMM_WORLD */    \
00091     HDfprintf(f, "%d", comm_world_nprocs_g);
00092 #define HDprint_rank_size(f)         /* print rank/size of MPI_COMM_WORLD */  \
00093     HDfprintf(f, "%d/%d: ", comm_world_rank_g, comm_world_nprocs_g);
00094 
00095 #ifdef __cplusplus
00096 extern "C" {
00097 #endif  /* __cplusplus */
00098 
00099 extern results do_pio(parameters param);
00100 
00101 #ifdef __cplusplus
00102 }
00103 #endif  /* __cplusplus */
00104 
00105 #endif  /* PIO_PERF_H__ */