Skip to content

Commit

Permalink
Allow long summary to be printed for every test.
Browse files Browse the repository at this point in the history
  • Loading branch information
morrone committed Jan 13, 2012
1 parent 8c95611 commit ef70266
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 18 deletions.
3 changes: 3 additions & 0 deletions doc/USER_GUIDE
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
54 changes: 36 additions & 18 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/ior.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions src/parse_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ef70266

Please sign in to comment.