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 #include "option.h"
33 #include "iordef.h"
34 #include "aiori.h"
35 
36 #include <mpi.h>
37 
38 #ifndef MPI_FILE_NULL
39 # include <mpio.h>
40 #endif /* not MPI_FILE_NULL */
41 
42 #define ISPOWEROFTWO(x) ((x != 0) && !(x & (x - 1)))
43 
44 
45 /***************** IOR_BUFFERS *************************************************/
46 /* A struct to hold the buffers so we can pass 1 pointer around instead of 3
47  */
48 
49 typedef struct IO_BUFFERS
50 {
51  void* buffer;
52  void* checkBuffer;
54 
56 
57 /******************************************************************************/
58 /*
59  * The parameter struct holds all of the "global" data to be passed,
60  * as well as results to be parsed.
61  *
62  * NOTE: If IOR_Param_t is changed, also change:
63  * init_IOR_Param_t() [ior.c]
64  * DisplayUsage() [ior.c]
65  * ShowTest() [ior.c]
66  * DecodeDirective() [parse_options.c]
67  * ParseCommandLine() [parse_options.c]
68  * USER_GUIDE
69  */
70 
71 typedef struct
72 {
73  const struct ior_aiori * backend;
74  char * debug; /* debug info string */
75  int referenceNumber; /* user supplied reference number */
76  char * api; /* API for I/O */
77  char * apiVersion; /* API version */
78  char * platform; /* platform type */
79  char * testFileName; /* full name for test */
80  char * options; /* options string */
81  // intermediate options
82  int collective; /* collective I/O */
83  MPI_Comm testComm; /* Current MPI communicator */
84  MPI_Comm mpi_comm_world; /* The global MPI communicator */
85  int dryRun; /* do not perform any I/Os just run evtl. inputs print dummy output */
86  int dualMount; /* dual mount points */
87  ior_memory_flags gpuMemoryFlags; /* use the GPU to store the data */
88  int gpuDirect; /* use gpuDirect, this influences gpuMemoryFlags as well */
89  int gpuID; /* the GPU to use for gpuDirect or memory options */
90  int numTasks; /* number of tasks for test */
91  int numNodes; /* number of nodes for test */
92  int numTasksOnNode0; /* number of tasks on node 0 (usually all the same, but don't have to be, use with caution) */
93  int tasksBlockMapping; /* are the tasks in contiguous blocks across nodes or round-robin */
94  int repetitions; /* number of repetitions of test */
95  int repCounter; /* rep counter */
96  int multiFile; /* multiple files */
97  int interTestDelay; /* delay between reps in seconds */
98  int interIODelay; /* delay after each I/O in us */
99  int open; /* flag for writing or reading */
100  int readFile; /* read of existing file */
101  int writeFile; /* write of file */
102  int filePerProc; /* single file or file-per-process */
103  int reorderTasks; /* reorder tasks for read back and check */
104  int taskPerNodeOffset; /* task node offset for reading files */
105  int reorderTasksRandom; /* reorder tasks for random file read back */
106  int reorderTasksRandomSeed; /* reorder tasks for random file read seed */
107  int checkWrite; /* check read after write */
108  int checkRead; /* check read after read */
109  int keepFile; /* don't delete the testfile on exit */
110  int keepFileWithError; /* don't delete the testfile with errors */
111  int errorFound; /* error found in data check */
112  IOR_offset_t segmentCount; /* number of segments (or HDF5 datasets) */
113  IOR_offset_t blockSize; /* contiguous bytes to write per task */
114  IOR_offset_t transferSize; /* size of transfer in bytes */
115  IOR_offset_t expectedAggFileSize; /* calculated aggregate file size */
116  IOR_offset_t randomPrefillBlocksize; /* prefill option for random IO, the amount of data used for prefill */
117 
118  char * saveRankDetailsCSV; /* save the details about the performance to a file */
119  int summary_every_test; /* flag to print summary every test, not just at end */
120  int uniqueDir; /* use unique directory for each fpp */
121  int useExistingTestFile; /* do not delete test file before access */
122  int deadlineForStonewalling; /* max time in seconds to run any test phase */
123  int stoneWallingWearOut; /* wear out the stonewalling, once the timeout is over, each process has to write the same amount */
124  int minTimeDuration; /* minimum runtime */
125  uint64_t stoneWallingWearOutIterations; /* the number of iterations for the stonewallingWearOut, needed for readBack */
127 
128  int maxTimeDuration; /* max time in minutes to run each test */
129  int outlierThreshold; /* warn on outlier N seconds from mean */
130  int verbose; /* verbosity */
131  int setTimeStampSignature; /* set time stamp signature */
132  unsigned int timeStampSignatureValue; /* value for time stamp signature */
133  int randomSeed; /* random seed for write/read check */
134  unsigned int incompressibleSeed; /* random seed for incompressible file creation */
135  int randomOffset; /* access is to random offsets */
136  size_t memoryPerTask; /* additional memory used per task */
137  size_t memoryPerNode; /* additional memory used per node */
138  char * memoryPerNodeStr; /* for parsing */
139  char * testscripts; /* for parsing */
140  char * buffer_type; /* for parsing */
141  ior_dataPacketType_e dataPacketType; /* The type of data packet. */
142 
143  void * backend_options; /* Backend-specific options */
144 
145  /* POSIX variables */
146  int singleXferAttempt; /* do not retry transfer if incomplete */
147  int fsyncPerWrite; /* fsync() after each write */
148  int fsync; /* fsync() after write */
149 
150  char* URI; /* "path" to target object */
151 
152  int id; /* test's unique ID */
153  int intraTestBarriers; /* barriers between open/op and op/close */
154  int warningAsErrors; /* treat any warning as an error */
155 
157 } IOR_param_t;
158 
159 /* each pointer for a single test */
160 typedef struct {
161  double time;
162  size_t pairs_accessed; // number of I/Os done, useful for deadlineForStonewalling
163 
165  long long stonewall_min_data_accessed; // of all processes
166  long long stonewall_avg_data_accessed; // across all processes
167  long long stonewall_total_data_accessed; // sum accross all processes
168 
172 } IOR_point_t;
173 
174 typedef struct {
175  int errors;
178 } IOR_results_t;
179 
180 /* define the queuing structure for the test parameters */
181 typedef struct IOR_test_t {
184  struct IOR_test_t *next;
185 } IOR_test_t;
186 
187 IOR_test_t *CreateTest(IOR_param_t *init_params, int test_num);
188 void AllocResults(IOR_test_t *test);
189 
190 char * GetPlatformName(void);
191 void init_IOR_Param_t(IOR_param_t *p, MPI_Comm global_com);
192 
193 /*
194  * This function runs IOR given by command line, useful for testing
195  */
196 IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE * out_logfile);
197 
198 /* Actual IOR Main function, renamed to allow library usage */
199 int ior_main(int argc, char **argv);
200 
201 #endif /* !_IOR_H */
int reorderTasks
Definition: ior.h:103
int uniqueDir
Definition: ior.h:120
int reorderTasksRandomSeed
Definition: ior.h:106
size_t pairs_accessed
Definition: ior.h:162
int warningAsErrors
Definition: ior.h:154
long long stonewall_avg_data_accessed
Definition: ior.h:166
MPI_Comm mpi_comm_world
Definition: ior.h:84
int errors
Definition: ior.h:175
int multiFile
Definition: ior.h:96
int ior_main(int argc, char **argv)
Definition: ior.c:189
uint16_t tPort
Definition: ior.h:28
unsigned int incompressibleSeed
Definition: ior.h:134
IOR_offset_t aggFileSizeFromStat
Definition: ior.h:169
unsigned int timeStampSignatureValue
Definition: ior.h:132
int filePerProc
Definition: ior.h:102
FILE * out_logfile
Definition: utilities.c:74
int gpuID
Definition: ior.h:89
double stonewall_time
Definition: ior.h:164
int repetitions
Definition: ior.h:94
IOR_offset_t segmentCount
Definition: ior.h:112
void * checkBuffer
Definition: ior.h:52
int keepFile
Definition: ior.h:109
void AllocResults(IOR_test_t *test)
Definition: ior.c:456
int checkRead
Definition: ior.h:108
int numTasksOnNode0
Definition: ior.h:92
char * GetPlatformName(void)
Definition: ior.c:551
IOR_offset_t transferSize
Definition: ior.h:114
size_t memoryPerNode
Definition: ior.h:137
IOR_param_t params
Definition: ior.h:182
ior_memory_flags gpuMemoryFlags
Definition: ior.h:87
int errorFound
Definition: ior.h:111
IOR_offset_t aggFileSizeFromXfer
Definition: ior.h:170
char * apiVersion
Definition: ior.h:77
int summary_every_test
Definition: ior.h:119
int numNodes
Definition: ior.h:91
int setTimeStampSignature
Definition: ior.h:131
int fsyncPerWrite
Definition: ior.h:147
int interTestDelay
Definition: ior.h:97
int maxTimeDuration
Definition: ior.h:128
char * testFileName
Definition: ior.h:79
char * stoneWallingStatusFile
Definition: ior.h:126
void * backend_options
Definition: ior.h:143
struct IO_BUFFERS IOR_io_buffers
MPI_Comm testComm
Definition: ior.h:83
int taskPerNodeOffset
Definition: ior.h:104
int fsync
Definition: ior.h:148
struct IOR_test_t * next
Definition: ior.h:184
ior_dataPacketType_e dataPacketType
Definition: ior.h:141
char * testscripts
Definition: ior.h:139
int outlierThreshold
Definition: ior.h:129
int intraTestBarriers
Definition: ior.h:153
int reorderTasksRandom
Definition: ior.h:105
int checkWrite
Definition: ior.h:107
IOR_point_t write
Definition: ior.h:176
IOR_test_t * CreateTest(IOR_param_t *init_params, int test_num)
Definition: ior.c:477
Definition: ior.h:49
void * hdfsFS
Definition: ior.h:29
IOR_offset_t aggFileSizeForBW
Definition: ior.h:171
int verbose
Definition: ior.h:130
double time
Definition: ior.h:161
IOR_point_t read
Definition: ior.h:177
int dryRun
Definition: ior.h:85
IOR_offset_t expectedAggFileSize
Definition: ior.h:115
char * options
Definition: ior.h:80
char * platform
Definition: ior.h:78
int gpuDirect
Definition: ior.h:88
int singleXferAttempt
Definition: ior.h:146
int interIODelay
Definition: ior.h:98
char * saveRankDetailsCSV
Definition: ior.h:118
int stoneWallingWearOut
Definition: ior.h:123
long long stonewall_min_data_accessed
Definition: ior.h:165
aiori_xfer_hint_t hints
Definition: ior.h:156
char * URI
Definition: ior.h:150
void * buffer
Definition: ior.h:51
int keepFileWithError
Definition: ior.h:110
int randomSeed
Definition: ior.h:133
int useExistingTestFile
Definition: ior.h:121
int readFile
Definition: ior.h:100
void init_IOR_Param_t(IOR_param_t *p, MPI_Comm global_com)
Definition: ior.c:254
void * readCheckBuffer
Definition: ior.h:53
int tasksBlockMapping
Definition: ior.h:93
int randomOffset
Definition: ior.h:135
char * buffer_type
Definition: ior.h:140
int numTasks
Definition: ior.h:90
size_t memoryPerTask
Definition: ior.h:136
int referenceNumber
Definition: ior.h:75
struct IOR_test_t IOR_test_t
int writeFile
Definition: ior.h:101
uint64_t stoneWallingWearOutIterations
Definition: ior.h:125
int collective
Definition: ior.h:82
IOR_offset_t randomPrefillBlocksize
Definition: ior.h:116
int open
Definition: ior.h:99
const struct ior_aiori * backend
Definition: ior.h:73
int dualMount
Definition: ior.h:86
IOR_results_t * results
Definition: ior.h:183
IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE *out_logfile)
Definition: ior.c:155
char * debug
Definition: ior.h:74
int deadlineForStonewalling
Definition: ior.h:122
char * api
Definition: ior.h:76
int repCounter
Definition: ior.h:95
long long stonewall_total_data_accessed
Definition: ior.h:167
ior_dataPacketType_e
Definition: iordef.h:22
ior_memory_flags
Definition: iordef.h:29
char * memoryPerNodeStr
Definition: ior.h:138
long long int IOR_offset_t
Definition: iordef.h:123
IOR_offset_t blockSize
Definition: ior.h:113
int minTimeDuration
Definition: ior.h:124
int id
Definition: ior.h:152