From 07ca5247d7255d50fa2ec9730e56cf3e4df81799 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Wed, 27 Mar 2019 20:37:46 +0000 Subject: [PATCH] Checked proper IOR behavior for -f option. --- src/aiori-POSIX.c | 5 +++-- src/option.c | 16 +++++----------- src/parse_options.c | 9 ++++++--- testing/test_comments.ior | 2 ++ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/aiori-POSIX.c b/src/aiori-POSIX.c index 1d41c64..a446459 100755 --- a/src/aiori-POSIX.c +++ b/src/aiori-POSIX.c @@ -304,8 +304,9 @@ void *POSIX_Create(char *testFileName, IOR_param_t * param) if (fd == NULL) ERR("Unable to malloc file descriptor"); posix_options_t * o = (posix_options_t*) param->backend_options; - if (o->direct_io == TRUE) - set_o_direct_flag(&fd_oflag); + if (o->direct_io == TRUE){ + set_o_direct_flag(&fd_oflag); + } if(param->dryRun) return 0; diff --git a/src/option.c b/src/option.c index 08833da..f940cee 100644 --- a/src/option.c +++ b/src/option.c @@ -221,7 +221,6 @@ void option_print_current(option_help * args){ } static void option_parse_token(char ** argv, int * flag_parsed_next, int * requiredArgsSeen, options_all_t * opt_all, int * error, int * print_help){ - int foundOption = 0; char * txt = argv[0]; char * arg = strstr(txt, "="); int replaced_equal = 0; @@ -243,8 +242,6 @@ static void option_parse_token(char ** argv, int * flag_parsed_next, int * requi continue; } if ( (txt[0] == '-' && o->shortVar == txt[1]) || (strlen(txt) > 2 && txt[0] == '-' && txt[1] == '-' && o->longVar != NULL && strcmp(txt + 2, o->longVar) == 0)){ - foundOption = 1; - // now process the option. switch(o->arg){ case (OPTION_FLAG):{ @@ -324,18 +321,15 @@ static void option_parse_token(char ** argv, int * flag_parsed_next, int * requi (*requiredArgsSeen)++; } - break; + return; } } } - - if (! foundOption){ - if(strcmp(txt, "-h") == 0 || strcmp(txt, "--help") == 0){ - *print_help = 1; - }else{ - *error = 1; - } + if(strcmp(txt, "-h") == 0 || strcmp(txt, "--help") == 0){ + *print_help = 1; + }else{ + *error = 1; } } diff --git a/src/parse_options.c b/src/parse_options.c index f92e239..dd6e68b 100755 --- a/src/parse_options.c +++ b/src/parse_options.c @@ -111,8 +111,6 @@ void DecodeDirective(char *line, IOR_param_t *params, options_all_t * module_opt fprintf(out_logfile, "Could not load backend API %s\n", params->api); exit(-1); } - /* copy the actual module options into the test */ - params->backend_options = airoi_update_module_options(params->backend, global_options); } else if (strcasecmp(option, "summaryFile") == 0) { if (rank == 0){ out_resultfile = fopen(value, "w"); @@ -411,6 +409,8 @@ IOR_test_t *ReadConfigScript(char *scriptName) create duplicate test */ tail->next = CreateTest(&tail->params, test_num++); AllocResults(tail); + ((IOR_test_t*) tail)->params.backend_options = airoi_update_module_options(((IOR_test_t*) tail)->params.backend, global_options); + tail = tail->next; *option_p = createGlobalOptions(& ((IOR_test_t*) tail->next)->params); } @@ -422,6 +422,8 @@ IOR_test_t *ReadConfigScript(char *scriptName) tail->next = CreateTest(&tail->params, test_num++); *option_p = createGlobalOptions(& ((IOR_test_t*) tail->next)->params); AllocResults(tail); + ((IOR_test_t*) tail)->params.backend_options = airoi_update_module_options(((IOR_test_t*) tail)->params.backend, global_options); + tail = tail->next; ParseLine(ptr, &tail->params, global_options); } else { @@ -432,7 +434,8 @@ IOR_test_t *ReadConfigScript(char *scriptName) /* close the script */ if (fclose(file) != 0) ERR("fclose() of script file failed"); - AllocResults(tail); + AllocResults(tail); /* copy the actual module options into the test */ + ((IOR_test_t*) tail)->params.backend_options = airoi_update_module_options(((IOR_test_t*) tail)->params.backend, global_options); return head; } diff --git a/testing/test_comments.ior b/testing/test_comments.ior index b48b36f..bd2efa8 100644 --- a/testing/test_comments.ior +++ b/testing/test_comments.ior @@ -14,4 +14,6 @@ transferSize=100k blockSize=100k # space-prefixed comment run +--dummy.delay-create=1000 +api=dummy ior stop