From c0657866fd183cfce85bf36ae99a2079e6c923fa Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sat, 14 Jul 2018 12:22:36 +0100 Subject: [PATCH] Minor fixes for stonewalling options. --- src/ior-output.c | 5 +++-- src/ior.c | 11 ++++++----- src/mdtest.c | 14 +++++++++++--- src/utilities.c | 4 +++- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/ior-output.c b/src/ior-output.c index 10a9a86..dcf0c3c 100644 --- a/src/ior-output.c +++ b/src/ior-output.c @@ -392,7 +392,7 @@ void ShowTestStart(IOR_param_t *test) void ShowTestEnd(IOR_test_t *tptr){ if(rank == 0 && tptr->params.stoneWallingWearOut){ - if (tptr->params.stoneWallingStatusFile[0]){ + if (tptr->params.stoneWallingStatusFile){ StoreStoneWallingIterations(tptr->params.stoneWallingStatusFile, tptr->results->pairs_accessed); }else{ fprintf(out_logfile, "Pairs deadlineForStonewallingaccessed: %lld\n", (long long) tptr->results->pairs_accessed); @@ -411,7 +411,8 @@ void ShowSetup(IOR_param_t *params) fprintf(out_logfile, "*** %s ***\n\n", params->debug); } PrintNamedSectionStart("Options"); - PrintKeyVal("api", params->apiVersion); + PrintKeyVal("api", params->api); + PrintKeyVal("apiVersion", params->apiVersion); PrintKeyVal("test filename", params->testFileName); PrintKeyVal("access", params->filePerProc ? "file-per-process" : "single-shared-file"); PrintKeyVal("type", params->collective == FALSE ? "independent" : "collective"); diff --git a/src/ior.c b/src/ior.c index e493d09..69edd43 100755 --- a/src/ior.c +++ b/src/ior.c @@ -1869,10 +1869,11 @@ static IOR_offset_t WriteOrRead(IOR_param_t * test, IOR_results_t * results, voi && ((GetTimeStamp() - startForStonewall) > test->deadlineForStonewalling)); - if(access == READ && test->stoneWallingStatusFile){ + if(test->stoneWallingStatusFile && (access == READ || access == READCHECK)){ test->stoneWallingWearOutIterations = ReadStoneWallingIterations(test->stoneWallingStatusFile); - if(test->stoneWallingWearOutIterations == -1){ - ERR("Could not read back the stonewalling status from the file!"); + if(test->stoneWallingWearOutIterations == -1 && rank == 0){ + fprintf(out_logfile, "WARNING: Could not read back the stonewalling status from the file!"); + test->stoneWallingWearOutIterations = 0; } } @@ -1881,8 +1882,8 @@ static IOR_offset_t WriteOrRead(IOR_param_t * test, IOR_results_t * results, voi dataMoved += WriteOrReadSingle(pairCnt, offsetArray, pretendRank, & transferCount, & errors, test, fd, ioBuffers, access); pairCnt++; - hitStonewall = ((test->deadlineForStonewalling != 0) - && ((GetTimeStamp() - startForStonewall) + hitStonewall = ((test->deadlineForStonewalling != 0 + && (GetTimeStamp() - startForStonewall) > test->deadlineForStonewalling)) || (test->stoneWallingWearOutIterations != 0 && pairCnt == test->stoneWallingWearOutIterations) ; } if (test->stoneWallingWearOut){ diff --git a/src/mdtest.c b/src/mdtest.c index 53250e2..2fe9be4 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -1107,10 +1107,18 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro } }else{ if (stoneWallingStatusFile){ + int64_t expected_items; /* The number of items depends on the stonewalling file */ - items = ReadStoneWallingIterations(stoneWallingStatusFile); - if (verbose >= 1 && rank == 0) { - printf("read stonewall file items: "LLU"\n", items); + expected_items = ReadStoneWallingIterations(stoneWallingStatusFile); + if(expected_items >= 0){ + items = expected_items; + } + if (rank == 0) { + if(expected_items == -1){ + fprintf(out_logfile, "WARNING: could not read stonewall status file\n"); + }else if(verbose >= 1){ + fprintf(out_logfile, "Read stonewall status; items: "LLU"\n", items); + } } } } diff --git a/src/utilities.c b/src/utilities.c index d0357a1..c4a259c 100755 --- a/src/utilities.c +++ b/src/utilities.c @@ -581,7 +581,9 @@ int64_t ReadStoneWallingIterations(char * const filename){ }else{ FILE * out = fopen(filename, "r"); if (out == NULL){ - return -1; + data = -1; + MPI_Bcast( & data, 1, MPI_LONG_LONG_INT, 0, mpi_comm_world); + return data; } int ret = fscanf(out, "%lld", & data); if (ret != 1){