IOR
ior.h
Go to the documentation of this file.
1 /* -*- mode: c; indent-tabs-mode: nil; -*-
2  * vim:expandtab:
3  *
4  * NOTE: Someone was setting indent-sizes in the mode-line. Don't do that.
5  * 8-chars of indenting is ridiculous. If you really want 8-spaces,
6  * then change the mode-line to use tabs, and configure your personal
7  * editor environment to use 8-space tab-stops.
8  *
9  */
10 /******************************************************************************\
11 * *
12 * Copyright (c) 2003, The Regents of the University of California *
13 * See the file COPYRIGHT for a complete copyright notice and license. *
14 * *
15 \******************************************************************************/
16 
17 #ifndef _IOR_H
18 #define _IOR_H
19 
20 #ifdef HAVE_CONFIG_H
21 # include "config.h"
22 #endif
23 
24 #ifdef USE_HDFS_AIORI
25 # include <hdfs.h> /* hdfsFS */
26 #else
27 # include <stdint.h>
28  typedef uint16_t tPort; /* unused, but needs a type */
29  typedef void* hdfsFS; /* unused, but needs a type */
30 #endif
31 
32 #ifdef USE_RADOS_AIORI
33 # include <rados/librados.h>
34 #else
35  typedef void *rados_t;
36  typedef void *rados_ioctx_t;
37 #endif
38 #include "option.h"
39 #include "iordef.h"
40 #include "aiori.h"
41 
42 #include <mpi.h>
43 
44 #ifndef MPI_FILE_NULL
45 # include <mpio.h>
46 #endif /* not MPI_FILE_NULL */
47 
48 #define ISPOWEROFTWO(x) ((x != 0) && !(x & (x - 1)))
49 /******************** DATA Packet Type ***************************************/
50 /* Holds the types of data packets: generic, offset, timestamp, incompressible */
51 
53 {
54  generic = 0, /* No packet type specified */
55  timestamp=1, /* Timestamp packet set with -l */
56  offset=2, /* Offset packet set with -l */
57  incompressible=3 /* Incompressible packet set with -l */
58 
59 };
60 
61 typedef enum{
66 
67 
68 /***************** IOR_BUFFERS *************************************************/
69 /* A struct to hold the buffers so we can pass 1 pointer around instead of 3
70  */
71 
72 typedef struct IO_BUFFERS
73 {
74  void* buffer;
75  void* checkBuffer;
77 
79 
80 /******************************************************************************/
81 /*
82  * The parameter struct holds all of the "global" data to be passed,
83  * as well as results to be parsed.
84  *
85  * NOTE: If IOR_Param_t is changed, also change:
86  * init_IOR_Param_t() [ior.c]
87  * DisplayUsage() [ior.c]
88  * ShowTest() [ior.c]
89  * DecodeDirective() [parse_options.c]
90  * ParseCommandLine() [parse_options.c]
91  * USER_GUIDE
92  */
93 
94 typedef struct
95 {
96  const struct ior_aiori * backend;
97  char * debug; /* debug info string */
98  int referenceNumber; /* user supplied reference number */
99  char * api; /* API for I/O */
100  char * apiVersion; /* API version */
101  char * platform; /* platform type */
102  char * testFileName; /* full name for test */
103  char * options; /* options string */
104  // intermediate options
105  int collective; /* collective I/O */
106  MPI_Comm testComm; /* Current MPI communicator */
107  MPI_Comm mpi_comm_world; /* The global MPI communicator */
108  int dryRun; /* do not perform any I/Os just run evtl. inputs print dummy output */
109  int dualMount; /* dual mount points */
110  ior_memory_flags gpuMemoryFlags; /* use the GPU to store the data */
111  int gpuDirect; /* use gpuDirect, this influences gpuMemoryFlags as well */
112  int gpuID; /* the GPU to use for gpuDirect or memory options */
113  int numTasks; /* number of tasks for test */
114  int numNodes; /* number of nodes for test */
115  int numTasksOnNode0; /* number of tasks on node 0 (usually all the same, but don't have to be, use with caution) */
116  int tasksBlockMapping; /* are the tasks in contiguous blocks across nodes or round-robin */
117  int repetitions; /* number of repetitions of test */
118  int repCounter; /* rep counter */
119  int multiFile; /* multiple files */
120  int interTestDelay; /* delay between reps in seconds */
121  int interIODelay; /* delay after each I/O in us */
122  int open; /* flag for writing or reading */
123  int readFile; /* read of existing file */
124  int writeFile; /* write of file */
125  int filePerProc; /* single file or file-per-process */
126  int reorderTasks; /* reorder tasks for read back and check */
127  int taskPerNodeOffset; /* task node offset for reading files */
128  int reorderTasksRandom; /* reorder tasks for random file read back */
129  int reorderTasksRandomSeed; /* reorder tasks for random file read seed */
130  int checkWrite; /* check read after write */
131  int checkRead; /* check read after read */
132  int keepFile; /* don't delete the testfile on exit */
133  int keepFileWithError; /* don't delete the testfile with errors */
134  int errorFound; /* error found in data check */
135  IOR_offset_t segmentCount; /* number of segments (or HDF5 datasets) */
136  IOR_offset_t blockSize; /* contiguous bytes to write per task */
137  IOR_offset_t transferSize; /* size of transfer in bytes */
138  IOR_offset_t expectedAggFileSize; /* calculated aggregate file size */
139  IOR_offset_t randomPrefillBlocksize; /* prefill option for random IO, the amount of data used for prefill */
140 
141  char * saveRankDetailsCSV; /* save the details about the performance to a file */
142  int summary_every_test; /* flag to print summary every test, not just at end */
143  int uniqueDir; /* use unique directory for each fpp */
144  int useExistingTestFile; /* do not delete test file before access */
145  int storeFileOffset; /* use file offset as stored signature */
146  int deadlineForStonewalling; /* max time in seconds to run any test phase */
147  int stoneWallingWearOut; /* wear out the stonewalling, once the timeout is over, each process has to write the same amount */
148  uint64_t stoneWallingWearOutIterations; /* the number of iterations for the stonewallingWearOut, needed for readBack */
150 
151  int maxTimeDuration; /* max time in minutes to run each test */
152  int outlierThreshold; /* warn on outlier N seconds from mean */
153  int verbose; /* verbosity */
154  int setTimeStampSignature; /* set time stamp signature */
155  unsigned int timeStampSignatureValue; /* value for time stamp signature */
156  int randomSeed; /* random seed for write/read check */
157  unsigned int incompressibleSeed; /* random seed for incompressible file creation */
158  int randomOffset; /* access is to random offsets */
159  size_t memoryPerTask; /* additional memory used per task */
160  size_t memoryPerNode; /* additional memory used per node */
161  char * memoryPerNodeStr; /* for parsing */
162  char * testscripts; /* for parsing */
163  char * buffer_type; /* for parsing */
164  enum PACKET_TYPE dataPacketType; /* The type of data packet. */
165 
166  void * backend_options; /* Backend-specific options */
167 
168  /* POSIX variables */
169  int singleXferAttempt; /* do not retry transfer if incomplete */
170  int fsyncPerWrite; /* fsync() after each write */
171  int fsync; /* fsync() after write */
172 
173  char* URI; /* "path" to target object */
174 
175  /* RADOS variables */
176  rados_t rados_cluster; /* RADOS cluster handle */
177  rados_ioctx_t rados_ioctx; /* I/O context for our pool in the RADOS cluster */
178 
179  int id; /* test's unique ID */
180  int intraTestBarriers; /* barriers between open/op and op/close */
181  int warningAsErrors; /* treat any warning as an error */
182 
184 } IOR_param_t;
185 
186 /* each pointer for a single test */
187 typedef struct {
188  double time;
189  size_t pairs_accessed; // number of I/Os done, useful for deadlineForStonewalling
190 
192  long long stonewall_min_data_accessed; // of all processes
193  long long stonewall_avg_data_accessed; // across all processes
194  long long stonewall_total_data_accessed; // sum accross all processes
195 
199 } IOR_point_t;
200 
201 typedef struct {
202  int errors;
205 } IOR_results_t;
206 
207 /* define the queuing structure for the test parameters */
208 typedef struct IOR_test_t {
211  struct IOR_test_t *next;
212 } IOR_test_t;
213 
214 IOR_test_t *CreateTest(IOR_param_t *init_params, int test_num);
215 void AllocResults(IOR_test_t *test);
216 
217 char * GetPlatformName(void);
218 void init_IOR_Param_t(IOR_param_t *p, MPI_Comm global_com);
219 
220 /*
221  * This function runs IOR given by command line, useful for testing
222  */
223 IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE * out_logfile);
224 
225 /* Actual IOR Main function, renamed to allow library usage */
226 int ior_main(int argc, char **argv);
227 
228 #endif /* !_IOR_H */
void * rados_ioctx_t
Definition: ior.h:36
int reorderTasks
Definition: ior.h:126
int uniqueDir
Definition: ior.h:143
ior_memory_flags
Definition: ior.h:61
int reorderTasksRandomSeed
Definition: ior.h:129
size_t pairs_accessed
Definition: ior.h:189
int warningAsErrors
Definition: ior.h:181
long long stonewall_avg_data_accessed
Definition: ior.h:193
MPI_Comm mpi_comm_world
Definition: ior.h:107
int errors
Definition: ior.h:202
int multiFile
Definition: ior.h:119
int ior_main(int argc, char **argv)
Definition: ior.c:183
uint16_t tPort
Definition: ior.h:28
unsigned int incompressibleSeed
Definition: ior.h:157
void * rados_t
Definition: ior.h:35
IOR_offset_t aggFileSizeFromStat
Definition: ior.h:196
unsigned int timeStampSignatureValue
Definition: ior.h:155
int filePerProc
Definition: ior.h:125
FILE * out_logfile
Definition: utilities.c:72
int gpuID
Definition: ior.h:112
double stonewall_time
Definition: ior.h:191
int repetitions
Definition: ior.h:117
IOR_offset_t segmentCount
Definition: ior.h:135
void * checkBuffer
Definition: ior.h:75
int keepFile
Definition: ior.h:132
void AllocResults(IOR_test_t *test)
Definition: ior.c:521
int checkRead
Definition: ior.h:131
int numTasksOnNode0
Definition: ior.h:115
char * GetPlatformName(void)
Definition: ior.c:671
IOR_offset_t transferSize
Definition: ior.h:137
size_t memoryPerNode
Definition: ior.h:160
IOR_param_t params
Definition: ior.h:209
ior_memory_flags gpuMemoryFlags
Definition: ior.h:110
int storeFileOffset
Definition: ior.h:145
int errorFound
Definition: ior.h:134
IOR_offset_t aggFileSizeFromXfer
Definition: ior.h:197
PACKET_TYPE
Definition: ior.h:52
char * apiVersion
Definition: ior.h:100
int summary_every_test
Definition: ior.h:142
int numNodes
Definition: ior.h:114
int setTimeStampSignature
Definition: ior.h:154
int fsyncPerWrite
Definition: ior.h:170
int interTestDelay
Definition: ior.h:120
int maxTimeDuration
Definition: ior.h:151
char * testFileName
Definition: ior.h:102
char * stoneWallingStatusFile
Definition: ior.h:149
void * backend_options
Definition: ior.h:166
struct IO_BUFFERS IOR_io_buffers
MPI_Comm testComm
Definition: ior.h:106
int taskPerNodeOffset
Definition: ior.h:127
int fsync
Definition: ior.h:171
struct IOR_test_t * next
Definition: ior.h:211
char * testscripts
Definition: ior.h:162
int outlierThreshold
Definition: ior.h:152
int intraTestBarriers
Definition: ior.h:180
int reorderTasksRandom
Definition: ior.h:128
int checkWrite
Definition: ior.h:130
IOR_point_t write
Definition: ior.h:203
IOR_test_t * CreateTest(IOR_param_t *init_params, int test_num)
Definition: ior.c:542
Definition: ior.h:72
void * hdfsFS
Definition: ior.h:29
IOR_offset_t aggFileSizeForBW
Definition: ior.h:198
int verbose
Definition: ior.h:153
double time
Definition: ior.h:188
IOR_point_t read
Definition: ior.h:204
int dryRun
Definition: ior.h:108
IOR_offset_t expectedAggFileSize
Definition: ior.h:138
char * options
Definition: ior.h:103
char * platform
Definition: ior.h:101
int gpuDirect
Definition: ior.h:111
int singleXferAttempt
Definition: ior.h:169
Definition: ior.h:56
int interIODelay
Definition: ior.h:121
char * saveRankDetailsCSV
Definition: ior.h:141
int stoneWallingWearOut
Definition: ior.h:147
long long stonewall_min_data_accessed
Definition: ior.h:192
aiori_xfer_hint_t hints
Definition: ior.h:183
char * URI
Definition: ior.h:173
void * buffer
Definition: ior.h:74
int keepFileWithError
Definition: ior.h:133
int randomSeed
Definition: ior.h:156
int useExistingTestFile
Definition: ior.h:144
int readFile
Definition: ior.h:123
void init_IOR_Param_t(IOR_param_t *p, MPI_Comm global_com)
Definition: ior.c:248
void * readCheckBuffer
Definition: ior.h:76
int tasksBlockMapping
Definition: ior.h:116
int randomOffset
Definition: ior.h:158
char * buffer_type
Definition: ior.h:163
int numTasks
Definition: ior.h:113
size_t memoryPerTask
Definition: ior.h:159
int referenceNumber
Definition: ior.h:98
rados_t rados_cluster
Definition: ior.h:176
struct IOR_test_t IOR_test_t
int writeFile
Definition: ior.h:124
Definition: ior.h:55
uint64_t stoneWallingWearOutIterations
Definition: ior.h:148
int collective
Definition: ior.h:105
IOR_offset_t randomPrefillBlocksize
Definition: ior.h:139
int open
Definition: ior.h:122
const struct ior_aiori * backend
Definition: ior.h:96
int dualMount
Definition: ior.h:109
IOR_results_t * results
Definition: ior.h:210
IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE *out_logfile)
Definition: ior.c:149
char * debug
Definition: ior.h:97
int deadlineForStonewalling
Definition: ior.h:146
char * api
Definition: ior.h:99
int repCounter
Definition: ior.h:118
long long stonewall_total_data_accessed
Definition: ior.h:194
char * memoryPerNodeStr
Definition: ior.h:161
rados_ioctx_t rados_ioctx
Definition: ior.h:177
long long int IOR_offset_t
Definition: iordef.h:109
IOR_offset_t blockSize
Definition: ior.h:136
int id
Definition: ior.h:179