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