Bugfix for #14, storeFileOffset=1

master
Julian M. Kunkel 2017-11-30 11:56:26 +01:00
parent b67c5ce62c
commit 2c224e0ee8
2 changed files with 17 additions and 9 deletions

View File

@ -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)++;

View File

@ -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