commit
3887668bda
44
src/ior.c
44
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;
|
||||
|
@ -1343,12 +1354,10 @@ 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);
|
||||
}
|
||||
if (test->checkRead) {
|
||||
if (test->checkRead || test->checkWrite) {
|
||||
ioBuffers->readCheckBuffer = aligned_buffer_alloc(test->transferSize);
|
||||
}
|
||||
|
||||
|
@ -2022,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;
|
||||
|
@ -2103,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);
|
||||
|
@ -2266,10 +2280,9 @@ 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("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)
|
||||
|
@ -2530,10 +2543,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);
|
||||
}
|
||||
|
@ -2548,13 +2559,16 @@ 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 (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)++;
|
||||
*errors += CompareBuffers(buffer, checkBuffer, transfer,
|
||||
*errors += CompareBuffers(readCheckBuffer, checkBuffer, transfer,
|
||||
*transferCount, test,
|
||||
WRITECHECK);
|
||||
} else if (access == READCHECK) {
|
||||
|
|
10
src/mdtest.c
10
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 );
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# 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=1
|
||||
readFile=1
|
||||
filePerProc=0
|
||||
writeFile=1
|
||||
api=POSIX
|
||||
transferSize=16
|
||||
intraTestBarriers=0
|
||||
testFile=/tmp/test
|
||||
RUN
|
||||
|
||||
storeFileOffset=1
|
||||
RUN
|
||||
IOR STOP
|
Loading…
Reference in New Issue