From 6436165edbe70ab2535bd81a46a29a3ce04f11d3 Mon Sep 17 00:00:00 2001 From: Julian Kunkel Date: Wed, 29 Nov 2017 09:54:22 +0100 Subject: [PATCH 1/8] For debugging of issues: added IOR_FAKE_TASK_PER_NODES env variable to set tasksPerNode. --- src/ior.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ior.c b/src/ior.c index c20f289..de05fc2 100755 --- a/src/ior.c +++ b/src/ior.c @@ -496,6 +496,17 @@ static int CountErrors(IOR_param_t * test, int access, int errors) */ static int CountTasksPerNode(int numTasks, MPI_Comm comm) { + // for debugging and testing: + if (getenv("IOR_FAKE_TASK_PER_NODES")){ + int tasksPerNode = atoi(getenv("IOR_FAKE_TASK_PER_NODES")); + int rank; + MPI_Comm_rank(comm, & rank); + if(rank == 0){ + printf("Fake tasks per node: using %d\n", tasksPerNode); + } + return tasksPerNode; + } + char localhost[MAX_STR]; char hostname0[MAX_STR]; static int firstPass = TRUE; From 4c5856469b680e8a4f511cec804d771741f42410 Mon Sep 17 00:00:00 2001 From: Julian Kunkel Date: Wed, 29 Nov 2017 10:02:34 +0100 Subject: [PATCH 2/8] Configuration to trigger #14 --- testing/timestamp.cfg | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 testing/timestamp.cfg diff --git a/testing/timestamp.cfg b/testing/timestamp.cfg new file mode 100644 index 0000000..b8ebe49 --- /dev/null +++ b/testing/timestamp.cfg @@ -0,0 +1,20 @@ +IOR START +reorderTasksConstant=1 +repetitions=1 +segmentCount=1 +verbose=0 +fsync=0 +checkWrite=1 +blockSize=16 +setTimeStampSignature=1511817315 +checkRead=0 +readFile=1 +filePerProc=0 +writeFile=1 +api=POSIX +transferSize=16 +intraTestBarriers=0 +testFile=/tmp/test + +RUN +IOR STOP From b67c5ce62c55566a9f190f3b32824ac37163438c Mon Sep 17 00:00:00 2001 From: Julian Kunkel Date: Wed, 29 Nov 2017 10:17:02 +0100 Subject: [PATCH 3/8] Bugfix for #14 WriteCheck did not work properly due to shifting of patterns. It is possible that one buffer could be saved by refactoring the code properly. --- src/ior.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ior.c b/src/ior.c index de05fc2..9a1e253 100755 --- a/src/ior.c +++ b/src/ior.c @@ -1359,7 +1359,7 @@ static void XferBuffersSetup(IOR_io_buffers* ioBuffers, IOR_param_t* test, if (test->checkWrite || test->checkRead) { ioBuffers->checkBuffer = aligned_buffer_alloc(test->transferSize); } - if (test->checkRead) { + if (test->checkRead || test->checkWrite) { ioBuffers->readCheckBuffer = aligned_buffer_alloc(test->transferSize); } @@ -2114,6 +2114,9 @@ static void TestIoSys(IOR_test_t *test) (2 * params->tasksPerNode) % params->numTasks; } + // update the check buffer + FillBuffer(ioBuffers.readCheckBuffer, params, 0, (rank + rankOffset) % params->numTasks); + reseed_incompressible_prng = TRUE; /* Re-Seed the PRNG to get same sequence back, if random */ GetTestFileName(testFileName, params); @@ -2559,13 +2562,14 @@ static IOR_offset_t WriteOrReadSingle(IOR_offset_t pairCnt, IOR_offset_t *offset ERR("cannot read from file"); } else if (access == WRITECHECK) { memset(checkBuffer, 'a', transfer); + amtXferred = backend->xfer(access, fd, checkBuffer, transfer, test); if (amtXferred != transfer) ERR("cannot read from file write check"); (*transferCount)++; - *errors += CompareBuffers(buffer, checkBuffer, transfer, + *errors += CompareBuffers(readCheckBuffer, checkBuffer, transfer, *transferCount, test, WRITECHECK); } else if (access == READCHECK) { From 2c224e0ee8274d4908bc40536b75c54b55491d59 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Thu, 30 Nov 2017 11:56:26 +0100 Subject: [PATCH 4/8] Bugfix for #14, storeFileOffset=1 --- src/ior.c | 16 ++++++++-------- testing/timestamp.cfg | 10 +++++++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ior.c b/src/ior.c index 9a1e253..76a9715 100755 --- a/src/ior.c +++ b/src/ior.c @@ -496,7 +496,7 @@ static int CountErrors(IOR_param_t * test, int access, int errors) */ static int CountTasksPerNode(int numTasks, MPI_Comm comm) { - // for debugging and testing: + /* for debugging and testing */ if (getenv("IOR_FAKE_TASK_PER_NODES")){ int tasksPerNode = atoi(getenv("IOR_FAKE_TASK_PER_NODES")); int rank; @@ -2544,10 +2544,8 @@ static IOR_offset_t WriteOrReadSingle(IOR_offset_t pairCnt, IOR_offset_t *offset transfer = test->transferSize; if (access == WRITE) { - /* - * fills each transfer with a unique pattern - * containing the offset into the file - */ + /* fills each transfer with a unique pattern + * containing the offset into the file */ if (test->storeFileOffset == TRUE) { FillBuffer(buffer, test, test->offset, pretendRank); } @@ -2563,9 +2561,11 @@ static IOR_offset_t WriteOrReadSingle(IOR_offset_t pairCnt, IOR_offset_t *offset } else if (access == WRITECHECK) { memset(checkBuffer, 'a', transfer); - amtXferred = - backend->xfer(access, fd, checkBuffer, transfer, - test); + if (test->storeFileOffset == TRUE) { + FillBuffer(readCheckBuffer, test, test->offset, pretendRank); + } + + amtXferred = backend->xfer(access, fd, checkBuffer, transfer, test); if (amtXferred != transfer) ERR("cannot read from file write check"); (*transferCount)++; diff --git a/testing/timestamp.cfg b/testing/timestamp.cfg index b8ebe49..21a9808 100644 --- a/testing/timestamp.cfg +++ b/testing/timestamp.cfg @@ -1,13 +1,19 @@ +# This tests the checks of read and write for correctness +# Run with multiple processes, at least 3 +# You may set the environment variable IOR_FAKE_TASK_PER_NODES=3 and run it on one node +# Example: IOR_FAKE_TASK_PER_NODES=3 mpiexec -n 3 ./src/ior -f testing/timestamp.cfg + IOR START reorderTasksConstant=1 repetitions=1 +storeFileOffset=0 segmentCount=1 verbose=0 fsync=0 checkWrite=1 blockSize=16 setTimeStampSignature=1511817315 -checkRead=0 +checkRead=1 readFile=1 filePerProc=0 writeFile=1 @@ -15,6 +21,8 @@ api=POSIX transferSize=16 intraTestBarriers=0 testFile=/tmp/test +RUN +storeFileOffset=1 RUN IOR STOP From c9d6c2316eae830fd244b56207e4eb774eb6ca3a Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Thu, 30 Nov 2017 12:01:19 +0100 Subject: [PATCH 5/8] Bugfix for self referencing sprintf #20 Backmerge from IOR fork. --- src/mdtest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mdtest.c b/src/mdtest.c index 2bc66bc..95777fd 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -1822,7 +1822,7 @@ int main(int argc, char **argv) { MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); - + /* NCMPI backend uses numTaskWorld as size */ numTasksWorld = size; @@ -2161,12 +2161,12 @@ int main(int argc, char **argv) { fflush(stdout); } - strcpy(testdir, testdirpath); + int pos = sprintf(testdir, "%s", testdirpath); if ( testdir[strlen( testdir ) - 1] != '/' ) { - strcat(testdir, "/"); + pos += sprintf(& testdir[pos], "/"); } - strcat(testdir, TEST_DIR); - sprintf(testdir, "%s.%d", testdir, j); + pos += sprintf(& testdir[pos], "%s", TEST_DIR); + pos += sprintf(& testdir[pos], ".%d", j); if (verbose >= 2 && rank == 0) { printf( "V-2: main (for j loop): making testdir, \"%s\"\n", testdir ); From 1f6d062f7f29fa1981091fb4fefb7773f8e5b2e2 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sat, 9 Dec 2017 11:52:13 +0100 Subject: [PATCH 6/8] Bugfix #22 --- src/ior.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ior.c b/src/ior.c index 76a9715..aa45b22 100755 --- a/src/ior.c +++ b/src/ior.c @@ -1354,8 +1354,6 @@ static void XferBuffersSetup(IOR_io_buffers* ioBuffers, IOR_param_t* test, { ioBuffers->buffer = aligned_buffer_alloc(test->transferSize); - FillBuffer(ioBuffers->buffer, test, 0, pretendRank); - if (test->checkWrite || test->checkRead) { ioBuffers->checkBuffer = aligned_buffer_alloc(test->transferSize); } @@ -2033,6 +2031,8 @@ static void TestIoSys(IOR_test_t *test) MPI_CHECK(MPI_Bcast (¶ms->timeStampSignatureValue, 1, MPI_UNSIGNED, 0, testComm), "cannot broadcast start time value"); + + FillBuffer(ioBuffers.buffer, params, 0, pretendRank); /* use repetition count for number of multiple files */ if (params->multiFile) params->repCounter = rep; From 93355314de8bbc2b0607f6ba6664afbf57048618 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sat, 9 Dec 2017 17:22:58 +0100 Subject: [PATCH 7/8] Adjusted command line checks for recent changes in semantics for readCheck/writeCheck. --- src/ior.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ior.c b/src/ior.c index aa45b22..e6f6033 100755 --- a/src/ior.c +++ b/src/ior.c @@ -2280,10 +2280,10 @@ static void ValidateTests(IOR_param_t * test) test, &defaults, interTestDelay); if (test->readFile != TRUE && test->writeFile != TRUE && test->checkRead != TRUE && test->checkWrite != TRUE) - ERR("test must write, read, or check file"); - if ((test->deadlineForStonewalling > 0) - && (test->checkWrite == TRUE || test->checkRead == TRUE)) - ERR("can not perform write or read check with stonewalling"); + ERR("test must write, read, or check read/write file"); + if(! test->setTimeStampSignature && test->writeFile != TRUE && test->checkRead == TRUE) + ERR("readCheck requires to write a timeStampSignature before using -G"); + if (test->segmentCount < 0) ERR("segment count must be positive value"); if ((test->blockSize % sizeof(IOR_size_t)) != 0) From cdc93da3a4686ef0076d3131fed25c5363572220 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sat, 9 Dec 2017 17:24:31 +0100 Subject: [PATCH 8/8] Check for command line slight naming change. --- src/ior.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ior.c b/src/ior.c index e6f6033..ca7529b 100755 --- a/src/ior.c +++ b/src/ior.c @@ -2282,8 +2282,7 @@ static void ValidateTests(IOR_param_t * test) && test->checkRead != TRUE && test->checkWrite != TRUE) ERR("test must write, read, or check read/write file"); if(! test->setTimeStampSignature && test->writeFile != TRUE && test->checkRead == TRUE) - ERR("readCheck requires to write a timeStampSignature before using -G"); - + ERR("using readCheck only requires to write a timeStampSignature -- use -G"); if (test->segmentCount < 0) ERR("segment count must be positive value"); if ((test->blockSize % sizeof(IOR_size_t)) != 0)