Permalink
Browse files

Allow long summary to be printed for every test.

  • Loading branch information...
1 parent 8c95611 commit ef70266a84eb447efd3460a4b42e496ff5a62315 @morrone morrone committed Jan 13, 2012
Showing with 42 additions and 18 deletions.
  1. +3 −0 doc/USER_GUIDE
  2. +36 −18 src/ior.c
  3. +1 −0 src/ior.h
  4. +2 −0 src/parse_options.c
View
@@ -280,6 +280,9 @@ GENERAL:
-storeFileOffset
-MPIIO collective or useFileView
-HDF5 or NCMPI
+ * summaryAlways - Always print the long summary for each test.
+ Useful for long runs that may be interrupted, preventing
+ the final long summary for ALL tests to be printed.
POSIX-ONLY:
View
@@ -74,7 +74,7 @@ static IOR_test_t *SetupTests(int, char **);
static void ShowTestInfo(IOR_param_t *);
static void ShowSetup(IOR_param_t *params);
static void ShowTest(IOR_param_t *);
-static void PrintSummaryAllTests(IOR_test_t *tests_head);
+static void PrintLongSummaryAllTests(IOR_test_t *tests_head);
static void TestIoSys(IOR_test_t *);
static void ValidTests(IOR_param_t *);
static IOR_offset_t WriteOrRead(IOR_param_t *, void *, int);
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
TestIoSys(tptr);
}
- PrintSummaryAllTests(tests_head);
+ PrintLongSummaryAllTests(tests_head);
/* display finish time */
if (rank == 0 && verbose >= VERBOSE_0) {
@@ -1580,8 +1580,8 @@ static double mean_of_array_of_doubles(double *values, int len)
for (i = 0; i < len; i++) {
tot += values[i];
}
-
return tot / len;
+
}
struct results {
@@ -1628,9 +1628,11 @@ static struct results *bw_values(int reps, IOR_offset_t *agg_file_size, double *
}
/*
- * Summarize results, showing max rates (and min, mean, stddev if verbose)
+ * Summarize results
+ *
+ * operation is typically "write" or "read"
*/
-static void PrintSummaryOneOperation(IOR_test_t *test, double *times, char *operation)
+static void PrintLongSummaryOneOperation(IOR_test_t *test, double *times, char *operation)
{
IOR_param_t *params = &test->params;
IOR_results_t *results = test->results;
@@ -1671,29 +1673,40 @@ static void PrintSummaryOneOperation(IOR_test_t *test, double *times, char *oper
free(bw);
}
-static void PrintSummaryAllTests(IOR_test_t *tests_head)
+static void PrintLongSummaryOneTest(IOR_test_t *test)
{
- IOR_param_t *params = &tests_head->params;
- IOR_results_t *results = tests_head->results;
- IOR_test_t *tptr;
+ IOR_param_t *params = &test->params;
+ IOR_results_t *results = test->results;
- if (rank !=0)
- return;
+ if (params->writeFile)
+ PrintLongSummaryOneOperation(test, results->writeTime, "write");
+ if (params->readFile)
+ PrintLongSummaryOneOperation(test, results->readTime, "read");
+}
- fprintf(stdout, "\n");
- fprintf(stdout, "Summary of all tests:");
+static void PrintLongSummaryHeader()
+{
fprintf(stdout, "\n");
fprintf(stdout, "%-9s %10s %10s %10s %10s %10s",
"Operation", "Max(MiB)", "Min(MiB)", "Mean(MiB)", "StdDev",
"Mean(s)");
fprintf(stdout, " #Tasks tPN reps fPP reord reordoff reordrand seed"
" segcnt blksiz xsize aggsize TestNum API\n");
+}
+
+static void PrintLongSummaryAllTests(IOR_test_t *tests_head)
+{
+ IOR_test_t *tptr;
+
+ if (rank !=0)
+ return;
+
+ fprintf(stdout, "\n");
+ fprintf(stdout, "Summary of all tests:");
+ PrintLongSummaryHeader();
for (tptr = tests_head; tptr != NULL; tptr = tptr->next) {
- if (params->writeFile)
- PrintSummaryOneOperation(tptr, results->writeTime, "write");
- if (params->readFile)
- PrintSummaryOneOperation(tptr, results->readTime, "read");
+ PrintLongSummaryOneTest(tptr);
}
}
@@ -2172,7 +2185,12 @@ static void TestIoSys(IOR_test_t *test)
MPI_CHECK(MPI_Comm_free(&testComm), "MPI_Comm_free() error");
- PrintShortSummary(test);
+ if (params->summary_every_test) {
+ PrintLongSummaryHeader();
+ PrintLongSummaryOneTest(test);
+ } else {
+ PrintShortSummary(test);
+ }
if (hog_buf != NULL)
free(hog_buf);
View
@@ -85,6 +85,7 @@ typedef struct
int useO_DIRECT; /* use O_DIRECT, bypassing I/O buffers */
int showHints; /* show hints */
int showHelp; /* show options and help */
+ int summary_every_test; /* flag to print summary every test, not just at end */
int uniqueDir; /* use unique directory for each fpp */
int useExistingTestFile; /* do not delete test file before access */
int storeFileOffset; /* use file offset as stored signature */
View
@@ -266,6 +266,8 @@ void DecodeDirective(char *line, IOR_param_t *params)
} else if (strcasecmp(option, "numtasks") == 0) {
params->numTasks = atoi(value);
RecalculateExpectedFileSize(params);
+ } else if (strcasecmp(option, "summaryalways") == 0) {
+ params->summary_every_test = atoi(value);
} else {
if (rank == 0)
fprintf(stdout, "Unrecognized parameter \"%s\"\n",

0 comments on commit ef70266

Please sign in to comment.