32 #define ISPOWEROFTWO(x) ((x != 0) && !(x & (x - 1))) 45 rc = sscanf(size_str,
" %d %% ", &percent);
48 if (percent > 100 || percent < 0)
49 ERR(
"percentage must be between 0 and 100");
51 page_size = sysconf(_SC_PAGESIZE);
53 num_pages = sysconf(_SC_PHYS_PAGES);
55 ERR(
"sysconf(_SC_PHYS_PAGES) is not supported");
57 ERR(
"sysconf(_SC_PHYS_PAGES) is not supported");
59 mem = page_size * num_pages;
61 return mem / 100 * percent;
73 for (ptr = tests; ptr !=
NULL; ptr = ptr->
next) {
117 rc = sscanf(line,
" %[^=# \t\r\n] = %[^# \t\r\n] ", option, value);
118 if (rc != 2 &&
rank == 0) {
119 fprintf(
out_logfile,
"Syntax error in configuration options: %s\n",
121 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
123 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
127 if (strcasecmp(option,
"api") == 0) {
128 params->
api = strdup(value);
129 }
else if (strcasecmp(option,
"summaryFile") == 0) {
133 FAIL(
"Cannot open output file for writes!");
135 printf(
"Writing output to %s\n", value);
137 }
else if (strcasecmp(option,
"summaryFormat") == 0) {
138 if(strcasecmp(value,
"default") == 0){
140 }
else if(strcasecmp(value,
"JSON") == 0){
142 }
else if(strcasecmp(value,
"CSV") == 0){
145 FAIL(
"Unknown summaryFormat");
147 }
else if (strcasecmp(option,
"refnum") == 0) {
149 }
else if (strcasecmp(option,
"debug") == 0) {
150 params->
debug = strdup(value);
151 }
else if (strcasecmp(option,
"platform") == 0) {
153 }
else if (strcasecmp(option,
"testfile") == 0) {
155 }
else if (strcasecmp(option,
"hintsfilename") == 0) {
157 }
else if (strcasecmp(option,
"deadlineforstonewalling") == 0) {
159 }
else if (strcasecmp(option,
"stoneWallingWearOut") == 0) {
161 }
else if (strcasecmp(option,
"stoneWallingWearOutIterations") == 0) {
163 }
else if (strcasecmp(option,
"stoneWallingStatusFile") == 0) {
165 }
else if (strcasecmp(option,
"maxtimeduration") == 0) {
167 }
else if (strcasecmp(option,
"outlierthreshold") == 0) {
169 }
else if (strcasecmp(option,
"nodes") == 0) {
170 params->
nodes = atoi(value);
171 }
else if (strcasecmp(option,
"repetitions") == 0) {
173 }
else if (strcasecmp(option,
"intertestdelay") == 0) {
175 }
else if (strcasecmp(option,
"readfile") == 0) {
177 }
else if (strcasecmp(option,
"writefile") == 0) {
179 }
else if (strcasecmp(option,
"fileperproc") == 0) {
181 }
else if (strcasecmp(option,
"taskpernodeoffset") == 0) {
183 }
else if (strcasecmp(option,
"reordertasksconstant") == 0) {
185 }
else if (strcasecmp(option,
"reordertasksrandom") == 0) {
187 }
else if (strcasecmp(option,
"reordertasksrandomSeed") == 0) {
189 }
else if (strcasecmp(option,
"reordertasks") == 0) {
193 }
else if (strcasecmp(option,
"checkwrite") == 0) {
195 }
else if (strcasecmp(option,
"checkread") == 0) {
197 }
else if (strcasecmp(option,
"keepfile") == 0) {
199 }
else if (strcasecmp(option,
"keepfilewitherror") == 0) {
201 }
else if (strcasecmp(option,
"multiFile") == 0) {
203 }
else if (strcasecmp(option,
"quitonerror") == 0) {
205 }
else if (strcasecmp(option,
"segmentcount") == 0) {
207 }
else if (strcasecmp(option,
"blocksize") == 0) {
209 }
else if (strcasecmp(option,
"transfersize") == 0) {
211 }
else if (strcasecmp(option,
"setalignment") == 0) {
213 }
else if (strcasecmp(option,
"singlexferattempt") == 0) {
215 }
else if (strcasecmp(option,
"individualdatasets") == 0) {
217 }
else if (strcasecmp(option,
"intraTestBarriers") == 0) {
219 }
else if (strcasecmp(option,
"nofill") == 0) {
220 params->
noFill = atoi(value);
221 }
else if (strcasecmp(option,
"verbose") == 0) {
223 }
else if (strcasecmp(option,
"settimestampsignature") == 0) {
225 }
else if (strcasecmp(option,
"collective") == 0) {
227 }
else if (strcasecmp(option,
"preallocate") == 0) {
229 }
else if (strcasecmp(option,
"storefileoffset") == 0) {
231 }
else if (strcasecmp(option,
"usefileview") == 0) {
233 }
else if (strcasecmp(option,
"usesharedfilepointer") == 0) {
235 }
else if (strcasecmp(option,
"useo_direct") == 0) {
237 }
else if (strcasecmp(option,
"usestrideddatatype") == 0) {
239 }
else if (strcasecmp(option,
"showhints") == 0) {
241 }
else if (strcasecmp(option,
"uniqueDir") == 0) {
243 }
else if (strcasecmp(option,
"useexistingtestfile") == 0) {
245 }
else if (strcasecmp(option,
"fsyncperwrite") == 0) {
247 }
else if (strcasecmp(option,
"fsync") == 0) {
248 params->
fsync = atoi(value);
249 }
else if (strcasecmp(option,
"randomoffset") == 0) {
251 }
else if (strcasecmp(option,
"memoryPerTask") == 0) {
254 }
else if (strcasecmp(option,
"memoryPerNode") == 0) {
257 }
else if (strcasecmp(option,
"lustrestripecount") == 0) {
258 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 259 ERR(
"ior was not compiled with Lustre support");
263 }
else if (strcasecmp(option,
"lustrestripesize") == 0) {
264 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 265 ERR(
"ior was not compiled with Lustre support");
269 }
else if (strcasecmp(option,
"lustrestartost") == 0) {
270 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 271 ERR(
"ior was not compiled with Lustre support");
275 }
else if (strcasecmp(option,
"lustreignorelocks") == 0) {
276 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 277 ERR(
"ior was not compiled with Lustre support");
280 }
else if (strcasecmp(option,
"gpfshintaccess") == 0) {
281 #ifndef HAVE_GPFS_FCNTL_H 282 ERR(
"ior was not compiled with GPFS hint support");
285 }
else if (strcasecmp(option,
"gpfsreleasetoken") == 0) {
286 #ifndef HAVE_GPFS_FCNTL_H 287 ERR(
"ior was not compiled with GPFS hint support");
290 }
else if (strcasecmp(option,
"beegfsNumTargets") == 0) {
291 #ifndef HAVE_BEEGFS_BEEGFS_H 292 ERR(
"ior was not compiled with BeeGFS support");
296 ERR(
"beegfsNumTargets must be >= 1");
297 }
else if (strcasecmp(option,
"beegfsChunkSize") == 0) {
298 #ifndef HAVE_BEEGFS_BEEGFS_H 299 ERR(
"ior was not compiled with BeeGFS support");
303 ERR(
"beegfsChunkSize must be a power of two and >64k");
304 }
else if (strcasecmp(option,
"numtasks") == 0) {
306 }
else if (strcasecmp(option,
"summaryalways") == 0) {
310 fprintf(
out_logfile,
"Unrecognized parameter \"%s\"\n",
312 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
314 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
329 end = strchr(start,
',');
334 }
while (end !=
NULL);
345 end = haystack + strlen(haystack);
347 for (ptr = haystack; ptr < end; ptr++) {
352 if (strncasecmp(ptr, needle, strlen(needle)) != 0)
355 for (ptr += strlen(needle); ptr < end; ptr++) {
378 head =
CreateTest(&initialTestParams, test_num++);
382 file = fopen(scriptName,
"r");
384 ERR(
"fopen() failed");
396 if (sscanf(linebuf,
"%s", empty) == -1)
399 if (sscanf(linebuf,
" #%s", empty) == 1)
412 }
else if (runflag) {
426 if (fclose(file) != 0)
427 ERR(
"fclose() of script file failed");
445 char * testscripts =
NULL;
447 char * buffer_type =
"";
448 char * memoryPerNode =
NULL;
455 sprintf(apiStr,
"API for I/O [%s]", APIs);
461 {
'B',
NULL,
"useO_DIRECT -- uses O_DIRECT for POSIX, bypassing I/O buffers",
OPTION_FLAG,
'd', & initialTestParams.
useO_DIRECT},
463 {
'C',
NULL,
"reorderTasks -- changes task ordering to n+1 ordering for readback",
OPTION_FLAG,
'd', & initialTestParams.
reorderTasks},
466 {.help=
" -O stoneWallingWearOut=1 -- once the stonewalling timout is over, all process finish to access the amount of data", .arg =
OPTION_OPTIONAL_ARGUMENT},
467 {.help=
" -O stoneWallingWearOutIterations=N -- stop after processing this number of iterations, needed for reading data back written with stoneWallingWearOut", .arg =
OPTION_OPTIONAL_ARGUMENT},
468 {.help=
" -O stoneWallingStatusFile=FILE -- this file keeps the number of iterations from stonewalling during write and allows to use them for read", .arg =
OPTION_OPTIONAL_ARGUMENT},
469 {
'e',
NULL,
"fsync -- perform sync operation after each block write",
OPTION_FLAG,
'd', & initialTestParams.
fsync},
484 {
'k',
NULL,
"keepFile -- don't remove the test file(s) on program exit",
OPTION_FLAG,
'd', & initialTestParams.
keepFile},
486 {
'l',
NULL,
"datapacket type-- type of packet that will be created [offset|incompressible|timestamp|o|i|t]",
OPTION_OPTIONAL_ARGUMENT,
's', & buffer_type},
487 {
'm',
NULL,
"multiFile -- use number of reps (-i) for multiple file count",
OPTION_FLAG,
'd', & initialTestParams.
multiFile},
489 {
'n',
NULL,
"noFill -- no fill in HDF5 file creation",
OPTION_FLAG,
'd', & initialTestParams.
noFill},
498 {
'R',
NULL,
"checkRead -- verify that the output of read matches the expected signature (used with -G)",
OPTION_FLAG,
'd', & initialTestParams.
checkRead},
503 {
'u',
NULL,
"uniqueDir -- use unique directory name for each file-per-process",
OPTION_FLAG,
'd', & initialTestParams.
uniqueDir},
505 {
'v',
NULL,
"verbose -- output information (repeating flag increases level)",
OPTION_FLAG,
'd', & initialTestParams.
verbose},
511 {
'Y',
NULL,
"fsyncPerWrite -- perform sync operation after every write operation",
OPTION_FLAG,
'd', & initialTestParams.
fsyncPerWrite},
512 {
'z',
NULL,
"randomOffset -- access is to random, not sequential, offsets within a file",
OPTION_FLAG,
'd', & initialTestParams.
randomOffset},
515 {.help=
" -O summaryFormat=[default,JSON,CSV] -- use the format for outputing the summary", .arg =
OPTION_OPTIONAL_ARGUMENT},
529 if (buffer_type[0] != 0){
530 switch(buffer_type[0]) {
543 "Unknown arguement for -l %s; generic assumed\n", buffer_type);
IOR_offset_t setAlignment
int reorderTasksRandomSeed
static void CheckRunSettings(IOR_test_t *tests)
unsigned int incompressibleSeed
IOR_offset_t segmentCount
int contains_only(char *haystack, char *needle)
enum OutputFormat_t outputFormat
IOR_offset_t transferSize
IOR_param_t initialTestParams
int setTimeStampSignature
void aiori_supported_apis(char *APIs)
char * stoneWallingStatusFile
const ior_aiori_t * aiori_select(const char *api)
void DecodeDirective(char *line, IOR_param_t *params)
static size_t NodeMemoryStringToBytes(char *size_str)
#define MPI_CHECK(MPI_STATUS, MSG)
static option_help options[]
static const ior_aiori_t * backend
IOR_test_t * CreateTest(IOR_param_t *init_params, int test_num)
enum PACKET_TYPE dataPacketType
void init_IOR_Param_t(IOR_param_t *p)
int64_t string_to_bytes(char *size_str)
uint64_t stoneWallingWearOutIterations
static void decodeDirectiveWrapper(char *line)
IOR_test_t * ReadConfigScript(char *scriptName)
void ParseLine(char *line, IOR_param_t *test)
static IOR_param_t * parameters
IOR_test_t * ParseCommandLine(int argc, char **argv)
int deadlineForStonewalling
void airoi_parse_options(int argc, char **argv, option_help *global_options)
void AllocResults(IOR_test_t *test)