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");
80 rc = sscanf(line,
" %[^=# \t\r\n] = %[^# \t\r\n] ", option, value);
81 if (rc != 2 &&
rank == 0) {
82 fprintf(
out_logfile,
"Syntax error in configuration options: %s\n",
84 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
86 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
90 if (strcasecmp(option,
"api") == 0) {
91 params->
api = strdup(value);
95 fprintf(
out_logfile,
"Could not load backend API %s\n", params->
api);
98 }
else if (strcasecmp(option,
"summaryFile") == 0) {
102 FAIL(
"Cannot open output file for writes!");
104 printf(
"Writing output to %s\n", value);
106 }
else if (strcasecmp(option,
"saveRankPerformanceDetailsCSV") == 0){
109 FILE* fd = fopen(value,
"w");
111 FAIL(
"Cannot open saveRankPerformanceDetailsCSV file for write!");
113 char buff[] =
"access,rank,runtime-with-openclose,runtime,throughput-withopenclose,throughput\n";
114 int ret = fwrite(buff, strlen(buff), 1, fd);
116 FAIL(
"Cannot write header to saveRankPerformanceDetailsCSV file");
121 }
else if (strcasecmp(option,
"summaryFormat") == 0) {
122 if(strcasecmp(value,
"default") == 0){
124 }
else if(strcasecmp(value,
"JSON") == 0){
126 }
else if(strcasecmp(value,
"CSV") == 0){
129 FAIL(
"Unknown summaryFormat");
131 }
else if (strcasecmp(option,
"refnum") == 0) {
133 }
else if (strcasecmp(option,
"debug") == 0) {
134 params->
debug = strdup(value);
135 }
else if (strcasecmp(option,
"platform") == 0) {
137 }
else if (strcasecmp(option,
"testfile") == 0) {
139 }
else if (strcasecmp(option,
"dualmount") == 0){
141 }
else if (strcasecmp(option,
"allocateBufferOnGPU") == 0) {
143 }
else if (strcasecmp(option,
"GPUid") == 0) {
144 params->
gpuID = atoi(value);
145 }
else if (strcasecmp(option,
"GPUDirect") == 0) {
147 }
else if (strcasecmp(option,
"deadlineforstonewalling") == 0) {
149 }
else if (strcasecmp(option,
"stoneWallingWearOut") == 0) {
151 }
else if (strcasecmp(option,
"stoneWallingWearOutIterations") == 0) {
153 }
else if (strcasecmp(option,
"stoneWallingStatusFile") == 0) {
155 }
else if (strcasecmp(option,
"maxtimeduration") == 0) {
157 }
else if (strcasecmp(option,
"mintimeduration") == 0) {
159 }
else if (strcasecmp(option,
"outlierthreshold") == 0) {
161 }
else if (strcasecmp(option,
"numnodes") == 0) {
163 }
else if (strcasecmp(option,
"numtasks") == 0) {
165 }
else if (strcasecmp(option,
"numtasksonnode0") == 0) {
167 }
else if (strcasecmp(option,
"repetitions") == 0) {
169 }
else if (strcasecmp(option,
"intertestdelay") == 0) {
171 }
else if (strcasecmp(option,
"interiodelay") == 0) {
173 }
else if (strcasecmp(option,
"readfile") == 0) {
175 }
else if (strcasecmp(option,
"writefile") == 0) {
177 }
else if (strcasecmp(option,
"fileperproc") == 0) {
179 }
else if (strcasecmp(option,
"taskpernodeoffset") == 0) {
181 }
else if (strcasecmp(option,
"reordertasksconstant") == 0) {
183 }
else if (strcasecmp(option,
"reordertasksrandom") == 0) {
185 }
else if (strcasecmp(option,
"reordertasksrandomSeed") == 0) {
187 }
else if (strcasecmp(option,
"reordertasks") == 0) {
191 }
else if (strcasecmp(option,
"checkwrite") == 0) {
193 }
else if (strcasecmp(option,
"checkread") == 0) {
195 }
else if (strcasecmp(option,
"keepfile") == 0) {
197 }
else if (strcasecmp(option,
"keepfilewitherror") == 0) {
199 }
else if (strcasecmp(option,
"multiFile") == 0) {
201 }
else if (strcasecmp(option,
"warningAsErrors") == 0) {
203 }
else if (strcasecmp(option,
"segmentcount") == 0) {
205 }
else if (strcasecmp(option,
"blocksize") == 0) {
207 }
else if (strcasecmp(option,
"transfersize") == 0) {
209 }
else if (strcasecmp(option,
"singlexferattempt") == 0) {
211 }
else if (strcasecmp(option,
"intraTestBarriers") == 0) {
213 }
else if (strcasecmp(option,
"verbose") == 0) {
215 }
else if (strcasecmp(option,
"collective") == 0) {
217 }
else if (strcasecmp(option,
"settimestampsignature") == 0) {
219 }
else if (strcasecmp(option,
"dataPacketType") == 0) {
221 }
else if (strcasecmp(option,
"uniqueDir") == 0) {
223 }
else if (strcasecmp(option,
"useexistingtestfile") == 0) {
225 }
else if (strcasecmp(option,
"fsyncperwrite") == 0) {
227 }
else if (strcasecmp(option,
"fsync") == 0) {
228 params->
fsync = atoi(value);
229 }
else if (strcasecmp(option,
"randomoffset") == 0) {
231 }
else if (strcasecmp(option,
"memoryPerTask") == 0) {
234 }
else if (strcasecmp(option,
"memoryPerNode") == 0) {
237 }
else if (strcasecmp(option,
"summaryalways") == 0) {
241 if (strcasecmp(option,
"useo_direct") == 0) {
242 strcpy(option,
"--posix.odirect");
247 fprintf(
out_logfile,
"Unrecognized parameter \"%s\"\n",
249 MPI_CHECK(MPI_Initialized(&initialized),
"MPI_Initialized() error");
251 MPI_CHECK(MPI_Abort(MPI_COMM_WORLD, -1),
"MPI_Abort() error");
266 char * newline = strdup(line);
269 end = strchr(start,
'#');
274 end = strchr(start,
',');
278 if(strlen(start) < 3){
279 fprintf(
out_logfile,
"Invalid option substring string: \"%s\" in \"%s\"\n", start, line);
284 }
while (end !=
NULL);
290 ParseLine(line, parameters, global_options);
301 end = haystack + strlen(haystack);
303 for (ptr = haystack; ptr < end; ptr++) {
308 if (strncasecmp(ptr, needle, strlen(needle)) != 0)
311 for (ptr += strlen(needle); ptr < end; ptr++) {
337 head =
CreateTest(& initialTestParams, test_num++);
342 file = fopen(scriptName,
"r");
344 ERR(
"fopen() failed");
357 while (isspace(*ptr))
361 if (sscanf(ptr,
"%s", empty) == -1)
365 if (sscanf(ptr,
" #%c", empty) == 1)
382 }
else if (runflag) {
399 if (fclose(file) != 0)
400 ERR(
"fclose() of script file failed");
410 char APIs_legacy[1024];
413 sprintf(apiStr,
"API for I/O [%s]", APIs);
420 {
'C',
NULL,
"reorderTasks -- changes task ordering for readback (useful to avoid client cache)",
OPTION_FLAG,
'd', & params->
reorderTasks},
423 {.help=
" -O stoneWallingWearOut=1 -- once the stonewalling timeout is over, all process finish to access the amount of data", .arg =
OPTION_OPTIONAL_ARGUMENT},
424 {.help=
" -O stoneWallingWearOutIterations=N -- stop after processing this number of iterations, needed for reading data back written with stoneWallingWearOut", .arg =
OPTION_OPTIONAL_ARGUMENT},
425 {.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},
426 {.help=
" -O minTimeDuration=0 -- minimum Runtime for the run (will repeat from beginning of the file if time is not yet over)", .arg =
OPTION_OPTIONAL_ARGUMENT},
428 {.help=
" -O allocateBufferOnGPU=X -- allocate I/O buffers on the GPU: X=1 uses managed memory - verifications are run on CPU; X=2 managed memory - verifications on GPU; X=3 device memory with verifications on GPU.", .arg =
OPTION_OPTIONAL_ARGUMENT},
429 {.help=
" -O GPUid=X -- select the GPU to use, use -1 for round-robin among local procs.", .arg =
OPTION_OPTIONAL_ARGUMENT},
430 #ifdef HAVE_GPU_DIRECT 431 {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},
434 {
'e',
NULL,
"fsync -- perform a fsync() operation at the end of each read/write phase",
OPTION_FLAG,
'd', & params->
fsync},
446 {
'k',
NULL,
"keepFile -- don't remove the test file(s) on program exit",
OPTION_FLAG,
'd', & params->
keepFile},
448 {
'l',
"dataPacketType",
"datapacket type-- type of packet that will be created [offset|incompressible|timestamp|random|o|i|t|r]",
OPTION_OPTIONAL_ARGUMENT,
's', & params->
buffer_type},
456 {
'R',
NULL,
"checkRead -- verify that the output of read matches the expected signature (used with -G)",
OPTION_FLAG,
'd', & params->
checkRead},
460 {
'u',
NULL,
"uniqueDir -- use unique directory name for each file-per-process",
OPTION_FLAG,
'd', & params->
uniqueDir},
461 {
'v',
NULL,
"verbose -- output information (repeating flag increases level)",
OPTION_FLAG,
'd', & params->
verbose},
468 {
'z',
NULL,
"randomOffset -- access is to random, not sequential, offsets within a file",
OPTION_FLAG,
'd', & params->
randomOffset},
474 {.help=
" -O summaryFormat=[default,JSON,CSV] -- use the format for outputting the summary", .arg =
OPTION_OPTIONAL_ARGUMENT},
475 {.help=
" -O saveRankPerformanceDetailsCSV=<FILE> -- store the performance of each rank into the named CSV file.", .arg =
OPTION_OPTIONAL_ARGUMENT},
476 {0,
"dryRun",
"do not perform any I/Os just run evtl. inputs print dummy output",
OPTION_FLAG,
'd', & params->
dryRun},
480 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)
ior_dataPacketType_e dataPacketType
ior_dataPacketType_e parsePacketType(char t)
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)