1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * All rights reserved.                                                      *
4  *                                                                           *
5  * This file is part of HDF5.  The full HDF5 copyright notice, including     *
6  * terms governing use, modification, and redistribution, is contained in    *
7  * the COPYING file, which can be found at the root of the source code       *
8  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
9  * If you do not have access to either file, you may request a copy from     *
10  * help@hdfgroup.org.                                                        *
11  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12 
13 #ifndef PIO_PERF_H__
14 #define PIO_PERF_H__
15 
16 #include "io_timer.h"
17 #ifndef STANDALONE
18 #include "h5test.h"
19 #include "h5tools.h"
20 #include "h5tools_utils.h"
21 #else
22 #include "pio_standalone.h"
23 #endif
24 
25 /* setup the dataset no fill option if this is v1.5 or more */
26 #if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
27 #define H5_HAVE_NOFILL 1
28 #endif
29 
30 typedef enum iotype_ {
31     POSIXIO,
32     MPIO,
33     PHDF5
34     /*NUM_TYPES*/
35 } iotype;
36 
37 typedef struct parameters_ {
38     iotype    io_type;        /* The type of IO test to perform       */
39     int        num_procs;      /* Maximum number of processes to use   */
40     long    num_files;      /* Number of files to create            */
41     long    num_dsets;      /* Number of datasets to create         */
42     off_t    num_bytes;      /* Number of bytes in each dset         */
43     int         num_iters;      /* Number of times to loop doing the IO */
44     size_t     buf_size;       /* Buffer size                          */
45     size_t     blk_size;       /* Block size                           */
46     unsigned    interleaved;    /* Interleaved vs. contiguous blocks    */
47     unsigned    collective;     /* Collective vs. independent I/O       */
48     unsigned    dim2d;          /* 1D vs. 2D                            */
49     hsize_t     h5_align;       /* HDF5 object alignment                */
50     hsize_t     h5_thresh;      /* HDF5 object alignment threshold      */
51     int     h5_use_chunks;  /* Make HDF5 dataset chunked            */
52     int        h5_write_only;  /* Perform the write tests only         */
53     int     verify;        /* Verify data correctness              */
54 } parameters;
55 
56 typedef struct results_ {
57     herr_t      ret_code;
58     io_time_t   *timers;
59 } results;
60 
61 #ifndef SUCCESS
62 #define SUCCESS     0
63 #endif  /* !SUCCESS */
64 
65 #ifndef FAIL
66 #define FAIL        -1
67 #endif  /* !FAIL */
68 
69 extern FILE     *output;            /* output file                          */
70 extern io_time_t *timer_g;           /* timer: global for stub functions     */
71 extern int      comm_world_rank_g;  /* my rank in MPI_COMM_RANK             */
72 extern int      comm_world_nprocs_g;/* num. of processes of MPI_COMM_WORLD  */
73 extern MPI_Comm pio_comm_g;         /* Communicator to run the PIO          */
74 extern int      pio_mpi_rank_g;     /* MPI rank of pio_comm_g               */
75 extern int      pio_mpi_nprocs_g;   /* number of processes of pio_comm_g    */
76 extern int      pio_debug_level;    /* The debug level:
77                                      *   0 - Off
78                                      *   1 - Minimal
79                                      *   2 - Some more
80                                      *   3 - Maximal
81                                      *   4 - Even More Debugging (timer stuff)
82                                      */
83 
84 #define HDprint_rank(f)              /* print rank in MPI_COMM_WORLD */    \
85     HDfprintf(f, "%d: ", comm_world_rank_g);
86 #define HDprint_size(f)              /* print size of MPI_COMM_WORLD */    \
87     HDfprintf(f, "%d", comm_world_nprocs_g);
88 #define HDprint_rank_size(f)         /* print rank/size of MPI_COMM_WORLD */  \
89     HDfprintf(f, "%d/%d: ", comm_world_rank_g, comm_world_nprocs_g);
90 
91 #ifdef __cplusplus
92 extern "C" {
93 #endif  /* __cplusplus */
94 
95 extern results do_pio(parameters param);
96 
97 #ifdef __cplusplus
98 }
99 #endif  /* __cplusplus */
100 
101 #endif  /* PIO_PERF_H__ */
102