From 349f747ea5c8f6fa28381d1cb596cf54264fc616 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Sun, 8 Jan 2012 11:56:32 -0800 Subject: [PATCH] Remove undocumented options. --- doc/Makefile.am | 2 +- doc/UNDOCUMENTED_OPTIONS | 36 ------------ src/ior.c | 115 ++------------------------------------- src/ior.h | 12 ---- src/iordef.h | 3 - src/parse_options.c | 16 ------ src/utilities.c | 74 ------------------------- src/utilities.h | 3 - 8 files changed, 7 insertions(+), 254 deletions(-) delete mode 100644 doc/UNDOCUMENTED_OPTIONS diff --git a/doc/Makefile.am b/doc/Makefile.am index 52531f4..78926d0 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1 +1 @@ -data_DATA = USER_GUIDE UNDOCUMENTED_OPTIONS +data_DATA = USER_GUIDE diff --git a/doc/UNDOCUMENTED_OPTIONS b/doc/UNDOCUMENTED_OPTIONS deleted file mode 100644 index f517567..0000000 --- a/doc/UNDOCUMENTED_OPTIONS +++ /dev/null @@ -1,36 +0,0 @@ -To use these options, modify USE_UNDOC_OPT=TRUE in iordef.h and then recompile. -For passing arguments to the executable for these options, use this format: - - '-O option1=1,option2=0' - -Options: - - * fillTheFileSystem -- limits unnecessary output for showing performance, etc. - The command line '-w -k -m -i 123 -F -O fillTheFileSystem=5' has each task - creating (and keeping) 123 files, showing the time between every fifth file. - - * includeDeleteTime -- use with '-O includeDeleteTime=1' to have time to - delete file included in write performance time. Note that if this file - is deleted after the write, there's nothing available for the read back - or checking. - - * multiReRead -- use with '-i 5 -v -k -w -W -O multiReRead=1' to have 1 write - of file, followed by 4 reads w/data checking. - - * NFS_serverCount -- use with other NFS_* options, -F, and -o to write/read - files across multiple NFS servers. Set the server count to > 0 to enable. - The format is: 'NFS_rootPath/NFS_serverName[0..NFS_serverCount-1]/outFile'. - Each file is written round-robin to a different NFS server. - - * NFS_rootPath -- use with NFS_server* options for path to NFS servers. - - * NFS_serverName -- ise with NFS_* options for NFS server prefix. Specific - NFS server number is appended to this name, e.g. nfs123. - - * corruptFile -- corrupts file after writing for determining data-checking - reliability. - -Note: - - * cbif.c (Change Byte In File) is a simple utility to check the value of - a file offset; also allows changing a single byte at an offset. diff --git a/src/ior.c b/src/ior.c index 797cb35..cf0e9c5 100644 --- a/src/ior.c +++ b/src/ior.c @@ -673,11 +673,6 @@ static void DisplayFreespace(IOR_param_t * test) if (directoryFound == FALSE) { strcpy(fileName, "."); } -#if USE_UNDOC_OPT /* NFS */ - if (test->NFS_serverCount) { - strcpy(fileName, test->NFS_rootPath); - } -#endif /* USE_UNDOC_OPT - NFS */ ShowFileSystemSize(fileName); @@ -919,15 +914,6 @@ static void GetTestFileName(char *testFileName, IOR_param_t * test) strcpy(testFileNameRoot, PrependDir(test, testFileNameRoot)); } -#if USE_UNDOC_OPT /* NFS */ - if (test->NFS_serverCount) { - sprintf(tmpString, "%s/%s%d/%s", test->NFS_rootPath, - test->NFS_serverName, - rank % (test->NFS_serverCount), - testFileNameRoot); - strcpy(testFileNameRoot, tmpString); - } -#endif /* USE_UNDOC_OPT - NFS */ sprintf(testFileName, "%s.%08d", testFileNameRoot, (rank + rankOffset) % test->numTasks); } else { @@ -1194,13 +1180,6 @@ ReadCheck(void *fd, if (*amtXferred != transfer) ERR("cannot read from file on read check"); memset(checkBuffer, 'a', transfer); /* empty buffer */ -#if USE_UNDOC_OPT /* corruptFile */ - MPI_CHECK(MPI_Barrier(testComm), "barrier error"); - /* intentionally corrupt file to determine if check works */ - if (params->corruptFile) { - CorruptFile(params->testFileName, params, 0, READCHECK); - } -#endif /* USE_UNDOC_OPT - corruptFile */ MPI_CHECK(MPI_Barrier(testComm), "barrier error"); if (params->filePerProc) { *amtXferred = backend->xfer(access, params->fd_fppReadCheck, @@ -1278,16 +1257,7 @@ static void ReduceIterResults(IOR_test_t *test, double **timer, int rep, diff_subset = &diff[3]; } -#if USE_UNDOC_OPT /* fillTheFileSystem */ - if (test->params.fillTheFileSystem && rep == 0 && verbose >= VERBOSE_1) { - fprintf(stdout, " . . . skipping iteration results output . . .\n"); - fflush(stdout); - } - - if (verbose < VERBOSE_0 || test->params.fillTheFileSystem) { -#else if (verbose < VERBOSE_0) { -#endif return; } @@ -1451,12 +1421,6 @@ static void ShowTestInfo(IOR_param_t *params) fprintf(stdout, "\n"); fprintf(stdout, "Test %d started: %s", params->id, CurrentTimeString()); -#if USE_UNDOC_OPT /* NFS */ - if (params->NFS_serverCount) { - fprintf(stdout, "NFS path: %s%s[0..%d]\n", params->NFS_rootPath, - params->NFS_serverName, params->NFS_serverCount - 1); - } -#endif /* USE_UNDOC_OPT - NFS */ if (verbose >= VERBOSE_1) { /* if pvfs2:, then skip */ if (Regex(params->testFileName, "^[a-z][a-z].*:") == 0) { @@ -1952,12 +1916,6 @@ static void TestIoSys(IOR_test_t *test) startTime = GetTimeStamp(); maxTimeDuration = params->maxTimeDuration * 60; /* convert to seconds */ -#if USE_UNDOC_OPT /* fillTheFileSystem */ - if (rank == 0 && params->fillTheFileSystem && verbose >= VERBOSE_0) { - fprintf(stdout, "Run started: %s", CurrentTimeString()); - } -#endif /* USE_UNDOC_OPT - fillTheFileSystem */ - /* loop over test iterations */ for (rep = 0; rep < params->repetitions; rep++) { @@ -1990,17 +1948,6 @@ static void TestIoSys(IOR_test_t *test) MPI_CHECK(MPI_Bcast (¶ms->timeStampSignatureValue, 1, MPI_UNSIGNED, 0, testComm), "cannot broadcast start time value"); -#if USE_UNDOC_OPT /* fillTheFileSystem */ - if (params->fillTheFileSystem && rep > 0 - && rep % (params->fillTheFileSystem / params->numTasks) == 0) { - if (rank == 0 && verbose >= VERBOSE_0) { - fprintf(stdout, "at file #%d, time: %s", - rep * params->numTasks, - CurrentTimeString()); - fflush(stdout); - } - } -#endif /* USE_UNDOC_OPT - fillTheFileSystem */ /* use repetition count for number of multiple files */ if (params->multiFile) params->repCounter = rep; @@ -2010,9 +1957,6 @@ static void TestIoSys(IOR_test_t *test) */ if (params->writeFile -#if USE_UNDOC_OPT /* multiReRead */ - && (!params->multiReRead || !rep) -#endif /* USE_UNDOC_OPT - multiReRead */ && (maxTimeDuration ? (GetTimeStamp() - startTime < maxTimeDuration) : 1)) { GetTestFileName(testFileName, params); @@ -2047,46 +1991,16 @@ static void TestIoSys(IOR_test_t *test) timer[4][rep] = GetTimeStamp(); backend->close(fd, params); -#if USE_UNDOC_OPT /* includeDeleteTime */ - if (params->includeDeleteTime) { - if (rank == 0 && verbose >= VERBOSE_1) { - fprintf(stdout, - "** including delete time **\n"); - } - MPI_CHECK(MPI_Barrier(testComm), - "barrier error"); - RemoveFile(testFileName, params->filePerProc, - params); - } -#endif /* USE_UNDOC_OPT - includeDeleteTime */ - timer[5][rep] = GetTimeStamp(); MPI_CHECK(MPI_Barrier(testComm), "barrier error"); -#if USE_UNDOC_OPT /* includeDeleteTime */ - if (params->includeDeleteTime) { - /* not accurate, but no longer a test file to examine */ - results->aggFileSizeFromStat[rep] = - params->expectedAggFileSize; - results->aggFileSizeFromXfer[rep] = - params->expectedAggFileSize; - results->aggFileSizeForBW[rep] = - params->expectedAggFileSize; - } else { -#endif /* USE_UNDOC_OPT - includeDeleteTime */ + /* get the size of the file just written */ + results->aggFileSizeFromStat[rep] = + backend->get_file_size(params, testComm, testFileName); - /* get the size of the file just written */ - results->aggFileSizeFromStat[rep] - = backend->get_file_size(params, testComm, - testFileName); - - /* check if stat() of file doesn't equal expected file size, - use actual amount of byte moved */ - CheckFileSize(test, dataMoved, rep); - -#if USE_UNDOC_OPT /* includeDeleteTime */ - } -#endif /* USE_UNDOC_OPT - includeDeleteTime */ + /* check if stat() of file doesn't equal expected file size, + use actual amount of byte moved */ + CheckFileSize(test, dataMoved, rep); if (verbose >= VERBOSE_3) WriteTimes(params, timer, rep, WRITE); @@ -2101,19 +2015,8 @@ static void TestIoSys(IOR_test_t *test) * against what was expected to be written */ if (params->checkWrite -#if USE_UNDOC_OPT /* multiReRead */ - && (!params->multiReRead || rep) -#endif /* USE_UNDOC_OPT - multiReRead */ && (maxTimeDuration ? (GetTimeStamp() - startTime < maxTimeDuration) : 1)) { -#if USE_UNDOC_OPT /* corruptFile */ - MPI_CHECK(MPI_Barrier(testComm), "barrier error"); - /* intentionally corrupt file to determine if check works */ - if (params->corruptFile) { - CorruptFile(testFileName, params, rep, - WRITECHECK); - } -#endif /* USE_UNDOC_OPT - corruptFile */ MPI_CHECK(MPI_Barrier(testComm), "barrier error"); if (rank == 0 && verbose >= VERBOSE_1) { fprintf(stdout, @@ -2276,12 +2179,6 @@ static void TestIoSys(IOR_test_t *test) rankOffset = 0; } -#if USE_UNDOC_OPT /* fillTheFileSystem */ - if (rank == 0 && params->fillTheFileSystem && verbose >= VERBOSE_0) { - fprintf(stdout, "Run ended: %s", CurrentTimeString()); - } -#endif /* USE_UNDOC_OPT - fillTheFileSystem */ - MPI_CHECK(MPI_Comm_free(&testComm), "MPI_Comm_free() error"); PrintShortSummary(test); diff --git a/src/ior.h b/src/ior.h index be62897..37eb9f1 100644 --- a/src/ior.h +++ b/src/ior.h @@ -122,18 +122,6 @@ typedef struct int lustre_set_striping; /* flag that we need to set lustre striping */ int lustre_ignore_locks; -#if USE_UNDOC_OPT - int corruptFile; - int fillTheFileSystem; - int includeDeleteTime; - int multiReRead; - - /* NFS variables */ - char NFS_rootPath[MAXPATHLEN]; /* absolute path to NFS servers */ - char NFS_serverName[MAXPATHLEN]; /* prefix for NFS server name */ - int NFS_serverCount; /* number of NFS servers to be used */ -#endif /* USE_UNDOC_OPT */ - int id; /* test's unique ID */ int intraTestBarriers; /* barriers between open/op and op/close */ } IOR_param_t; diff --git a/src/iordef.h b/src/iordef.h index a7b307d..6d2ae16 100644 --- a/src/iordef.h +++ b/src/iordef.h @@ -113,9 +113,6 @@ extern int verbose; /* verbose output */ #define HERE fprintf(stdout, "** LINE %d (TASK=%d) **\n", \ __LINE__, rank); -/* Other MACROs */ -#define USE_UNDOC_OPT TRUE /* USE UNDOCumented OPTion */ - typedef long long int IOR_offset_t; typedef long long int IOR_size_t; diff --git a/src/parse_options.c b/src/parse_options.c index 2e001d2..2b15673 100644 --- a/src/parse_options.c +++ b/src/parse_options.c @@ -256,22 +256,6 @@ void DecodeDirective(char *line, IOR_param_t *params) ERR("ior was not compiled with Lustre support"); #endif params->lustre_ignore_locks = atoi(value); -#if USE_UNDOC_OPT - } else if (strcasecmp(option, "corruptFile") == 0) { - params->corruptFile = atoi(value); - } else if (strcasecmp(option, "fillTheFileSystem") == 0) { - params->fillTheFileSystem = atoi(value); - } else if (strcasecmp(option, "includeDeleteTime") == 0) { - params->includeDeleteTime = atoi(value); - } else if (strcasecmp(option, "multiReRead") == 0) { - params->multiReRead = atoi(value); - } else if (strcasecmp(option, "nfs_rootpath") == 0) { - strcpy(params->NFS_rootPath, value); - } else if (strcasecmp(option, "nfs_servername") == 0) { - strcpy(params->NFS_serverName, value); - } else if (strcasecmp(option, "nfs_servercount") == 0) { - params->NFS_serverCount = atoi(value); -#endif /* USE_UNDOC_OPT */ } else if (strcasecmp(option, "numtasks") == 0) { params->numTasks = atoi(value); RecalculateExpectedFileSize(params); diff --git a/src/utilities.c b/src/utilities.c index 944dac0..9b9dc39 100644 --- a/src/utilities.c +++ b/src/utilities.c @@ -386,80 +386,6 @@ int Regex(char *string, char *pattern) return (retValue); } -#if USE_UNDOC_OPT /* corruptFile */ -/* - * Modify byte in file - used to testing write/read data checking. - */ -static void ModifyByteInFile(char *fileName, IOR_offset_t offset, int byteValue) -{ - int fd; - int rc; - char old; - char new; - - new = (char)byteValue; - - /* open file, show old value, update to new value */ - fd = open(fileName, O_RDWR); - rc = lseek(fd, offset, SEEK_SET); - if (rc == -1) - goto out; - rc = read(fd, &old, 1); - if (rc == -1) - goto out; - rc = lseek(fd, offset, SEEK_SET); - if (rc == -1) - goto out; - rc = write(fd, &new, 1); - if (rc == -1) - goto out; - fprintf(stdout, - "** DEBUG: offset %lld in %s changed from %d to %d **\n", - offset, fileName, (unsigned char)old, (unsigned char)new); - - out: - close(fd); - return; -} - -/* - * Corrupt file to testing data checking options. - */ -void CorruptFile(char *testFileName, IOR_param_t *params, int rep, int access) -{ - IOR_offset_t tmpOff, range, eof; - char fileName[MAX_STR]; - - /* determine file name */ - strcpy(fileName, testFileName); - if (access == READCHECK && params->filePerProc) { - strcpy(fileName, params->testFileName_fppReadCheck); - } - - /* determine offset to modify */ - SeedRandGen(params->testComm); - eof = params->expectedAggFileSize - / (params->filePerProc ? params->numTasks : 1); - if (access == WRITECHECK) { - range = eof - params->offset; - } else { /* READCHECK */ - range = params->transferSize; - } - tmpOff = - (IOR_offset_t) ((rand() / (float)RAND_MAX) * range) + params->offset; - - if (tmpOff >= eof) - tmpOff = tmpOff / 2; - - /* corrupt at with */ - if (rank == 0 || params->filePerProc) { - ModifyByteInFile(fileName, tmpOff, 121); - } - - return; -} -#endif /* USE_UNDOC_OPT - corruptFile */ - /* * Seed random generator. */ diff --git a/src/utilities.h b/src/utilities.h index 1d9768c..1f245de 100644 --- a/src/utilities.h +++ b/src/utilities.h @@ -22,9 +22,6 @@ int Regex(char *, char *); void ShowFileSystemSize(char *); void DumpBuffer(void *, size_t); void SeedRandGen(MPI_Comm); -#if USE_UNDOC_OPT -void CorruptFile(char *, IOR_param_t *, int, int); -#endif void SetHints (MPI_Info *, char *); void ShowHints (MPI_Info *);