diff --git a/src/ior-internal.h b/src/ior-internal.h index 40b1706..afeeb60 100644 --- a/src/ior-internal.h +++ b/src/ior-internal.h @@ -19,6 +19,8 @@ void DisplayFreespace(IOR_param_t * test); void GetTestFileName(char *, IOR_param_t *); void PrintRemoveTiming(double start, double finish, int rep); void PrintReducedResult(IOR_test_t *test, int access, double bw, double *diff_subset, double totalTime, int rep); +void PrintTestEnds(); +void PrintTableHeader(); /* End of ior-output */ struct results { diff --git a/src/ior-output.c b/src/ior-output.c index 26f189c..ed9fcd3 100644 --- a/src/ior-output.c +++ b/src/ior-output.c @@ -15,8 +15,19 @@ static struct results *ops_values(int reps, IOR_offset_t *agg_file_size, IOR_off static double mean_of_array_of_doubles(double *values, int len); static void PPDouble(int leftjustify, double number, char *append); +void PrintTableHeader(){ + fprintf(out_resultfile, "\n"); + fprintf(out_resultfile, "access bw(MiB/s) block(KiB) xfer(KiB) open(s) wr/rd(s) close(s) total(s) iter\n"); + fprintf(out_resultfile, "------ --------- ---------- --------- -------- -------- -------- -------- ----\n"); +} + +void PrintTestEnds(){ + fprintf(out_resultfile, "\n"); + fprintf(out_resultfile, "Finished: %s", CurrentTimeString()); +} + void PrintReducedResult(IOR_test_t *test, int access, double bw, double *diff_subset, double totalTime, int rep){ - fprintf(out_logfile, "%-10s", access == WRITE ? "write" : "read"); + fprintf(out_resultfile, "%-10s", access == WRITE ? "write" : "read"); PPDouble(1, bw / MEBIBYTE, " "); PPDouble(1, (double)test->params.blockSize / KIBIBYTE, " "); PPDouble(1, (double)test->params.transferSize / KIBIBYTE, " "); @@ -24,8 +35,8 @@ void PrintReducedResult(IOR_test_t *test, int access, double bw, double *diff_su PPDouble(1, diff_subset[1], " "); PPDouble(1, diff_subset[2], " "); PPDouble(1, totalTime, " "); - fprintf(out_logfile, "%-4d\n", rep); - fflush(out_logfile); + fprintf(out_resultfile, "%-4d\n", rep); + fflush(out_resultfile); } @@ -38,8 +49,8 @@ void PrintEarlyHeader() if (rank != 0) return; - fprintf(out_logfile, "IOR-" META_VERSION ": MPI Coordinated Test of Parallel I/O\n"); - fflush(out_logfile); + fprintf(out_resultfile, "IOR-" META_VERSION ": MPI Coordinated Test of Parallel I/O\n"); + fflush(out_resultfile); } void PrintHeader(int argc, char **argv) @@ -50,48 +61,48 @@ void PrintHeader(int argc, char **argv) if (rank != 0) return; - fprintf(out_logfile, "Began: %s", CurrentTimeString()); - fprintf(out_logfile, "Command line used: %s", argv[0]); + fprintf(out_resultfile, "Began: %s", CurrentTimeString()); + fprintf(out_resultfile, "Command line used: %s", argv[0]); for (i = 1; i < argc; i++) { - fprintf(out_logfile, " \"%s\"", argv[i]); + fprintf(out_resultfile, " \"%s\"", argv[i]); } - fprintf(out_logfile, "\n"); + fprintf(out_resultfile, "\n"); if (uname(&unamebuf) != 0) { EWARN("uname failed"); - fprintf(out_logfile, "Machine: Unknown"); + fprintf(out_resultfile, "Machine: Unknown"); } else { - fprintf(out_logfile, "Machine: %s %s", unamebuf.sysname, + fprintf(out_resultfile, "Machine: %s %s", unamebuf.sysname, unamebuf.nodename); if (verbose >= VERBOSE_2) { - fprintf(out_logfile, " %s %s %s", unamebuf.release, + fprintf(out_resultfile, " %s %s %s", unamebuf.release, unamebuf.version, unamebuf.machine); } } - fprintf(out_logfile, "\n"); + fprintf(out_resultfile, "\n"); #ifdef _NO_MPI_TIMER if (verbose >= VERBOSE_2) - fprintf(out_logfile, "Using unsynchronized POSIX timer\n"); + fprintf(out_resultfile, "Using unsynchronized POSIX timer\n"); #else /* not _NO_MPI_TIMER */ if (MPI_WTIME_IS_GLOBAL) { if (verbose >= VERBOSE_2) - fprintf(out_logfile, "Using synchronized MPI timer\n"); + fprintf(out_resultfile, "Using synchronized MPI timer\n"); } else { if (verbose >= VERBOSE_2) - fprintf(out_logfile, "Using unsynchronized MPI timer\n"); + fprintf(out_resultfile, "Using unsynchronized MPI timer\n"); } #endif /* _NO_MPI_TIMER */ if (verbose >= VERBOSE_1) { - fprintf(out_logfile, "Start time skew across all tasks: %.02f sec\n", + fprintf(out_resultfile, "Start time skew across all tasks: %.02f sec\n", wall_clock_deviation); } if (verbose >= VERBOSE_3) { /* show env */ - fprintf(out_logfile, "STARTING ENVIRON LOOP\n"); + fprintf(out_resultfile, "STARTING ENVIRON LOOP\n"); for (i = 0; environ[i] != NULL; i++) { - fprintf(out_logfile, "%s\n", environ[i]); + fprintf(out_resultfile, "%s\n", environ[i]); } - fprintf(out_logfile, "ENDING ENVIRON LOOP\n"); + fprintf(out_resultfile, "ENDING ENVIRON LOOP\n"); } - fflush(out_logfile); + fflush(out_resultfile); } /* @@ -99,15 +110,15 @@ void PrintHeader(int argc, char **argv) */ void ShowTestInfo(IOR_param_t *params) { - fprintf(out_logfile, "\n"); - fprintf(out_logfile, "Test %d started: %s", params->id, CurrentTimeString()); + fprintf(out_resultfile, "\n"); + fprintf(out_resultfile, "Test %d started: %s", params->id, CurrentTimeString()); if (verbose >= VERBOSE_1) { /* if pvfs2:, then skip */ if (Regex(params->testFileName, "^[a-z][a-z].*:") == 0) { DisplayFreespace(params); } } - fflush(out_logfile); + fflush(out_resultfile); } /* @@ -117,79 +128,79 @@ void ShowSetup(IOR_param_t *params) { if (strcmp(params->debug, "") != 0) { - fprintf(out_logfile, "\n*** DEBUG MODE ***\n"); - fprintf(out_logfile, "*** %s ***\n\n", params->debug); + fprintf(out_resultfile, "\n*** DEBUG MODE ***\n"); + fprintf(out_resultfile, "*** %s ***\n\n", params->debug); } - fprintf(out_logfile, "Summary:\n"); - fprintf(out_logfile, "\tapi = %s\n", params->apiVersion); - fprintf(out_logfile, "\ttest filename = %s\n", params->testFileName); - fprintf(out_logfile, "\taccess = "); - fprintf(out_logfile, params->filePerProc ? "file-per-process" : "single-shared-file"); + fprintf(out_resultfile, "Summary:\n"); + fprintf(out_resultfile, "\tapi = %s\n", params->apiVersion); + fprintf(out_resultfile, "\ttest filename = %s\n", params->testFileName); + fprintf(out_resultfile, "\taccess = "); + fprintf(out_resultfile, params->filePerProc ? "file-per-process" : "single-shared-file"); if (verbose >= VERBOSE_1 && strcmp(params->api, "POSIX") != 0) { - fprintf(out_logfile, params->collective == FALSE ? ", independent" : ", collective"); + fprintf(out_resultfile, params->collective == FALSE ? ", independent" : ", collective"); } - fprintf(out_logfile, "\n"); + fprintf(out_resultfile, "\n"); if (verbose >= VERBOSE_1) { if (params->segmentCount > 1) { - fprintf(out_logfile, + fprintf(out_resultfile, "\tpattern = strided (%d segments)\n", (int)params->segmentCount); } else { - fprintf(out_logfile, + fprintf(out_resultfile, "\tpattern = segmented (1 segment)\n"); } } - fprintf(out_logfile, "\tordering in a file ="); + fprintf(out_resultfile, "\tordering in a file ="); if (params->randomOffset == FALSE) { - fprintf(out_logfile, " sequential offsets\n"); + fprintf(out_resultfile, " sequential offsets\n"); } else { - fprintf(out_logfile, " random offsets\n"); + fprintf(out_resultfile, " random offsets\n"); } - fprintf(out_logfile, "\tordering inter file="); + fprintf(out_resultfile, "\tordering inter file="); if (params->reorderTasks == FALSE && params->reorderTasksRandom == FALSE) { - fprintf(out_logfile, " no tasks offsets\n"); + fprintf(out_resultfile, " no tasks offsets\n"); } if (params->reorderTasks == TRUE) { - fprintf(out_logfile, " constant task offsets = %d\n", + fprintf(out_resultfile, " constant task offsets = %d\n", params->taskPerNodeOffset); } if (params->reorderTasksRandom == TRUE) { - fprintf(out_logfile, " random task offsets >= %d, seed=%d\n", + fprintf(out_resultfile, " random task offsets >= %d, seed=%d\n", params->taskPerNodeOffset, params->reorderTasksRandomSeed); } - fprintf(out_logfile, "\tclients = %d (%d per node)\n", + fprintf(out_resultfile, "\tclients = %d (%d per node)\n", params->numTasks, params->tasksPerNode); if (params->memoryPerTask != 0) - fprintf(out_logfile, "\tmemoryPerTask = %s\n", + fprintf(out_resultfile, "\tmemoryPerTask = %s\n", HumanReadable(params->memoryPerTask, BASE_TWO)); if (params->memoryPerNode != 0) - fprintf(out_logfile, "\tmemoryPerNode = %s\n", + fprintf(out_resultfile, "\tmemoryPerNode = %s\n", HumanReadable(params->memoryPerNode, BASE_TWO)); - fprintf(out_logfile, "\trepetitions = %d\n", params->repetitions); - fprintf(out_logfile, "\txfersize = %s\n", + fprintf(out_resultfile, "\trepetitions = %d\n", params->repetitions); + fprintf(out_resultfile, "\txfersize = %s\n", HumanReadable(params->transferSize, BASE_TWO)); - fprintf(out_logfile, "\tblocksize = %s\n", + fprintf(out_resultfile, "\tblocksize = %s\n", HumanReadable(params->blockSize, BASE_TWO)); - fprintf(out_logfile, "\taggregate filesize = %s\n", + fprintf(out_resultfile, "\taggregate filesize = %s\n", HumanReadable(params->expectedAggFileSize, BASE_TWO)); #ifdef HAVE_LUSTRE_LUSTRE_USER_H if (params->lustre_set_striping) { - fprintf(out_logfile, "\tLustre stripe size = %s\n", + fprintf(out_resultfile, "\tLustre stripe size = %s\n", ((params->lustre_stripe_size == 0) ? "Use default" : HumanReadable(params->lustre_stripe_size, BASE_TWO))); if (params->lustre_stripe_count == 0) { - fprintf(out_logfile, "\t stripe count = %s\n", "Use default"); + fprintf(out_resultfile, "\t stripe count = %s\n", "Use default"); } else { - fprintf(out_logfile, "\t stripe count = %d\n", + fprintf(out_resultfile, "\t stripe count = %d\n", params->lustre_stripe_count); } } #endif /* HAVE_LUSTRE_LUSTRE_USER_H */ if (params->deadlineForStonewalling > 0) { - fprintf(out_logfile, "\tUsing stonewalling = %d second(s)%s\n", + fprintf(out_resultfile, "\tUsing stonewalling = %d second(s)%s\n", params->deadlineForStonewalling, params->stoneWallingWearOut ? " with phase out" : ""); } - fflush(out_logfile); + fflush(out_resultfile); } /* @@ -199,77 +210,77 @@ void ShowTest(IOR_param_t * test) { const char* data_packets[] = {"g", "t","o","i"}; - fprintf(out_logfile, "TEST:\t%s=%d\n", "id", test->id); - fprintf(out_logfile, "\t%s=%d\n", "refnum", test->referenceNumber); - fprintf(out_logfile, "\t%s=%s\n", "api", test->api); - fprintf(out_logfile, "\t%s=%s\n", "platform", test->platform); - fprintf(out_logfile, "\t%s=%s\n", "testFileName", test->testFileName); - fprintf(out_logfile, "\t%s=%s\n", "hintsFileName", test->hintsFileName); - fprintf(out_logfile, "\t%s=%d\n", "deadlineForStonewall", + fprintf(out_resultfile, "TEST:\t%s=%d\n", "id", test->id); + fprintf(out_resultfile, "\t%s=%d\n", "refnum", test->referenceNumber); + fprintf(out_resultfile, "\t%s=%s\n", "api", test->api); + fprintf(out_resultfile, "\t%s=%s\n", "platform", test->platform); + fprintf(out_resultfile, "\t%s=%s\n", "testFileName", test->testFileName); + fprintf(out_resultfile, "\t%s=%s\n", "hintsFileName", test->hintsFileName); + fprintf(out_resultfile, "\t%s=%d\n", "deadlineForStonewall", test->deadlineForStonewalling); - fprintf(out_logfile, "\t%s=%d\n", "stoneWallingWearOut", test->stoneWallingWearOut); - fprintf(out_logfile, "\t%s=%d\n", "maxTimeDuration", test->maxTimeDuration); - fprintf(out_logfile, "\t%s=%d\n", "outlierThreshold", + fprintf(out_resultfile, "\t%s=%d\n", "stoneWallingWearOut", test->stoneWallingWearOut); + fprintf(out_resultfile, "\t%s=%d\n", "maxTimeDuration", test->maxTimeDuration); + fprintf(out_resultfile, "\t%s=%d\n", "outlierThreshold", test->outlierThreshold); - fprintf(out_logfile, "\t%s=%s\n", "options", test->options); - fprintf(out_logfile, "\t%s=%d\n", "nodes", test->nodes); - fprintf(out_logfile, "\t%s=%lu\n", "memoryPerTask", (unsigned long) test->memoryPerTask); - fprintf(out_logfile, "\t%s=%lu\n", "memoryPerNode", (unsigned long) test->memoryPerNode); - fprintf(out_logfile, "\t%s=%d\n", "tasksPerNode", tasksPerNode); - fprintf(out_logfile, "\t%s=%d\n", "repetitions", test->repetitions); - fprintf(out_logfile, "\t%s=%d\n", "multiFile", test->multiFile); - fprintf(out_logfile, "\t%s=%d\n", "interTestDelay", test->interTestDelay); - fprintf(out_logfile, "\t%s=%d\n", "fsync", test->fsync); - fprintf(out_logfile, "\t%s=%d\n", "fsYncperwrite", test->fsyncPerWrite); - fprintf(out_logfile, "\t%s=%d\n", "useExistingTestFile", + fprintf(out_resultfile, "\t%s=%s\n", "options", test->options); + fprintf(out_resultfile, "\t%s=%d\n", "nodes", test->nodes); + fprintf(out_resultfile, "\t%s=%lu\n", "memoryPerTask", (unsigned long) test->memoryPerTask); + fprintf(out_resultfile, "\t%s=%lu\n", "memoryPerNode", (unsigned long) test->memoryPerNode); + fprintf(out_resultfile, "\t%s=%d\n", "tasksPerNode", tasksPerNode); + fprintf(out_resultfile, "\t%s=%d\n", "repetitions", test->repetitions); + fprintf(out_resultfile, "\t%s=%d\n", "multiFile", test->multiFile); + fprintf(out_resultfile, "\t%s=%d\n", "interTestDelay", test->interTestDelay); + fprintf(out_resultfile, "\t%s=%d\n", "fsync", test->fsync); + fprintf(out_resultfile, "\t%s=%d\n", "fsYncperwrite", test->fsyncPerWrite); + fprintf(out_resultfile, "\t%s=%d\n", "useExistingTestFile", test->useExistingTestFile); - fprintf(out_logfile, "\t%s=%d\n", "showHints", test->showHints); - fprintf(out_logfile, "\t%s=%d\n", "uniqueDir", test->uniqueDir); - fprintf(out_logfile, "\t%s=%d\n", "showHelp", test->showHelp); - fprintf(out_logfile, "\t%s=%d\n", "individualDataSets", + fprintf(out_resultfile, "\t%s=%d\n", "showHints", test->showHints); + fprintf(out_resultfile, "\t%s=%d\n", "uniqueDir", test->uniqueDir); + fprintf(out_resultfile, "\t%s=%d\n", "showHelp", test->showHelp); + fprintf(out_resultfile, "\t%s=%d\n", "individualDataSets", test->individualDataSets); - fprintf(out_logfile, "\t%s=%d\n", "singleXferAttempt", + fprintf(out_resultfile, "\t%s=%d\n", "singleXferAttempt", test->singleXferAttempt); - fprintf(out_logfile, "\t%s=%d\n", "readFile", test->readFile); - fprintf(out_logfile, "\t%s=%d\n", "writeFile", test->writeFile); - fprintf(out_logfile, "\t%s=%d\n", "filePerProc", test->filePerProc); - fprintf(out_logfile, "\t%s=%d\n", "reorderTasks", test->reorderTasks); - fprintf(out_logfile, "\t%s=%d\n", "reorderTasksRandom", + fprintf(out_resultfile, "\t%s=%d\n", "readFile", test->readFile); + fprintf(out_resultfile, "\t%s=%d\n", "writeFile", test->writeFile); + fprintf(out_resultfile, "\t%s=%d\n", "filePerProc", test->filePerProc); + fprintf(out_resultfile, "\t%s=%d\n", "reorderTasks", test->reorderTasks); + fprintf(out_resultfile, "\t%s=%d\n", "reorderTasksRandom", test->reorderTasksRandom); - fprintf(out_logfile, "\t%s=%d\n", "reorderTasksRandomSeed", + fprintf(out_resultfile, "\t%s=%d\n", "reorderTasksRandomSeed", test->reorderTasksRandomSeed); - fprintf(out_logfile, "\t%s=%d\n", "randomOffset", test->randomOffset); - fprintf(out_logfile, "\t%s=%d\n", "checkWrite", test->checkWrite); - fprintf(out_logfile, "\t%s=%d\n", "checkRead", test->checkRead); - fprintf(out_logfile, "\t%s=%d\n", "preallocate", test->preallocate); - fprintf(out_logfile, "\t%s=%d\n", "useFileView", test->useFileView); - fprintf(out_logfile, "\t%s=%lld\n", "setAlignment", test->setAlignment); - fprintf(out_logfile, "\t%s=%d\n", "storeFileOffset", test->storeFileOffset); - fprintf(out_logfile, "\t%s=%d\n", "useSharedFilePointer", + fprintf(out_resultfile, "\t%s=%d\n", "randomOffset", test->randomOffset); + fprintf(out_resultfile, "\t%s=%d\n", "checkWrite", test->checkWrite); + fprintf(out_resultfile, "\t%s=%d\n", "checkRead", test->checkRead); + fprintf(out_resultfile, "\t%s=%d\n", "preallocate", test->preallocate); + fprintf(out_resultfile, "\t%s=%d\n", "useFileView", test->useFileView); + fprintf(out_resultfile, "\t%s=%lld\n", "setAlignment", test->setAlignment); + fprintf(out_resultfile, "\t%s=%d\n", "storeFileOffset", test->storeFileOffset); + fprintf(out_resultfile, "\t%s=%d\n", "useSharedFilePointer", test->useSharedFilePointer); - fprintf(out_logfile, "\t%s=%d\n", "useO_DIRECT", test->useO_DIRECT); - fprintf(out_logfile, "\t%s=%d\n", "useStridedDatatype", + fprintf(out_resultfile, "\t%s=%d\n", "useO_DIRECT", test->useO_DIRECT); + fprintf(out_resultfile, "\t%s=%d\n", "useStridedDatatype", test->useStridedDatatype); - fprintf(out_logfile, "\t%s=%d\n", "keepFile", test->keepFile); - fprintf(out_logfile, "\t%s=%d\n", "keepFileWithError", + fprintf(out_resultfile, "\t%s=%d\n", "keepFile", test->keepFile); + fprintf(out_resultfile, "\t%s=%d\n", "keepFileWithError", test->keepFileWithError); - fprintf(out_logfile, "\t%s=%d\n", "quitOnError", test->quitOnError); - fprintf(out_logfile, "\t%s=%d\n", "verbose", verbose); - fprintf(out_logfile, "\t%s=%s\n", "data packet type", data_packets[test->dataPacketType]); - fprintf(out_logfile, "\t%s=%d\n", "setTimeStampSignature/incompressibleSeed", + fprintf(out_resultfile, "\t%s=%d\n", "quitOnError", test->quitOnError); + fprintf(out_resultfile, "\t%s=%d\n", "verbose", verbose); + fprintf(out_resultfile, "\t%s=%s\n", "data packet type", data_packets[test->dataPacketType]); + fprintf(out_resultfile, "\t%s=%d\n", "setTimeStampSignature/incompressibleSeed", test->setTimeStampSignature); /* Seed value was copied into setTimeStampSignature as well */ - fprintf(out_logfile, "\t%s=%d\n", "collective", test->collective); - fprintf(out_logfile, "\t%s=%lld", "segmentCount", test->segmentCount); + fprintf(out_resultfile, "\t%s=%d\n", "collective", test->collective); + fprintf(out_resultfile, "\t%s=%lld", "segmentCount", test->segmentCount); #ifdef HAVE_GPFS_FCNTL_H - fprintf(out_logfile, "\t%s=%d\n", "gpfsHintAccess", test->gpfs_hint_access); - fprintf(out_logfile, "\t%s=%d\n", "gpfsReleaseToken", test->gpfs_release_token); + fprintf(out_resultfile, "\t%s=%d\n", "gpfsHintAccess", test->gpfs_hint_access); + fprintf(out_resultfile, "\t%s=%d\n", "gpfsReleaseToken", test->gpfs_release_token); #endif if (strcasecmp(test->api, "HDF5") == 0) { - fprintf(out_logfile, " (datasets)"); + fprintf(out_resultfile, " (datasets)"); } - fprintf(out_logfile, "\n"); - fprintf(out_logfile, "\t%s=%lld\n", "transferSize", test->transferSize); - fprintf(out_logfile, "\t%s=%lld\n", "blockSize", test->blockSize); + fprintf(out_resultfile, "\n"); + fprintf(out_resultfile, "\t%s=%lld\n", "transferSize", test->transferSize); + fprintf(out_resultfile, "\t%s=%lld\n", "blockSize", test->blockSize); } @@ -294,33 +305,33 @@ void PrintLongSummaryOneOperation(IOR_test_t *test, double *times, char *operati ops = ops_values(reps, results->aggFileSizeForBW, params->transferSize, times); - fprintf(out_logfile, "%-9s ", operation); - fprintf(out_logfile, "%10.2f ", bw->max / MEBIBYTE); - fprintf(out_logfile, "%10.2f ", bw->min / MEBIBYTE); - fprintf(out_logfile, "%10.2f ", bw->mean / MEBIBYTE); - fprintf(out_logfile, "%10.2f ", bw->sd / MEBIBYTE); - fprintf(out_logfile, "%10.2f ", ops->max); - fprintf(out_logfile, "%10.2f ", ops->min); - fprintf(out_logfile, "%10.2f ", ops->mean); - fprintf(out_logfile, "%10.2f ", ops->sd); - fprintf(out_logfile, "%10.5f ", mean_of_array_of_doubles(times, reps)); - fprintf(out_logfile, "%5d ", params->id); - fprintf(out_logfile, "%6d ", params->numTasks); - fprintf(out_logfile, "%3d ", params->tasksPerNode); - fprintf(out_logfile, "%4d ", params->repetitions); - fprintf(out_logfile, "%3d ", params->filePerProc); - fprintf(out_logfile, "%5d ", params->reorderTasks); - fprintf(out_logfile, "%8d ", params->taskPerNodeOffset); - fprintf(out_logfile, "%9d ", params->reorderTasksRandom); - fprintf(out_logfile, "%4d ", params->reorderTasksRandomSeed); - fprintf(out_logfile, "%6lld ", params->segmentCount); - fprintf(out_logfile, "%8lld ", params->blockSize); - fprintf(out_logfile, "%8lld ", params->transferSize); - fprintf(out_logfile, "%9.1f ", (float)results->aggFileSizeForBW[0] / MEBIBYTE); - fprintf(out_logfile, "%3s ", params->api); - fprintf(out_logfile, "%6d", params->referenceNumber); - fprintf(out_logfile, "\n"); - fflush(out_logfile); + fprintf(out_resultfile, "%-9s ", operation); + fprintf(out_resultfile, "%10.2f ", bw->max / MEBIBYTE); + fprintf(out_resultfile, "%10.2f ", bw->min / MEBIBYTE); + fprintf(out_resultfile, "%10.2f ", bw->mean / MEBIBYTE); + fprintf(out_resultfile, "%10.2f ", bw->sd / MEBIBYTE); + fprintf(out_resultfile, "%10.2f ", ops->max); + fprintf(out_resultfile, "%10.2f ", ops->min); + fprintf(out_resultfile, "%10.2f ", ops->mean); + fprintf(out_resultfile, "%10.2f ", ops->sd); + fprintf(out_resultfile, "%10.5f ", mean_of_array_of_doubles(times, reps)); + fprintf(out_resultfile, "%5d ", params->id); + fprintf(out_resultfile, "%6d ", params->numTasks); + fprintf(out_resultfile, "%3d ", params->tasksPerNode); + fprintf(out_resultfile, "%4d ", params->repetitions); + fprintf(out_resultfile, "%3d ", params->filePerProc); + fprintf(out_resultfile, "%5d ", params->reorderTasks); + fprintf(out_resultfile, "%8d ", params->taskPerNodeOffset); + fprintf(out_resultfile, "%9d ", params->reorderTasksRandom); + fprintf(out_resultfile, "%4d ", params->reorderTasksRandomSeed); + fprintf(out_resultfile, "%6lld ", params->segmentCount); + fprintf(out_resultfile, "%8lld ", params->blockSize); + fprintf(out_resultfile, "%8lld ", params->transferSize); + fprintf(out_resultfile, "%9.1f ", (float)results->aggFileSizeForBW[0] / MEBIBYTE); + fprintf(out_resultfile, "%3s ", params->api); + fprintf(out_resultfile, "%6d", params->referenceNumber); + fprintf(out_resultfile, "\n"); + fflush(out_resultfile); free(bw); free(ops); @@ -342,15 +353,15 @@ void PrintLongSummaryHeader() if (rank != 0 || verbose < VERBOSE_0) return; - fprintf(out_logfile, "\n"); - fprintf(out_logfile, "%-9s %10s %10s %10s %10s %10s %10s %10s %10s %10s", + fprintf(out_resultfile, "\n"); + fprintf(out_resultfile, "%-9s %10s %10s %10s %10s %10s %10s %10s %10s %10s", "Operation", "Max(MiB)", "Min(MiB)", "Mean(MiB)", "StdDev", "Max(OPs)", "Min(OPs)", "Mean(OPs)", "StdDev", "Mean(s)"); - fprintf(out_logfile, " Test# #Tasks tPN reps fPP reord reordoff reordrand seed" + fprintf(out_resultfile, " Test# #Tasks tPN reps fPP reord reordoff reordrand seed" " segcnt "); - fprintf(out_logfile, "%8s %8s %9s %5s", " blksiz", "xsize","aggs(MiB)", "API"); - fprintf(out_logfile, " RefNum\n"); + fprintf(out_resultfile, "%8s %8s %9s %5s", " blksiz", "xsize","aggs(MiB)", "API"); + fprintf(out_resultfile, " RefNum\n"); } void PrintLongSummaryAllTests(IOR_test_t *tests_head) @@ -359,8 +370,8 @@ void PrintLongSummaryAllTests(IOR_test_t *tests_head) if (rank != 0 || verbose < VERBOSE_0) return; - fprintf(out_logfile, "\n"); - fprintf(out_logfile, "Summary of all tests:"); + fprintf(out_resultfile, "\n"); + fprintf(out_resultfile, "Summary of all tests:"); PrintLongSummaryHeader(); for (tptr = tests_head; tptr != NULL; tptr = tptr->next) { @@ -392,13 +403,13 @@ void PrintShortSummary(IOR_test_t * test) max_read = MAX(bw, max_read); } - fprintf(out_logfile, "\n"); + fprintf(out_resultfile, "\n"); if (params->writeFile) { - fprintf(out_logfile, "Max Write: %.2f MiB/sec (%.2f MB/sec)\n", + fprintf(out_resultfile, "Max Write: %.2f MiB/sec (%.2f MB/sec)\n", max_write/MEBIBYTE, max_write/MEGABYTE); } if (params->readFile) { - fprintf(out_logfile, "Max Read: %.2f MiB/sec (%.2f MB/sec)\n", + fprintf(out_resultfile, "Max Read: %.2f MiB/sec (%.2f MB/sec)\n", max_read/MEBIBYTE, max_read/MEGABYTE); } } @@ -442,9 +453,9 @@ void PrintRemoveTiming(double start, double finish, int rep) if (rank != 0 || verbose < VERBOSE_0) return; - fprintf(out_logfile, "remove - - - - - - "); + fprintf(out_resultfile, "remove - - - - - - "); PPDouble(1, finish-start, " "); - fprintf(out_logfile, "%-4d\n", rep); + fprintf(out_resultfile, "%-4d\n", rep); } @@ -460,7 +471,7 @@ static void PPDouble(int leftjustify, double number, char *append) int precision; if (number < 0) { - fprintf(out_logfile, " - %s", append); + fprintf(out_resultfile, " - %s", append); return; } @@ -475,7 +486,7 @@ static void PPDouble(int leftjustify, double number, char *append) leftjustify ? "-" : "", width, precision); - fprintf(out_logfile, format, number, append); + fprintf(out_resultfile, format, number, append); } diff --git a/src/ior.c b/src/ior.c index 5d2902e..394cb0d 100755 --- a/src/ior.c +++ b/src/ior.c @@ -56,6 +56,7 @@ IOR_test_t * ior_run(int argc, char **argv, MPI_Comm world_com, FILE * world_out IOR_test_t *tests_head; IOR_test_t *tptr; out_logfile = world_out; + out_resultfile = world_out; mpi_comm_world = world_com; MPI_CHECK(MPI_Comm_size(mpi_comm_world, &numTasksWorld), "cannot get number of tasks"); @@ -122,6 +123,7 @@ int ior_main(int argc, char **argv) IOR_test_t *tptr; out_logfile = stdout; + out_resultfile = stdout; /* * check -h option from commandline without starting MPI; @@ -213,8 +215,7 @@ int ior_main(int argc, char **argv) /* display finish time */ if (rank == 0 && verbose >= VERBOSE_0) { - fprintf(out_logfile, "\n"); - fprintf(out_logfile, "Finished: %s", CurrentTimeString()); + PrintTestEnds(); } DestroyTests(tests_head); @@ -730,6 +731,8 @@ static void DisplayUsage(char **argv) " -Y fsyncPerWrite -- perform fsync/msync after each POSIX/MMAP write", " -z randomOffset -- access is to random, not sequential, offsets within a file", " -Z reorderTasksRandom -- changes task ordering to random ordering for readback", + " -O summaryFile=FILE -- store result data into this file", + " -O summaryFormat=[default,JSON,CSV] -- use the format for outputing the summary", " ", " NOTE: S is a string, N is an integer number.", " ", @@ -1407,9 +1410,7 @@ static void TestIoSys(IOR_test_t *test) } } if (rep == 0 && verbose >= VERBOSE_0) { - fprintf(out_logfile, "\n"); - fprintf(out_logfile, "access bw(MiB/s) block(KiB) xfer(KiB) open(s) wr/rd(s) close(s) total(s) iter\n"); - fprintf(out_logfile, "------ --------- ---------- --------- -------- -------- -------- -------- ----\n"); + PrintTableHeader(); } } MPI_CHECK(MPI_Bcast diff --git a/src/parse_options.c b/src/parse_options.c index 6c0d881..cdb7a57 100755 --- a/src/parse_options.c +++ b/src/parse_options.c @@ -171,8 +171,8 @@ void DecodeDirective(char *line, IOR_param_t *params) if (strcasecmp(option, "api") == 0) { strcpy(params->api, value); } else if (strcasecmp(option, "summaryFile") == 0) { - out_logfile = fopen(value, "w"); - if (out_logfile == NULL){ + out_resultfile = fopen(value, "w"); + if (out_resultfile == NULL){ FAIL("Cannot open output file for writes!"); } printf("Writing output to %s\n", value); diff --git a/src/utilities.c b/src/utilities.c index 623d36d..41c996f 100755 --- a/src/utilities.c +++ b/src/utilities.c @@ -57,6 +57,7 @@ int verbose = VERBOSE_0; /* verbose output */ MPI_Comm testComm; MPI_Comm mpi_comm_world; FILE * out_logfile; +FILE * out_resultfile; enum OutputFormat_t outputFormat; /***************************** F U N C T I O N S ******************************/ diff --git a/src/utilities.h b/src/utilities.h index 941a066..7933cbc 100755 --- a/src/utilities.h +++ b/src/utilities.h @@ -26,6 +26,7 @@ extern int verbose; extern MPI_Comm testComm; extern MPI_Comm mpi_comm_world; extern FILE * out_logfile; +extern FILE * out_resultfile; extern enum OutputFormat_t outputFormat; /* format of the output */ /*