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 
40 #include "iordef.h"
41 /******************** DATA Packet Type ***************************************/
42 /* Holds the types of data packets: generic, offset, timestamp, incompressible */
43 
45 {
46  generic = 0, /* No packet type specified */
47  timestamp=1, /* Timestamp packet set with -l */
48  offset=2, /* Offset packet set with -l */
49  incompressible=3 /* Incompressible packet set with -l */
50 
51 };
52 
53 
54 
55 /***************** IOR_BUFFERS *************************************************/
56 /* A struct to hold the buffers so we can pass 1 pointer around instead of 3
57  */
58 
59 typedef struct IO_BUFFERS
60 {
61  void* buffer;
62  void* checkBuffer;
64 
66 
67 /******************************************************************************/
68 /*
69  * The parameter struct holds all of the "global" data to be passed,
70  * as well as results to be parsed.
71  *
72  * NOTE: If IOR_Param_t is changed, also change:
73  * init_IOR_Param_t() [ior.c]
74  * DisplayUsage() [ior.c]
75  * ShowTest() [ior.c]
76  * DecodeDirective() [parse_options.c]
77  * ParseCommandLine() [parse_options.c]
78  * USER_GUIDE
79  */
80 
81 struct ior_aiori;
82 
83 typedef struct
84 {
85  const struct ior_aiori * backend;
86  char * debug; /* debug info string */
87  unsigned int mode; /* file permissions */
88  unsigned int openFlags; /* open flags (see also <open>) */
89  int referenceNumber; /* user supplied reference number */
90  char * api; /* API for I/O */
91  char * apiVersion; /* API version */
92  char * platform; /* platform type */
93  char * testFileName; /* full name for test */
94  char * testFileName_fppReadCheck;/* filename for fpp read check */
95  char * hintsFileName; /* full name for hints file */
96  char * options; /* options string */
97  // intermediate options
98  int dryRun; /* do not perform any I/Os just run evtl. inputs print dummy output */
99  int numTasks; /* number of tasks for test */
100  int numNodes; /* number of nodes for test */
101  int numTasksOnNode0; /* number of tasks on node 0 (usually all the same, but don't have to be, use with caution) */
102  int tasksBlockMapping; /* are the tasks in contiguous blocks across nodes or round-robin */
103  int repetitions; /* number of repetitions of test */
104  int repCounter; /* rep counter */
105  int multiFile; /* multiple files */
106  int interTestDelay; /* delay between reps in seconds */
107  int interIODelay; /* delay after each I/O in us */
108  int open; /* flag for writing or reading */
109  int readFile; /* read of existing file */
110  int writeFile; /* write of file */
111  int filePerProc; /* single file or file-per-process */
112  int reorderTasks; /* reorder tasks for read back and check */
113  int taskPerNodeOffset; /* task node offset for reading files */
114  int reorderTasksRandom; /* reorder tasks for random file read back */
115  int reorderTasksRandomSeed; /* reorder tasks for random file read seed */
116  int checkWrite; /* check read after write */
117  int checkRead; /* check read after read */
118  int keepFile; /* don't delete the testfile on exit */
119  int keepFileWithError; /* don't delete the testfile with errors */
120  int errorFound; /* error found in data check */
121  int quitOnError; /* quit code when error in check */
122  int collective; /* collective I/O */
123  IOR_offset_t segmentCount; /* number of segments (or HDF5 datasets) */
124  IOR_offset_t blockSize; /* contiguous bytes to write per task */
125  IOR_offset_t transferSize; /* size of transfer in bytes */
126  IOR_offset_t offset; /* offset for read/write */
127  IOR_offset_t expectedAggFileSize; /* calculated aggregate file size */
128  int preallocate; /* preallocate file size */
129  int useFileView; /* use MPI_File_set_view */
130  int useSharedFilePointer; /* use shared file pointer */
131  int useStridedDatatype; /* put strided access into datatype */
132  int showHints; /* show hints */
133  int summary_every_test; /* flag to print summary every test, not just at end */
134  int uniqueDir; /* use unique directory for each fpp */
135  int useExistingTestFile; /* do not delete test file before access */
136  int storeFileOffset; /* use file offset as stored signature */
137  int deadlineForStonewalling; /* max time in seconds to run any test phase */
138  int stoneWallingWearOut; /* wear out the stonewalling, once the timout is over, each process has to write the same amount */
139  uint64_t stoneWallingWearOutIterations; /* the number of iterations for the stonewallingWearOut, needed for readBack */
141 
142  int maxTimeDuration; /* max time in minutes to run each test */
143  int outlierThreshold; /* warn on outlier N seconds from mean */
144  int verbose; /* verbosity */
145  int setTimeStampSignature; /* set time stamp signature */
146  unsigned int timeStampSignatureValue; /* value for time stamp signature */
147  void * fd_fppReadCheck; /* additional fd for fpp read check */
148  int randomSeed; /* random seed for write/read check */
149  unsigned int incompressibleSeed; /* random seed for incompressible file creation */
150  int randomOffset; /* access is to random offsets */
151  size_t memoryPerTask; /* additional memory used per task */
152  size_t memoryPerNode; /* additional memory used per node */
153  char * memoryPerNodeStr; /* for parsing */
154  char * testscripts; /* for parsing */
155  char * buffer_type; /* for parsing */
156  enum PACKET_TYPE dataPacketType; /* The type of data packet. */
157 
158  void * backend_options; /* Backend-specific options */
159 
160  /* POSIX variables */
161  int singleXferAttempt; /* do not retry transfer if incomplete */
162  int fsyncPerWrite; /* fsync() after each write */
163  int fsync; /* fsync() after write */
164 
165  /* MPI variables */
166  MPI_Comm testComm; /* MPI communicator */
167  MPI_Datatype transferType; /* datatype for transfer */
168  MPI_Datatype fileType; /* filetype for file view */
169 
170  /* HDF5 variables */
171  int individualDataSets; /* datasets not shared by all procs */
172  int noFill; /* no fill in file creation */
173  IOR_offset_t setAlignment; /* alignment in bytes */
174 
175  /* HDFS variables */
176  char * hdfs_user; /* copied from ENV, for now */
177  const char* hdfs_name_node;
178  tPort hdfs_name_node_port; /* (uint16_t) */
179  hdfsFS hdfs_fs; /* file-system handle */
180  int hdfs_replicas; /* n block replicas. (0 gets default) */
181  int hdfs_block_size; /* internal blk-size. (0 gets default) */
182 
183  char* URI; /* "path" to target object */
184  size_t part_number; /* multi-part upload increment (PER-RANK!) */
185  char* UploadId; /* key for multi-part-uploads */
186 
187  /* RADOS variables */
188  rados_t rados_cluster; /* RADOS cluster handle */
189  rados_ioctx_t rados_ioctx; /* I/O context for our pool in the RADOS cluster */
190 
191  /* NCMPI variables */
192  int var_id; /* variable id handle for data set */
193 
194  /* Lustre variables */
198  int lustre_set_striping; /* flag that we need to set lustre striping */
200 
201  /* gpfs variables */
202  int gpfs_hint_access; /* use gpfs "access range" hint */
203  int gpfs_release_token; /* immediately release GPFS tokens after
204  creating or opening a file */
205  /* beegfs variables */
206  int beegfs_numTargets; /* number storage targets to use */
207  int beegfs_chunkSize; /* srtipe pattern for new files */
208 
209  int id; /* test's unique ID */
210  int intraTestBarriers; /* barriers between open/op and op/close */
211 } IOR_param_t;
212 
213 /* each pointer for a single test */
214 typedef struct {
215  double time;
216  size_t pairs_accessed; // number of I/Os done, useful for deadlineForStonewalling
217 
221 
225 } IOR_point_t;
226 
227 typedef struct {
228  int errors;
231 } IOR_results_t;
232 
233 /* define the queuing structure for the test parameters */
234 typedef struct IOR_test_t {
237  struct IOR_test_t *next;
238 } IOR_test_t;
239 
240 IOR_test_t *CreateTest(IOR_param_t *init_params, int test_num);
241 void AllocResults(IOR_test_t *test);
242 
243 char * GetPlatformName(void);
245 
246 /*
247  * This function runs IOR given by command line, useful for testing
248  */
249 IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE * out_logfile);
250 
251 /* Actual IOR Main function, renamed to allow library usage */
252 int ior_main(int argc, char **argv);
253 
254 #endif /* !_IOR_H */
void * rados_ioctx_t
Definition: ior.h:36
int reorderTasks
Definition: ior.h:112
int uniqueDir
Definition: ior.h:134
int lustre_stripe_count
Definition: ior.h:195
IOR_offset_t setAlignment
Definition: ior.h:173
int quitOnError
Definition: ior.h:121
int reorderTasksRandomSeed
Definition: ior.h:115
size_t pairs_accessed
Definition: ior.h:216
int showHints
Definition: ior.h:132
long long stonewall_avg_data_accessed
Definition: ior.h:220
char * hdfs_user
Definition: ior.h:176
MPI_Datatype fileType
Definition: ior.h:168
int lustre_stripe_size
Definition: ior.h:196
int errors
Definition: ior.h:228
int multiFile
Definition: ior.h:105
int ior_main(int argc, char **argv)
Definition: ior.c:101
uint16_t tPort
Definition: ior.h:28
unsigned int incompressibleSeed
Definition: ior.h:149
void * rados_t
Definition: ior.h:35
IOR_offset_t aggFileSizeFromStat
Definition: ior.h:222
unsigned int timeStampSignatureValue
Definition: ior.h:146
int filePerProc
Definition: ior.h:111
double stonewall_time
Definition: ior.h:218
int noFill
Definition: ior.h:172
int repetitions
Definition: ior.h:103
IOR_offset_t segmentCount
Definition: ior.h:123
int useStridedDatatype
Definition: ior.h:131
void * checkBuffer
Definition: ior.h:62
int keepFile
Definition: ior.h:118
void AllocResults(IOR_test_t *test)
Definition: ior.c:509
int checkRead
Definition: ior.h:117
int useSharedFilePointer
Definition: ior.h:130
int numTasksOnNode0
Definition: ior.h:101
char * GetPlatformName(void)
Definition: ior.c:664
IOR_offset_t transferSize
Definition: ior.h:125
size_t memoryPerNode
Definition: ior.h:152
IOR_param_t params
Definition: ior.h:235
int gpfs_release_token
Definition: ior.h:203
int storeFileOffset
Definition: ior.h:136
int errorFound
Definition: ior.h:120
IOR_offset_t aggFileSizeFromXfer
Definition: ior.h:223
PACKET_TYPE
Definition: ior.h:44
MPI_Datatype transferType
Definition: ior.h:167
size_t part_number
Definition: ior.h:184
char * apiVersion
Definition: ior.h:91
int summary_every_test
Definition: ior.h:133
int numNodes
Definition: ior.h:100
char * testFileName_fppReadCheck
Definition: ior.h:94
int setTimeStampSignature
Definition: ior.h:145
int hdfs_replicas
Definition: ior.h:180
unsigned int openFlags
Definition: ior.h:88
int fsyncPerWrite
Definition: ior.h:162
int interTestDelay
Definition: ior.h:106
int lustre_start_ost
Definition: ior.h:197
int maxTimeDuration
Definition: ior.h:142
char * testFileName
Definition: ior.h:93
char * stoneWallingStatusFile
Definition: ior.h:140
unsigned int mode
Definition: ior.h:87
void * backend_options
Definition: ior.h:158
struct IO_BUFFERS IOR_io_buffers
MPI_Comm testComm
Definition: ior.h:166
int taskPerNodeOffset
Definition: ior.h:113
int fsync
Definition: ior.h:163
char * hintsFileName
Definition: ior.h:95
struct IOR_test_t * next
Definition: ior.h:237
hdfsFS hdfs_fs
Definition: ior.h:179
char * testscripts
Definition: ior.h:154
tPort hdfs_name_node_port
Definition: ior.h:178
int outlierThreshold
Definition: ior.h:143
int intraTestBarriers
Definition: ior.h:210
int reorderTasksRandom
Definition: ior.h:114
int checkWrite
Definition: ior.h:116
IOR_point_t write
Definition: ior.h:229
IOR_test_t * CreateTest(IOR_param_t *init_params, int test_num)
Definition: ior.c:530
Definition: ior.h:59
void * hdfsFS
Definition: ior.h:29
IOR_offset_t aggFileSizeForBW
Definition: ior.h:224
int verbose
Definition: ior.h:144
double time
Definition: ior.h:215
IOR_point_t read
Definition: ior.h:230
int dryRun
Definition: ior.h:98
IOR_offset_t expectedAggFileSize
Definition: ior.h:127
char * options
Definition: ior.h:96
char * platform
Definition: ior.h:92
int singleXferAttempt
Definition: ior.h:161
Definition: ior.h:48
int interIODelay
Definition: ior.h:107
void * fd_fppReadCheck
Definition: ior.h:147
int stoneWallingWearOut
Definition: ior.h:138
char * UploadId
Definition: ior.h:185
long long stonewall_min_data_accessed
Definition: ior.h:219
char * URI
Definition: ior.h:183
void * buffer
Definition: ior.h:61
int keepFileWithError
Definition: ior.h:119
int randomSeed
Definition: ior.h:148
int useExistingTestFile
Definition: ior.h:135
int beegfs_numTargets
Definition: ior.h:206
int useFileView
Definition: ior.h:129
int readFile
Definition: ior.h:109
void * readCheckBuffer
Definition: ior.h:63
int tasksBlockMapping
Definition: ior.h:102
int hdfs_block_size
Definition: ior.h:181
int randomOffset
Definition: ior.h:150
char * buffer_type
Definition: ior.h:155
int numTasks
Definition: ior.h:99
size_t memoryPerTask
Definition: ior.h:151
int referenceNumber
Definition: ior.h:89
rados_t rados_cluster
Definition: ior.h:188
int lustre_ignore_locks
Definition: ior.h:199
int individualDataSets
Definition: ior.h:171
struct IOR_test_t IOR_test_t
int writeFile
Definition: ior.h:110
Definition: ior.h:47
uint64_t stoneWallingWearOutIterations
Definition: ior.h:139
int collective
Definition: ior.h:122
IOR_offset_t offset
Definition: ior.h:126
int open
Definition: ior.h:108
const struct ior_aiori * backend
Definition: ior.h:85
int var_id
Definition: ior.h:192
IOR_results_t * results
Definition: ior.h:236
IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE *out_logfile)
Definition: ior.c:61
char * debug
Definition: ior.h:86
int preallocate
Definition: ior.h:128
int deadlineForStonewalling
Definition: ior.h:137
char * api
Definition: ior.h:90
int repCounter
Definition: ior.h:104
char * memoryPerNodeStr
Definition: ior.h:153
rados_ioctx_t rados_ioctx
Definition: ior.h:189
FILE * out_logfile
Definition: utilities.c:62
long long int IOR_offset_t
Definition: iordef.h:122
int gpfs_hint_access
Definition: ior.h:202
IOR_offset_t blockSize
Definition: ior.h:124
int lustre_set_striping
Definition: ior.h:198
void init_IOR_Param_t(IOR_param_t *p)
Definition: ior.c:175
const char * hdfs_name_node
Definition: ior.h:177
int beegfs_chunkSize
Definition: ior.h:207
int id
Definition: ior.h:209