24 #if defined(HAVE_STRINGS_H) 52 for (ptr = tests; ptr !=
NULL; ptr = ptr->
next) {
65 ERR(
"Dual Mount can only be used with File Per Process");
70 ERR(
"GPUDirect cannot be used with managed memory");
74 ERR(
"GPUDirect data cannot yet be checked");
90 rc = sscanf(line,
" %[^=# \t\r\n] = %[^# \t\r\n] ", option, value);
91 if (rc != 2 &&
rank == 0) {
92 fprintf(
out_logfile,
"Syntax error in configuration options: %s\n",
94 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
96 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
100 if (strcasecmp(option,
"api") == 0) {
101 params->
api = strdup(value);
105 fprintf(
out_logfile,
"Could not load backend API %s\n", params->
api);
108 }
else if (strcasecmp(option,
"summaryFile") == 0) {
112 FAIL(
"Cannot open output file for writes!");
114 printf(
"Writing output to %s\n", value);
116 }
else if (strcasecmp(option,
"saveRankPerformanceDetailsCSV") == 0){
119 FILE* fd = fopen(value,
"w");
121 FAIL(
"Cannot open saveRankPerformanceDetailsCSV file for write!");
123 char buff[] =
"access,rank,runtime-with-openclose,runtime,throughput-withopenclose,throughput\n";
124 int ret = fwrite(buff, strlen(buff), 1, fd);
126 FAIL(
"Cannot write header to saveRankPerformanceDetailsCSV file");
131 }
else if (strcasecmp(option,
"summaryFormat") == 0) {
132 if(strcasecmp(value,
"default") == 0){
134 }
else if(strcasecmp(value,
"JSON") == 0){
136 }
else if(strcasecmp(value,
"CSV") == 0){
139 FAIL(
"Unknown summaryFormat");
141 }
else if (strcasecmp(option,
"refnum") == 0) {
143 }
else if (strcasecmp(option,
"debug") == 0) {
144 params->
debug = strdup(value);
145 }
else if (strcasecmp(option,
"platform") == 0) {
147 }
else if (strcasecmp(option,
"testfile") == 0) {
149 }
else if (strcasecmp(option,
"dualmount") == 0){
151 }
else if (strcasecmp(option,
"allocateBufferOnGPU") == 0) {
153 }
else if (strcasecmp(option,
"GPUid") == 0) {
154 params->
gpuID = atoi(value);
155 }
else if (strcasecmp(option,
"GPUDirect") == 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,
"numnodes") == 0) {
171 }
else if (strcasecmp(option,
"numtasks") == 0) {
173 }
else if (strcasecmp(option,
"numtasksonnode0") == 0) {
175 }
else if (strcasecmp(option,
"repetitions") == 0) {
177 }
else if (strcasecmp(option,
"intertestdelay") == 0) {
179 }
else if (strcasecmp(option,
"interiodelay") == 0) {
181 }
else if (strcasecmp(option,
"readfile") == 0) {
183 }
else if (strcasecmp(option,
"writefile") == 0) {
185 }
else if (strcasecmp(option,
"fileperproc") == 0) {
187 }
else if (strcasecmp(option,
"taskpernodeoffset") == 0) {
189 }
else if (strcasecmp(option,
"reordertasksconstant") == 0) {
191 }
else if (strcasecmp(option,
"reordertasksrandom") == 0) {
193 }
else if (strcasecmp(option,
"reordertasksrandomSeed") == 0) {
195 }
else if (strcasecmp(option,
"reordertasks") == 0) {
199 }
else if (strcasecmp(option,
"checkwrite") == 0) {
201 }
else if (strcasecmp(option,
"checkread") == 0) {
203 }
else if (strcasecmp(option,
"keepfile") == 0) {
205 }
else if (strcasecmp(option,
"keepfilewitherror") == 0) {
207 }
else if (strcasecmp(option,
"multiFile") == 0) {
209 }
else if (strcasecmp(option,
"warningAsErrors") == 0) {
211 }
else if (strcasecmp(option,
"segmentcount") == 0) {
213 }
else if (strcasecmp(option,
"blocksize") == 0) {
215 }
else if (strcasecmp(option,
"transfersize") == 0) {
217 }
else if (strcasecmp(option,
"singlexferattempt") == 0) {
219 }
else if (strcasecmp(option,
"intraTestBarriers") == 0) {
221 }
else if (strcasecmp(option,
"verbose") == 0) {
223 }
else if (strcasecmp(option,
"settimestampsignature") == 0) {
225 }
else if (strcasecmp(option,
"storefileoffset") == 0) {
227 }
else if (strcasecmp(option,
"uniqueDir") == 0) {
229 }
else if (strcasecmp(option,
"useexistingtestfile") == 0) {
231 }
else if (strcasecmp(option,
"fsyncperwrite") == 0) {
233 }
else if (strcasecmp(option,
"fsync") == 0) {
234 params->
fsync = atoi(value);
235 }
else if (strcasecmp(option,
"randomoffset") == 0) {
237 }
else if (strcasecmp(option,
"memoryPerTask") == 0) {
240 }
else if (strcasecmp(option,
"memoryPerNode") == 0) {
243 }
else if (strcasecmp(option,
"summaryalways") == 0) {
247 if (strcasecmp(option,
"useo_direct") == 0) {
248 strcpy(option,
"--posix.odirect");
253 fprintf(
out_logfile,
"Unrecognized parameter \"%s\"\n",
255 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
257 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
272 char * newline = strdup(line);
275 end = strchr(start,
'#');
280 end = strchr(start,
',');
284 if(strlen(start) < 3){
285 fprintf(
out_logfile,
"Invalid option substring string: \"%s\" in \"%s\"\n", start, line);
290 }
while (end !=
NULL);
296 ParseLine(line, parameters, global_options);
307 end = haystack + strlen(haystack);
309 for (ptr = haystack; ptr < end; ptr++) {
314 if (strncasecmp(ptr, needle, strlen(needle)) != 0)
317 for (ptr += strlen(needle); ptr < end; ptr++) {
343 head =
CreateTest(& initialTestParams, test_num++);
348 file = fopen(scriptName,
"r");
350 ERR(
"fopen() failed");
363 while (isspace(*ptr))
367 if (sscanf(ptr,
"%s", empty) == -1)
371 if (sscanf(ptr,
" #%s", empty) == 1)
388 }
else if (runflag) {
405 if (fclose(file) != 0)
406 ERR(
"fclose() of script file failed");
416 char APIs_legacy[1024];
419 sprintf(apiStr,
"API for I/O [%s]", APIs);
426 {
'C',
NULL,
"reorderTasks -- changes task ordering for readback (useful to avoid client cache)",
OPTION_FLAG,
'd', & params->
reorderTasks},
429 {.help=
" -O stoneWallingWearOut=1 -- once the stonewalling timeout is over, all process finish to access the amount of data", .arg =
OPTION_OPTIONAL_ARGUMENT},
430 {.help=
" -O stoneWallingWearOutIterations=N -- stop after processing this number of iterations, needed for reading data back written with stoneWallingWearOut", .arg =
OPTION_OPTIONAL_ARGUMENT},
431 {.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},
433 {.help=
" -O allocateBufferOnGPU=X -- allocate I/O buffers on the GPU: X=1 uses managed memory, X=2 device memory.", .arg =
OPTION_OPTIONAL_ARGUMENT},
435 #ifdef HAVE_GPU_DIRECT 436 {0,
"gpuDirect",
"allocate I/O buffers on the GPU and use gpuDirect to store data; this option is incompatible with any option requiring CPU access to data.",
OPTION_FLAG,
'd', & params->
gpuDirect},
439 {
'e',
NULL,
"fsync -- perform a fsync() operation at the end of each read/write phase",
OPTION_FLAG,
'd', & params->
fsync},
451 {
'k',
NULL,
"keepFile -- don't remove the test file(s) on program exit",
OPTION_FLAG,
'd', & params->
keepFile},
461 {
'R',
NULL,
"checkRead -- verify that the output of read matches the expected signature (used with -G)",
OPTION_FLAG,
'd', & params->
checkRead},
465 {
'u',
NULL,
"uniqueDir -- use unique directory name for each file-per-process",
OPTION_FLAG,
'd', & params->
uniqueDir},
466 {
'v',
NULL,
"verbose -- output information (repeating flag increases level)",
OPTION_FLAG,
'd', & params->
verbose},
473 {
'z',
NULL,
"randomOffset -- access is to random, not sequential, offsets within a file",
OPTION_FLAG,
'd', & params->
randomOffset},
479 {.help=
" -O summaryFormat=[default,JSON,CSV] -- use the format for outputting the summary", .arg =
OPTION_OPTIONAL_ARGUMENT},
480 {.help=
" -O saveRankPerformanceDetailsCSV=<FILE> -- store the performance of each rank into the named CSV file.", .arg =
OPTION_OPTIONAL_ARGUMENT},
481 {0,
"dryRun",
"do not perform any I/Os just run evtl. inputs print dummy output",
OPTION_FLAG,
'd', & params->
dryRun},
485 memcpy(options, & o,
sizeof(o));
void init_IOR_Param_t(IOR_param_t *p, MPI_Comm com)
IOR_test_t * ParseCommandLine(int argc, char **argv, MPI_Comm com)
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)
struct benchmark_options o
IOR_offset_t segmentCount
int contains_only(char *haystack, char *needle)
enum OutputFormat_t outputFormat
IOR_offset_t transferSize
ior_memory_flags gpuMemoryFlags
static IOR_param_t initialTestParams
int setTimeStampSignature
#define MPI_CHECK(MPI_STATUS, MSG)
char * stoneWallingStatusFile
option_help * createGlobalOptions(IOR_param_t *params)
const ior_aiori_t * aiori_select(const char *api)
static option_help options[]
void updateParsedOptions(IOR_param_t *options, options_all_t *global_options)
char * saveRankDetailsCSV
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)
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_offset_t randomPrefillBlocksize
IOR_test_t * ReadConfigScript(char *scriptName)
const struct ior_aiori * backend
static IOR_param_t * parameters
int deadlineForStonewalling
size_t NodeMemoryStringToBytes(char *size_str)
void * safeMalloc(uint64_t size)
void AllocResults(IOR_test_t *test)