24 #if defined(HAVE_STRINGS_H) 35 #define ISPOWEROFTWO(x) ((x != 0) && !(x & (x - 1))) 54 for (ptr = tests; ptr !=
NULL; ptr = ptr->
next) {
96 rc = sscanf(line,
" %[^=# \t\r\n] = %[^# \t\r\n] ", option, value);
97 if (rc != 2 &&
rank == 0) {
98 fprintf(
out_logfile,
"Syntax error in configuration options: %s\n",
100 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
102 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
106 if (strcasecmp(option,
"api") == 0) {
107 params->
api = strdup(value);
111 fprintf(
out_logfile,
"Could not load backend API %s\n", params->
api);
114 }
else if (strcasecmp(option,
"summaryFile") == 0) {
118 FAIL(
"Cannot open output file for writes!");
120 printf(
"Writing output to %s\n", value);
122 }
else if (strcasecmp(option,
"summaryFormat") == 0) {
123 if(strcasecmp(value,
"default") == 0){
125 }
else if(strcasecmp(value,
"JSON") == 0){
127 }
else if(strcasecmp(value,
"CSV") == 0){
130 FAIL(
"Unknown summaryFormat");
132 }
else if (strcasecmp(option,
"refnum") == 0) {
134 }
else if (strcasecmp(option,
"debug") == 0) {
135 params->
debug = strdup(value);
136 }
else if (strcasecmp(option,
"platform") == 0) {
138 }
else if (strcasecmp(option,
"testfile") == 0) {
140 }
else if (strcasecmp(option,
"hintsfilename") == 0) {
142 }
else if (strcasecmp(option,
"deadlineforstonewalling") == 0) {
144 }
else if (strcasecmp(option,
"stoneWallingWearOut") == 0) {
146 }
else if (strcasecmp(option,
"stoneWallingWearOutIterations") == 0) {
148 }
else if (strcasecmp(option,
"stoneWallingStatusFile") == 0) {
150 }
else if (strcasecmp(option,
"maxtimeduration") == 0) {
152 }
else if (strcasecmp(option,
"outlierthreshold") == 0) {
154 }
else if (strcasecmp(option,
"numnodes") == 0) {
156 }
else if (strcasecmp(option,
"numtasks") == 0) {
158 }
else if (strcasecmp(option,
"numtasksonnode0") == 0) {
160 }
else if (strcasecmp(option,
"repetitions") == 0) {
162 }
else if (strcasecmp(option,
"intertestdelay") == 0) {
164 }
else if (strcasecmp(option,
"interiodelay") == 0) {
166 }
else if (strcasecmp(option,
"readfile") == 0) {
168 }
else if (strcasecmp(option,
"writefile") == 0) {
170 }
else if (strcasecmp(option,
"fileperproc") == 0) {
172 }
else if (strcasecmp(option,
"taskpernodeoffset") == 0) {
174 }
else if (strcasecmp(option,
"reordertasksconstant") == 0) {
176 }
else if (strcasecmp(option,
"reordertasksrandom") == 0) {
178 }
else if (strcasecmp(option,
"reordertasksrandomSeed") == 0) {
180 }
else if (strcasecmp(option,
"reordertasks") == 0) {
184 }
else if (strcasecmp(option,
"checkwrite") == 0) {
186 }
else if (strcasecmp(option,
"checkread") == 0) {
188 }
else if (strcasecmp(option,
"keepfile") == 0) {
190 }
else if (strcasecmp(option,
"keepfilewitherror") == 0) {
192 }
else if (strcasecmp(option,
"multiFile") == 0) {
194 }
else if (strcasecmp(option,
"quitonerror") == 0) {
196 }
else if (strcasecmp(option,
"segmentcount") == 0) {
198 }
else if (strcasecmp(option,
"blocksize") == 0) {
200 }
else if (strcasecmp(option,
"transfersize") == 0) {
202 }
else if (strcasecmp(option,
"setalignment") == 0) {
204 }
else if (strcasecmp(option,
"singlexferattempt") == 0) {
206 }
else if (strcasecmp(option,
"individualdatasets") == 0) {
208 }
else if (strcasecmp(option,
"intraTestBarriers") == 0) {
210 }
else if (strcasecmp(option,
"nofill") == 0) {
211 params->
noFill = atoi(value);
212 }
else if (strcasecmp(option,
"verbose") == 0) {
214 }
else if (strcasecmp(option,
"settimestampsignature") == 0) {
216 }
else if (strcasecmp(option,
"collective") == 0) {
218 }
else if (strcasecmp(option,
"preallocate") == 0) {
220 }
else if (strcasecmp(option,
"storefileoffset") == 0) {
222 }
else if (strcasecmp(option,
"usefileview") == 0) {
224 }
else if (strcasecmp(option,
"usesharedfilepointer") == 0) {
226 }
else if (strcasecmp(option,
"usestrideddatatype") == 0) {
228 }
else if (strcasecmp(option,
"showhints") == 0) {
230 }
else if (strcasecmp(option,
"uniqueDir") == 0) {
232 }
else if (strcasecmp(option,
"useexistingtestfile") == 0) {
234 }
else if (strcasecmp(option,
"fsyncperwrite") == 0) {
236 }
else if (strcasecmp(option,
"fsync") == 0) {
237 params->
fsync = atoi(value);
238 }
else if (strcasecmp(option,
"randomoffset") == 0) {
240 }
else if (strcasecmp(option,
"memoryPerTask") == 0) {
243 }
else if (strcasecmp(option,
"memoryPerNode") == 0) {
246 }
else if (strcasecmp(option,
"lustrestripecount") == 0) {
247 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 248 ERR(
"ior was not compiled with Lustre support");
252 }
else if (strcasecmp(option,
"lustrestripesize") == 0) {
253 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 254 ERR(
"ior was not compiled with Lustre support");
258 }
else if (strcasecmp(option,
"lustrestartost") == 0) {
259 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 260 ERR(
"ior was not compiled with Lustre support");
264 }
else if (strcasecmp(option,
"lustreignorelocks") == 0) {
265 #ifndef HAVE_LUSTRE_LUSTRE_USER_H 266 ERR(
"ior was not compiled with Lustre support");
269 }
else if (strcasecmp(option,
"gpfshintaccess") == 0) {
270 #ifndef HAVE_GPFS_FCNTL_H 271 ERR(
"ior was not compiled with GPFS hint support");
274 }
else if (strcasecmp(option,
"gpfsreleasetoken") == 0) {
275 #ifndef HAVE_GPFS_FCNTL_H 276 ERR(
"ior was not compiled with GPFS hint support");
279 }
else if (strcasecmp(option,
"beegfsNumTargets") == 0) {
280 #ifndef HAVE_BEEGFS_BEEGFS_H 281 ERR(
"ior was not compiled with BeeGFS support");
285 ERR(
"beegfsNumTargets must be >= 1");
286 }
else if (strcasecmp(option,
"beegfsChunkSize") == 0) {
287 #ifndef HAVE_BEEGFS_BEEGFS_H 288 ERR(
"ior was not compiled with BeeGFS support");
292 ERR(
"beegfsChunkSize must be a power of two and >64k");
293 }
else if (strcasecmp(option,
"summaryalways") == 0) {
297 if (strcasecmp(option,
"useo_direct") == 0) {
298 strcpy(option,
"--posix.odirect");
303 fprintf(
out_logfile,
"Unrecognized parameter \"%s\"\n",
305 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
307 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
322 char * newline = strdup(line);
325 end = strchr(start,
'#');
330 end = strchr(start,
',');
334 if(strlen(start) < 3){
335 fprintf(
out_logfile,
"Invalid option substring string: \"%s\" in \"%s\"\n", start, line);
340 }
while (end !=
NULL);
346 ParseLine(line, parameters, global_options);
357 end = haystack + strlen(haystack);
359 for (ptr = haystack; ptr < end; ptr++) {
364 if (strncasecmp(ptr, needle, strlen(needle)) != 0)
367 for (ptr += strlen(needle); ptr < end; ptr++) {
393 head =
CreateTest(& initialTestParams, test_num++);
398 file = fopen(scriptName,
"r");
400 ERR(
"fopen() failed");
413 while (isspace(*ptr))
417 if (sscanf(ptr,
"%s", empty) == -1)
421 if (sscanf(ptr,
" #%s", empty) == 1)
438 }
else if (runflag) {
455 if (fclose(file) != 0)
456 ERR(
"fclose() of script file failed");
466 char APIs_legacy[1024];
469 sprintf(apiStr,
"API for I/O [%s]", APIs);
476 {
'C',
NULL,
"reorderTasks -- changes task ordering for readback (useful to avoid client cache)",
OPTION_FLAG,
'd', & params->
reorderTasks},
479 {.help=
" -O stoneWallingWearOut=1 -- once the stonewalling timout is over, all process finish to access the amount of data", .arg =
OPTION_OPTIONAL_ARGUMENT},
480 {.help=
" -O stoneWallingWearOutIterations=N -- stop after processing this number of iterations, needed for reading data back written with stoneWallingWearOut", .arg =
OPTION_OPTIONAL_ARGUMENT},
481 {.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},
482 {
'e',
NULL,
"fsync -- perform a fsync() operation at the end of each read/write phase",
OPTION_FLAG,
'd', & params->
fsync},
497 {
'k',
NULL,
"keepFile -- don't remove the test file(s) on program exit",
OPTION_FLAG,
'd', & params->
keepFile},
511 {
'R',
NULL,
"checkRead -- verify that the output of read matches the expected signature (used with -G)",
OPTION_FLAG,
'd', & params->
checkRead},
516 {
'u',
NULL,
"uniqueDir -- use unique directory name for each file-per-process",
OPTION_FLAG,
'd', & params->
uniqueDir},
518 {
'v',
NULL,
"verbose -- output information (repeating flag increases level)",
OPTION_FLAG,
'd', & params->
verbose},
525 {
'z',
NULL,
"randomOffset -- access is to random, not sequential, offsets within a file",
OPTION_FLAG,
'd', & params->
randomOffset},
528 {.help=
" -O summaryFormat=[default,JSON,CSV] -- use the format for outputing the summary", .arg =
OPTION_OPTIONAL_ARGUMENT},
529 {0,
"dryRun",
"do not perform any I/Os just run evtl. inputs print dummy output",
OPTION_FLAG,
'd', & params->
dryRun},
533 memcpy(options, & o,
sizeof(o));
IOR_offset_t setAlignment
int reorderTasksRandomSeed
static void CheckRunSettings(IOR_test_t *tests)
void * airoi_update_module_options(const ior_aiori_t *backend, options_all_t *opt)
int option_parse(int argc, char **argv, options_all_t *opt_all)
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
char * stoneWallingStatusFile
option_help * createGlobalOptions(IOR_param_t *params)
const ior_aiori_t * aiori_select(const char *api)
static option_help options[]
#define MPI_CHECK(MPI_STATUS, MSG)
void updateParsedOptions(IOR_param_t *options, options_all_t *global_options)
options_all_t * airoi_create_all_module_options(option_help *global_options)
int option_parse_key_value(char *key, char *val, options_all_t *opt_all)
void aiori_supported_apis(char *APIs, char *APIs_legacy, enum bench_type type)
IOR_test_t * CreateTest(IOR_param_t *init_params, int test_num)
void ParseLine(char *line, IOR_param_t *test, options_all_t *module_options)
void init_IOR_Param_t(IOR_param_t *p)
static options_all_t * global_options
int64_t string_to_bytes(char *size_str)
void DecodeDirective(char *line, IOR_param_t *params, options_all_t *module_options)
uint64_t stoneWallingWearOutIterations
static void decodeDirectiveWrapper(char *line)
IOR_test_t * ReadConfigScript(char *scriptName)
const struct ior_aiori * backend
static IOR_param_t * parameters
IOR_test_t * ParseCommandLine(int argc, char **argv)
int deadlineForStonewalling
size_t NodeMemoryStringToBytes(char *size_str)
static struct cephfs_options o
void AllocResults(IOR_test_t *test)