IOR
ior-output.c
Go to the documentation of this file.
1 #ifndef _WIN32
2 # include <sys/utsname.h> /* uname() */
3 #endif
4 
5 #include <math.h>
6 #include <stddef.h> /* needed for offsetof on some compilers */
7 
8 #include "ior.h"
9 #include "ior-internal.h"
10 #include "utilities.h"
11 
12 extern char **environ;
13 
14 static double mean_of_array_of_doubles(double *values, int len);
15 static void PPDouble(int leftjustify, double number, char *append);
16 static void PrintNextToken();
17 
20  fprintf(out_resultfile, "\n");
21  fprintf(out_resultfile, "access bw(MiB/s) IOPS Latency(s) block(KiB) xfer(KiB) open(s) wr/rd(s) close(s) total(s) iter\n");
22  fprintf(out_resultfile, "------ --------- ---- ---------- ---------- --------- -------- -------- -------- -------- ----\n");
23  }else if(outputFormat == OUTPUT_CSV){
24  fprintf(out_resultfile, "access,bw(MiB/s),IOPS,Latency,block(KiB),xfer(KiB),open(s),wr/rd(s),close(s),total(s),iter\n");
25  }
26 }
27 
28 static int indent = 0;
29 static int needNextToken = 0;
30 
31 static void PrintIndent(){
33  return;
34  }
35  for(int i=0; i < indent; i++){
36  fprintf(out_resultfile, " ");
37  }
38 }
39 
40 
41 static void PrintKeyValStart(char * key){
44  PrintIndent();
45  fprintf(out_resultfile, "%-20s: ", key);
46  return;
47  }
49  fprintf(out_resultfile, "\"%s\": \"", key);
50  }
51 }
52 
53 static void PrintNextToken(){
54  if(needNextToken){
55  needNextToken = 0;
57  fprintf(out_resultfile, ", \n");
58  }
59  }
60  PrintIndent();
61 }
62 
63 static void PrintKeyValEnd(){
65  fprintf(out_resultfile, "\"");
66  }
68  fprintf(out_resultfile, "\n");
69  }
70  needNextToken = 1;
71 }
72 
73 static void PrintKeyVal(char * key, char * value){
74  if(value != NULL && value[0] != 0 && value[strlen(value) -1 ] == '\n'){
75  // remove \n
76  value[strlen(value) -1 ] = 0;
77  }
79  needNextToken = 1;
81  fprintf(out_resultfile, "%-20s: %s\n", key, value);
82  return;
83  }
85  fprintf(out_resultfile, "\"%s\": \"%s\"", key, value);
86  }else if(outputFormat == OUTPUT_CSV){
87  fprintf(out_resultfile, "%s,", value);
88  }
89 }
90 
91 static void PrintKeyValDouble(char * key, double value){
93  needNextToken = 1;
95  fprintf(out_resultfile, "%-20s: %.4f\n", key, value);
96  return;
97  }
99  fprintf(out_resultfile, "\"%s\": %.4f", key, value);
100  }else if(outputFormat == OUTPUT_CSV){
101  fprintf(out_resultfile, "%.4f,", value);
102  }
103 }
104 
105 
106 static void PrintKeyValInt(char * key, int64_t value){
107  PrintNextToken();
108  needNextToken = 1;
110  fprintf(out_resultfile, "%-20s: %lld\n", key, (long long) value);
111  return;
112  }
113  if(outputFormat == OUTPUT_JSON){
114  fprintf(out_resultfile, "\"%s\": %lld", key, (long long) value);
115  }else if(outputFormat == OUTPUT_CSV){
116  fprintf(out_resultfile, "%lld,", (long long) value);
117  }
118 }
119 
120 static void PrintStartSection(){
121  PrintNextToken();
122  needNextToken = 0;
123  if(outputFormat == OUTPUT_JSON){
124  PrintIndent();
125  fprintf(out_resultfile, "{\n");
126  }
127  indent++;
128 }
129 
130 static void PrintNamedSectionStart(char * key){
131  PrintNextToken();
132  needNextToken = 0;
133  indent++;
134 
135  if(outputFormat == OUTPUT_JSON){
136  fprintf(out_resultfile, "\"%s\": {\n", key);
137  }else if(outputFormat == OUTPUT_DEFAULT){
138  fprintf(out_resultfile, "\n%s: \n", key);
139  }
140 }
141 
142 static void PrintNamedArrayStart(char * key){
143  PrintNextToken();
144  needNextToken = 0;
145  indent++;
146  if(outputFormat == OUTPUT_JSON){
147  fprintf(out_resultfile, "\"%s\": [\n", key);
148  }else if(outputFormat == OUTPUT_DEFAULT){
149  fprintf(out_resultfile, "\n%s: \n", key);
150  }
151 }
152 
153 static void PrintEndSection(){
154  if (rank != 0)
155  return;
156 
157  indent--;
158  if(outputFormat == OUTPUT_JSON){
159  fprintf(out_resultfile, "\n");
160  PrintIndent();
161  fprintf(out_resultfile, "}\n");
162  }
163  needNextToken = 1;
164 }
165 
166 static void PrintArrayStart(){
167  if (rank != 0)
168  return;
169  PrintNextToken();
170  needNextToken = 0;
171  if(outputFormat == OUTPUT_JSON){
172  fprintf(out_resultfile, "[ ");
173  }
174 }
175 
176 static void PrintArrayNamedStart(char * key){
177  if (rank != 0)
178  return;
179  PrintNextToken();
180  needNextToken = 0;
181  if(outputFormat == OUTPUT_JSON){
182  fprintf(out_resultfile, "\"%s\": [\n", key);
183  }
184 }
185 
186 static void PrintArrayEnd(){
187  if (rank != 0)
188  return;
189 
190  indent--;
191  if(outputFormat == OUTPUT_JSON){
192  fprintf(out_resultfile, "]\n");
193  }
194  needNextToken = 1;
195 }
196 
198  if (rank != 0)
199  return;
200  PrintArrayEnd();
201 }
202 
204  if (rank != 0)
205  return;
207  return;
208  }
209  PrintArrayStart();
210 }
211 
213  if (outputFormat == OUTPUT_CSV){
214  return;
215  }
216  if (rank != 0 || verbose <= VERBOSE_0) {
217  PrintEndSection();
218  return;
219  }
220 
221  PrintKeyVal("Finished", CurrentTimeString());
222  PrintEndSection();
223 }
224 
225 void PrintReducedResult(IOR_test_t *test, int access, double bw, double iops, double latency,
226  double *diff_subset, double totalTime, int rep){
228  fprintf(out_resultfile, "%-10s", access == WRITE ? "write" : "read");
229  PPDouble(1, bw / MEBIBYTE, " ");
230  PPDouble(1, iops, " ");
231  PPDouble(1, latency, " ");
232  PPDouble(1, (double)test->params.blockSize / KIBIBYTE, " ");
233  PPDouble(1, (double)test->params.transferSize / KIBIBYTE, " ");
234  PPDouble(1, diff_subset[0], " ");
235  PPDouble(1, diff_subset[1], " ");
236  PPDouble(1, diff_subset[2], " ");
237  PPDouble(1, totalTime, " ");
238  fprintf(out_resultfile, "%-4d\n", rep);
239  }else if (outputFormat == OUTPUT_JSON){
241  PrintKeyVal("access", access == WRITE ? "write" : "read");
242  PrintKeyValDouble("bwMiB", bw / MEBIBYTE);
243  PrintKeyValDouble("blockKiB", (double)test->params.blockSize / KIBIBYTE);
244  PrintKeyValDouble("xferKiB", (double)test->params.transferSize / KIBIBYTE);
245  PrintKeyValDouble("iops", iops);
246  PrintKeyValDouble("latency", latency);
247  PrintKeyValDouble("openTime", diff_subset[0]);
248  PrintKeyValDouble("wrRdTime", diff_subset[1]);
249  PrintKeyValDouble("closeTime", diff_subset[2]);
250  PrintKeyValDouble("totalTime", totalTime);
251  PrintEndSection();
252  }else if (outputFormat == OUTPUT_CSV){
253  PrintKeyVal("access", access == WRITE ? "write" : "read");
254  PrintKeyValDouble("bwMiB", bw / MEBIBYTE);
255  PrintKeyValDouble("iops", iops);
256  PrintKeyValDouble("latency", latency);
257  PrintKeyValDouble("blockKiB", (double)test->params.blockSize / KIBIBYTE);
258  PrintKeyValDouble("xferKiB", (double)test->params.transferSize / KIBIBYTE);
259  PrintKeyValDouble("openTime", diff_subset[0]);
260  PrintKeyValDouble("wrRdTime", diff_subset[1]);
261  PrintKeyValDouble("closeTime", diff_subset[2]);
262  PrintKeyValDouble("totalTime", totalTime);
263  fprintf(out_resultfile, "%d\n", rep);
264  }
265 
266  fflush(out_resultfile);
267 }
268 
269 void PrintHeader(int argc, char **argv)
270 {
271  struct utsname unamebuf;
272  int i;
273 
274  if (rank != 0)
275  return;
276 
277  if (outputFormat == OUTPUT_CSV){
278  return;
279  }
280 
283  PrintKeyVal("Version", META_VERSION);
284  }else{
285  fprintf(out_resultfile, "IOR-" META_VERSION ": MPI Coordinated Test of Parallel I/O\n");
286  }
287  PrintKeyVal("Began", CurrentTimeString());
288  PrintKeyValStart("Command line");
289  fprintf(out_resultfile, "%s", argv[0]);
290  for (i = 1; i < argc; i++) {
291  fprintf(out_resultfile, " %s", argv[i]);
292  }
293  PrintKeyValEnd();
294  if (uname(&unamebuf) != 0) {
295  EWARN("uname failed");
296  PrintKeyVal("Machine", "Unknown");
297  } else {
298  PrintKeyValStart("Machine");
299  fprintf(out_resultfile, "%s %s", unamebuf.sysname,
300  unamebuf.nodename);
301  if (verbose >= VERBOSE_2) {
302  fprintf(out_resultfile, " %s %s %s", unamebuf.release,
303  unamebuf.version, unamebuf.machine);
304  }
305  PrintKeyValEnd();
306  }
307  if (verbose >= VERBOSE_3) { /* show env */
308  fprintf(out_logfile, "STARTING ENVIRON LOOP\n");
309  for (i = 0; environ[i] != NULL; i++) {
310  fprintf(out_logfile, "%s\n", environ[i]);
311  }
312  fprintf(out_logfile, "ENDING ENVIRON LOOP\n");
313  }
314 
315  PrintArrayNamedStart("tests");
316  fflush(out_resultfile);
317  fflush(out_logfile);
318 }
319 
320 /*
321  * Print header information for test output.
322  */
324 {
325  if (outputFormat == OUTPUT_CSV){
326  return;
327  }
329  PrintKeyValInt("TestID", test->id);
330  PrintKeyVal("StartTime", CurrentTimeString());
331 
332  char filename[MAX_PATHLEN];
333  GetTestFileName(filename, test);
334  ShowFileSystemSize(filename, test->backend, test->backend_options);
335 
336  if (verbose >= VERBOSE_3 || outputFormat == OUTPUT_JSON) {
337  char* data_packets[] = {"g","t","o","i"};
338 
339  PrintNamedSectionStart("Parameters");
340  PrintKeyValInt("testID", test->id);
341  PrintKeyValInt("refnum", test->referenceNumber);
342  PrintKeyVal("api", test->api);
343  PrintKeyVal("platform", test->platform);
344  PrintKeyVal("testFileName", test->testFileName);
345  PrintKeyValInt("deadlineForStonewall", test->deadlineForStonewalling);
346  PrintKeyValInt("stoneWallingWearOut", test->stoneWallingWearOut);
347  PrintKeyValInt("maxTimeDuration", test->maxTimeDuration);
348  PrintKeyValInt("outlierThreshold", test->outlierThreshold);
349 
350  PrintKeyVal("options", test->options);
351  PrintKeyValInt("dryRun", test->dryRun);
352  PrintKeyValInt("nodes", test->numNodes);
353  PrintKeyValInt("memoryPerTask", (unsigned long) test->memoryPerTask);
354  PrintKeyValInt("memoryPerNode", (unsigned long) test->memoryPerNode);
355  PrintKeyValInt("tasksPerNode", test->numTasksOnNode0);
356  PrintKeyValInt("repetitions", test->repetitions);
357  PrintKeyValInt("multiFile", test->multiFile);
358  PrintKeyValInt("interTestDelay", test->interTestDelay);
359  PrintKeyValInt("fsync", test->fsync);
360  PrintKeyValInt("fsyncperwrite", test->fsyncPerWrite);
361  PrintKeyValInt("useExistingTestFile", test->useExistingTestFile);
362  PrintKeyValInt("uniqueDir", test->uniqueDir);
363  PrintKeyValInt("singleXferAttempt", test->singleXferAttempt);
364  PrintKeyValInt("readFile", test->readFile);
365  PrintKeyValInt("writeFile", test->writeFile);
366  PrintKeyValInt("filePerProc", test->filePerProc);
367  PrintKeyValInt("reorderTasks", test->reorderTasks);
368  PrintKeyValInt("reorderTasksRandom", test->reorderTasksRandom);
369  PrintKeyValInt("reorderTasksRandomSeed", test->reorderTasksRandomSeed);
370  PrintKeyValInt("randomOffset", test->randomOffset);
371  PrintKeyValInt("checkWrite", test->checkWrite);
372  PrintKeyValInt("checkRead", test->checkRead);
373  PrintKeyValInt("storeFileOffset", test->storeFileOffset);
374  PrintKeyValInt("keepFile", test->keepFile);
375  PrintKeyValInt("keepFileWithError", test->keepFileWithError);
376  PrintKeyValInt("warningAsErrors", test->warningAsErrors);
377  PrintKeyValInt("verbose", verbose);
378  PrintKeyVal("data packet type", data_packets[test->dataPacketType]);
379  PrintKeyValInt("setTimeStampSignature/incompressibleSeed", test->setTimeStampSignature); /* Seed value was copied into setTimeStampSignature as well */
380  PrintKeyValInt("collective", test->collective);
381  PrintKeyValInt("segmentCount", test->segmentCount);
382  //#ifdef HAVE_GPFS_FCNTL_H
383  //PrintKeyValInt("gpfsHintAccess", test->gpfs_hint_access);
384  //PrintKeyValInt("gpfsReleaseToken", test->gpfs_release_token);
385  //#endif
386  PrintKeyValInt("transferSize", test->transferSize);
387  PrintKeyValInt("blockSize", test->blockSize);
388  PrintEndSection();
389  }
390 
391  fflush(out_resultfile);
392 }
393 
395  if(rank == 0 && tptr->params.stoneWallingWearOut){
396 
397  size_t pairs_accessed = tptr->results->write.pairs_accessed;
398  if (tptr->params.stoneWallingStatusFile){
400  }else{
401  fprintf(out_logfile, "Pairs deadlineForStonewallingaccessed: %ld\n", pairs_accessed);
402  }
403  }
404  PrintEndSection();
405 }
406 
407 /*
408  * Show simple test output with max results for iterations.
409  */
410 void ShowSetup(IOR_param_t *params)
411 {
412  if (outputFormat == OUTPUT_CSV){
413  return;
414  }
415  if (params->debug) {
416  fprintf(out_logfile, "\n*** DEBUG MODE ***\n");
417  fprintf(out_logfile, "*** %s ***\n\n", params->debug);
418  }
419  PrintNamedSectionStart("Options");
420  PrintKeyVal("api", params->api);
421  PrintKeyVal("apiVersion", params->apiVersion);
422  PrintKeyVal("test filename", params->testFileName);
423  PrintKeyVal("access", params->filePerProc ? "file-per-process" : "single-shared-file");
424  PrintKeyVal("type", params->collective ? "collective" : "independent");
425  PrintKeyValInt("segments", params->segmentCount);
426  PrintKeyVal("ordering in a file", params->randomOffset ? "random" : "sequential");
427  if (params->reorderTasks == FALSE && params->reorderTasksRandom == FALSE) {
428  PrintKeyVal("ordering inter file", "no tasks offsets");
429  }
430  if (params->reorderTasks == TRUE) {
431  PrintKeyVal("ordering inter file", "constant task offset");
432  PrintKeyValInt("task offset", params->taskPerNodeOffset);
433  }
434  if (params->reorderTasksRandom == TRUE) {
435  PrintKeyVal("ordering inter file", "random task offset");
436  PrintKeyValInt("task offset", params->taskPerNodeOffset);
437  PrintKeyValInt("reorder random seed", params->reorderTasksRandomSeed);
438  }
439  PrintKeyValInt("nodes", params->numNodes);
440  PrintKeyValInt("tasks", params->numTasks);
441  PrintKeyValInt("clients per node", params->numTasksOnNode0);
442  if (params->memoryPerTask != 0){
443  PrintKeyVal("memoryPerTask", HumanReadable(params->memoryPerTask, BASE_TWO));
444  }
445  if (params->memoryPerNode != 0){
446  PrintKeyVal("memoryPerNode", HumanReadable(params->memoryPerNode, BASE_TWO));
447  }
448  PrintKeyValInt("repetitions", params->repetitions);
449  PrintKeyVal("xfersize", HumanReadable(params->transferSize, BASE_TWO));
450  PrintKeyVal("blocksize", HumanReadable(params->blockSize, BASE_TWO));
451  PrintKeyVal("aggregate filesize", HumanReadable(params->expectedAggFileSize, BASE_TWO));
452  if(params->dryRun){
453  PrintKeyValInt("dryRun", params->dryRun);
454  }
455  if(params->verbose) {
456  PrintKeyValInt("verbose", params->verbose);
457  }
458 
459  if (params->deadlineForStonewalling > 0) {
460  PrintKeyValInt("stonewallingTime", params->deadlineForStonewalling);
461  PrintKeyValInt("stoneWallingWearOut", params->stoneWallingWearOut );
462  }
463  PrintEndSection();
464 
465  PrintNamedArrayStart("Results");
466 
467  fflush(out_resultfile);
468 }
469 
470 static struct results *bw_ops_values(const int reps, IOR_results_t *measured,
471  IOR_offset_t transfer_size,
472  const double *vals, const int access)
473 {
474  struct results *r;
475  int i;
476 
477  r = (struct results *)malloc(sizeof(struct results)
478  + (reps * sizeof(double)));
479  if (r == NULL)
480  ERR("malloc failed");
481  r->val = (double *)&r[1];
482 
483  for (i = 0; i < reps; i++, measured++) {
484  IOR_point_t *point = (access == WRITE) ? &measured->write :
485  &measured->read;
486 
487  r->val[i] = ((double) (point->aggFileSizeForBW))
488  / transfer_size / vals[i];
489 
490  if (i == 0) {
491  r->min = r->val[i];
492  r->max = r->val[i];
493  r->sum = 0.0;
494  }
495  r->min = MIN(r->min, r->val[i]);
496  r->max = MAX(r->max, r->val[i]);
497  r->sum += r->val[i];
498  }
499  r->mean = r->sum / reps;
500  r->var = 0.0;
501  for (i = 0; i < reps; i++) {
502  r->var += pow((r->mean - r->val[i]), 2);
503  }
504  r->var = r->var / reps;
505  r->sd = sqrt(r->var);
506 
507  return r;
508 }
509 
510 static struct results *bw_values(const int reps, IOR_results_t *measured,
511  const double *vals, const int access)
512 {
513  return bw_ops_values(reps, measured, 1, vals, access);
514 }
515 
516 static struct results *ops_values(const int reps, IOR_results_t *measured,
517  IOR_offset_t transfer_size,
518  const double *vals, const int access)
519 {
520  return bw_ops_values(reps, measured, transfer_size, vals, access);
521 }
522 
523 /*
524  * Summarize results
525  */
526 static void PrintLongSummaryOneOperation(IOR_test_t *test, const int access)
527 {
528  IOR_param_t *params = &test->params;
529  IOR_results_t *results = test->results;
530  struct results *bw;
531  struct results *ops;
532 
533  int reps;
534  if (rank != 0 || verbose <= VERBOSE_0)
535  return;
536 
537  reps = params->repetitions;
538 
539  double * times = malloc(sizeof(double)* reps);
540  long long stonewall_avg_data_accessed = 0;
541  double stonewall_time = 0;
542  for(int i=0; i < reps; i++){
543  IOR_point_t *point = (access == WRITE) ? &results[i].write :
544  &results[i].read;
545  times[i] = point->time;
546  stonewall_time += point->stonewall_time;
547  stonewall_avg_data_accessed += point->stonewall_avg_data_accessed;
548  }
549 
550  bw = bw_values(reps, results, times, access);
551  ops = ops_values(reps, results, params->transferSize, times, access);
552 
553  IOR_point_t *point = (access == WRITE) ? &results[0].write :
554  &results[0].read;
555 
556 
558  fprintf(out_resultfile, "%-9s ", access == WRITE ? "write" : "read");
559  fprintf(out_resultfile, "%10.2f ", bw->max / MEBIBYTE);
560  fprintf(out_resultfile, "%10.2f ", bw->min / MEBIBYTE);
561  fprintf(out_resultfile, "%10.2f ", bw->mean / MEBIBYTE);
562  fprintf(out_resultfile, "%10.2f ", bw->sd / MEBIBYTE);
563  fprintf(out_resultfile, "%10.2f ", ops->max);
564  fprintf(out_resultfile, "%10.2f ", ops->min);
565  fprintf(out_resultfile, "%10.2f ", ops->mean);
566  fprintf(out_resultfile, "%10.2f ", ops->sd);
567  fprintf(out_resultfile, "%10.5f ", mean_of_array_of_doubles(times, reps));
568  if(test->params.stoneWallingWearOut){
569  fprintf(out_resultfile, "%10.2f ", stonewall_time / reps);
570  fprintf(out_resultfile, "%13.2f ", stonewall_avg_data_accessed / stonewall_time / MEBIBYTE);
571  }else{
572  fprintf(out_resultfile, "%10s ", "NA");
573  fprintf(out_resultfile, "%13s ", "NA");
574  }
575  fprintf(out_resultfile, "%5d ", params->id);
576  fprintf(out_resultfile, "%6d ", params->numTasks);
577  fprintf(out_resultfile, "%3d ", params->numTasksOnNode0);
578  fprintf(out_resultfile, "%4d ", params->repetitions);
579  fprintf(out_resultfile, "%3d ", params->filePerProc);
580  fprintf(out_resultfile, "%5d ", params->reorderTasks);
581  fprintf(out_resultfile, "%8d ", params->taskPerNodeOffset);
582  fprintf(out_resultfile, "%9d ", params->reorderTasksRandom);
583  fprintf(out_resultfile, "%4d ", params->reorderTasksRandomSeed);
584  fprintf(out_resultfile, "%6lld ", params->segmentCount);
585  fprintf(out_resultfile, "%8lld ", params->blockSize);
586  fprintf(out_resultfile, "%8lld ", params->transferSize);
587  fprintf(out_resultfile, "%9.1f ", (float)point->aggFileSizeForBW / MEBIBYTE);
588  fprintf(out_resultfile, "%3s ", params->api);
589  fprintf(out_resultfile, "%6d", params->referenceNumber);
590  fprintf(out_resultfile, "\n");
591  }else if (outputFormat == OUTPUT_JSON){
593  PrintKeyVal("operation", access == WRITE ? "write" : "read");
594  PrintKeyVal("API", params->api);
595  PrintKeyValInt("TestID", params->id);
596  PrintKeyValInt("ReferenceNumber", params->referenceNumber);
597  PrintKeyValInt("segmentCount", params->segmentCount);
598  PrintKeyValInt("blockSize", params->blockSize);
599  PrintKeyValInt("transferSize", params->transferSize);
600  PrintKeyValInt("numTasks", params->numTasks);
601  PrintKeyValInt("tasksPerNode", params->numTasksOnNode0);
602  PrintKeyValInt("repetitions", params->repetitions);
603  PrintKeyValInt("filePerProc", params->filePerProc);
604  PrintKeyValInt("reorderTasks", params->reorderTasks);
605  PrintKeyValInt("taskPerNodeOffset", params->taskPerNodeOffset);
606  PrintKeyValInt("reorderTasksRandom", params->reorderTasksRandom);
607  PrintKeyValInt("reorderTasksRandomSeed", params->reorderTasksRandomSeed);
608  PrintKeyValDouble("bwMaxMIB", bw->max / MEBIBYTE);
609  PrintKeyValDouble("bwMinMIB", bw->min / MEBIBYTE);
610  PrintKeyValDouble("bwMeanMIB", bw->mean / MEBIBYTE);
611  PrintKeyValDouble("bwStdMIB", bw->sd / MEBIBYTE);
612  PrintKeyValDouble("OPsMax", ops->max);
613  PrintKeyValDouble("OPsMin", ops->min);
614  PrintKeyValDouble("OPsMean", ops->mean);
615  PrintKeyValDouble("OPsSD", ops->sd);
616  PrintKeyValDouble("MeanTime", mean_of_array_of_doubles(times, reps));
617  if(test->params.stoneWallingWearOut){
618  PrintKeyValDouble("StoneWallTime", stonewall_time / reps);
619  PrintKeyValDouble("StoneWallbwMeanMIB", stonewall_avg_data_accessed / stonewall_time / MEBIBYTE);
620  }
621  PrintKeyValDouble("xsizeMiB", (double) point->aggFileSizeForBW / MEBIBYTE);
622  PrintEndSection();
623  }
624 
625  fflush(out_resultfile);
626 
627  free(bw);
628  free(ops);
629  free(times);
630 }
631 
633 {
634  IOR_param_t *params = &test->params;
635 
636  if (params->writeFile)
638  if (params->readFile)
640 }
641 
643 {
644  if (rank != 0 || verbose <= VERBOSE_0)
645  return;
647  return;
648  }
649 
650  fprintf(out_resultfile, "\n");
651  fprintf(out_resultfile, "%-9s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %13s",
652  "Operation", "Max(MiB)", "Min(MiB)", "Mean(MiB)", "StdDev",
653  "Max(OPs)", "Min(OPs)", "Mean(OPs)", "StdDev",
654  "Mean(s)", "Stonewall(s)", "Stonewall(MiB)");
655  fprintf(out_resultfile, " Test# #Tasks tPN reps fPP reord reordoff reordrand seed"
656  " segcnt ");
657  fprintf(out_resultfile, "%8s %8s %9s %5s", " blksiz", "xsize","aggs(MiB)", "API");
658  fprintf(out_resultfile, " RefNum\n");
659 }
660 
662 {
663  IOR_test_t *tptr;
664  if (rank != 0 || verbose <= VERBOSE_0)
665  return;
666 
667  PrintArrayEnd();
668 
670  fprintf(out_resultfile, "\n");
671  fprintf(out_resultfile, "Summary of all tests:");
672  }else if (outputFormat == OUTPUT_JSON){
673  PrintNamedArrayStart("summary");
674  }
675 
677 
678  for (tptr = tests_head; tptr != NULL; tptr = tptr->next) {
680  }
681 
682  PrintArrayEnd();
683 }
684 
686 {
687  IOR_param_t *params = &test->params;
688  IOR_results_t *results = test->results;
689  double max_write_bw = 0.0;
690  double max_read_bw = 0.0;
691  double bw;
692  int reps;
693  int i;
694 
695  if (rank != 0 || verbose <= VERBOSE_0)
696  return;
697 
698  PrintArrayEnd();
699 
700  reps = params->repetitions;
701 
702  for (i = 0; i < reps; i++) {
703  bw = (double)results[i].write.aggFileSizeForBW / results[i].write.time;
704  max_write_bw = MAX(bw, max_write_bw);
705  bw = (double)results[i].read.aggFileSizeForBW / results[i].read.time;
706  max_read_bw = MAX(bw, max_read_bw);
707  }
708 
710  if (params->writeFile) {
711  fprintf(out_resultfile, "Max Write: %.2f MiB/sec (%.2f MB/sec)\n",
712  max_write_bw/MEBIBYTE, max_write_bw/MEGABYTE);
713  }
714  if (params->readFile) {
715  fprintf(out_resultfile, "Max Read: %.2f MiB/sec (%.2f MB/sec)\n",
716  max_read_bw/MEBIBYTE, max_read_bw/MEGABYTE);
717  }
718  }else if (outputFormat == OUTPUT_JSON){
719  PrintNamedSectionStart("max");
720  if (params->writeFile) {
721  PrintKeyValDouble("writeMiB", max_write_bw/MEBIBYTE);
722  PrintKeyValDouble("writeMB", max_write_bw/MEGABYTE);
723  }
724  if (params->readFile) {
725  PrintKeyValDouble("readMiB", max_read_bw/MEBIBYTE);
726  PrintKeyValDouble("readMB", max_read_bw/MEGABYTE);
727  }
728  PrintEndSection();
729  }
730 }
731 
732 void PrintRemoveTiming(double start, double finish, int rep)
733 {
734  if (rank != 0 || verbose <= VERBOSE_0)
735  return;
736 
738  fprintf(out_resultfile, "remove - - - - - - - - ");
739  PPDouble(1, finish-start, " ");
740  fprintf(out_resultfile, "%-4d\n", rep);
741  }else if (outputFormat == OUTPUT_JSON){
743  PrintKeyVal("access", "remove");
744  PrintKeyValDouble("totalTime", finish - start);
745  PrintEndSection();
746  }
747 }
748 
749 
750 /*
751  * Pretty Print a Double. The First parameter is a flag determining if left
752  * justification should be used. The third parameter a null-terminated string
753  * that should be appended to the number field.
754  */
755 static void PPDouble(int leftjustify, double number, char *append)
756 {
757  char format[16];
758  int width = 10;
759  int precision;
760 
761  if (number < 0) {
762  fprintf(out_resultfile, " - %s", append);
763  return;
764  }
765 
766  if (number < 1)
767  precision = 6;
768  else if (number < 3600)
769  precision = 2;
770  else
771  precision = 0;
772 
773  sprintf(format, "%%%s%d.%df%%s",
774  leftjustify ? "-" : "",
775  width, precision);
776 
777  fprintf(out_resultfile, format, number, append);
778 }
779 
780 static double mean_of_array_of_doubles(double *values, int len)
781 {
782  double tot = 0.0;
783  int i;
784 
785  for (i = 0; i < len; i++) {
786  tot += values[i];
787  }
788  return tot / len;
789 
790 }
int reorderTasks
Definition: ior.h:126
int uniqueDir
Definition: ior.h:143
char * HumanReadable(IOR_offset_t value, int base)
Definition: utilities.c:841
#define MEBIBYTE
Definition: iordef.h:78
int reorderTasksRandomSeed
Definition: ior.h:129
size_t pairs_accessed
Definition: ior.h:189
int warningAsErrors
Definition: ior.h:181
long long stonewall_avg_data_accessed
Definition: ior.h:193
void PrintLongSummaryHeader()
Definition: ior-output.c:642
int multiFile
Definition: ior.h:119
void PrintHeader(int argc, char **argv)
Definition: ior-output.c:269
#define VERBOSE_0
Definition: iordef.h:92
int filePerProc
Definition: ior.h:125
FILE * out_logfile
Definition: utilities.c:72
#define VERBOSE_3
Definition: iordef.h:95
double stonewall_time
Definition: ior.h:191
double min
Definition: ior-internal.h:31
void PrintTestEnds()
Definition: ior-output.c:212
int repetitions
Definition: ior.h:117
void PrintRepeatEnd()
Definition: ior-output.c:197
IOR_offset_t segmentCount
Definition: ior.h:135
int keepFile
Definition: ior.h:132
static void PrintKeyValStart(char *key)
Definition: ior-output.c:41
int checkRead
Definition: ior.h:131
enum OutputFormat_t outputFormat
Definition: utilities.c:74
int numTasksOnNode0
Definition: ior.h:115
void GetTestFileName(char *, IOR_param_t *)
Definition: ior.c:756
static void PrintArrayNamedStart(char *key)
Definition: ior-output.c:176
IOR_offset_t transferSize
Definition: ior.h:137
size_t memoryPerNode
Definition: ior.h:160
void PrintTableHeader()
Definition: ior-output.c:18
IOR_param_t params
Definition: ior.h:209
int storeFileOffset
Definition: ior.h:145
double sd
Definition: ior-internal.h:35
static void PrintArrayStart()
Definition: ior-output.c:166
void PrintRemoveTiming(double start, double finish, int rep)
Definition: ior-output.c:732
static void PrintNextToken()
Definition: ior-output.c:53
static struct results * bw_values(const int reps, IOR_results_t *measured, const double *vals, const int access)
Definition: ior-output.c:510
char * apiVersion
Definition: ior.h:100
int numNodes
Definition: ior.h:114
int setTimeStampSignature
Definition: ior.h:154
static void PrintKeyValInt(char *key, int64_t value)
Definition: ior-output.c:106
int fsyncPerWrite
Definition: ior.h:170
int interTestDelay
Definition: ior.h:120
#define WRITE
Definition: iordef.h:86
int maxTimeDuration
Definition: ior.h:151
char * testFileName
Definition: ior.h:102
char * stoneWallingStatusFile
Definition: ior.h:149
#define READ
Definition: iordef.h:88
double * val
Definition: ior-internal.h:37
void * backend_options
Definition: ior.h:166
int taskPerNodeOffset
Definition: ior.h:127
static int needNextToken
Definition: ior-output.c:29
static void PrintIndent()
Definition: ior-output.c:31
double sum
Definition: ior-internal.h:36
int fsync
Definition: ior.h:171
static void PrintNamedArrayStart(char *key)
Definition: ior-output.c:142
double var
Definition: ior-internal.h:34
struct IOR_test_t * next
Definition: ior.h:211
int outlierThreshold
Definition: ior.h:152
int reorderTasksRandom
Definition: ior.h:128
int checkWrite
Definition: ior.h:130
IOR_point_t write
Definition: ior.h:203
IOR_offset_t aggFileSizeForBW
Definition: ior.h:198
void ShowSetup(IOR_param_t *params)
Definition: ior-output.c:410
int verbose
Definition: ior.h:153
#define KIBIBYTE
Definition: iordef.h:77
char * CurrentTimeString(void)
Definition: utilities.c:241
static struct results * bw_ops_values(const int reps, IOR_results_t *measured, IOR_offset_t transfer_size, const double *vals, const int access)
Definition: ior-output.c:470
static void PPDouble(int leftjustify, double number, char *append)
Definition: ior-output.c:755
static void PrintNamedSectionStart(char *key)
Definition: ior-output.c:130
static double mean_of_array_of_doubles(double *values, int len)
Definition: ior-output.c:780
double time
Definition: ior.h:188
IOR_point_t read
Definition: ior.h:204
static void PrintArrayEnd()
Definition: ior-output.c:186
int dryRun
Definition: ior.h:108
IOR_offset_t expectedAggFileSize
Definition: ior.h:138
char * options
Definition: ior.h:103
char * platform
Definition: ior.h:101
static void PrintEndSection()
Definition: ior-output.c:153
int singleXferAttempt
Definition: ior.h:169
static void PrintStartSection()
Definition: ior-output.c:120
#define EWARN(MSG)
Definition: aiori-debug.h:59
FILE * out_resultfile
Definition: utilities.c:73
void PrintLongSummaryAllTests(IOR_test_t *tests_head)
Definition: ior-output.c:661
void PrintReducedResult(IOR_test_t *test, int access, double bw, double iops, double latency, double *diff_subset, double totalTime, int rep)
Definition: ior-output.c:225
int stoneWallingWearOut
Definition: ior.h:147
static int indent
Definition: ior-output.c:28
char ** environ
void StoreStoneWallingIterations(char *const filename, int64_t count)
Definition: utilities.c:813
void PrintShortSummary(IOR_test_t *test)
Definition: ior-output.c:685
int keepFileWithError
Definition: ior.h:133
#define FALSE
Definition: iordef.h:62
int useExistingTestFile
Definition: ior.h:144
enum PACKET_TYPE dataPacketType
Definition: ior.h:164
int readFile
Definition: ior.h:123
void ShowTestStart(IOR_param_t *test)
Definition: ior-output.c:323
int randomOffset
Definition: ior.h:158
int numTasks
Definition: ior.h:113
size_t memoryPerTask
Definition: ior.h:159
static void PrintKeyVal(char *key, char *value)
Definition: ior-output.c:73
int referenceNumber
Definition: ior.h:98
#define VERBOSE_2
Definition: iordef.h:94
int writeFile
Definition: ior.h:124
#define BASE_TWO
Definition: iordef.h:82
int verbose
Definition: utilities.c:70
int collective
Definition: ior.h:105
static void PrintLongSummaryOneOperation(IOR_test_t *test, const int access)
Definition: ior-output.c:526
#define MAX_PATHLEN
Definition: utilities.h:31
double mean
Definition: ior-internal.h:33
void ShowFileSystemSize(char *filename, const struct ior_aiori *backend, void *backend_options)
Definition: utilities.c:625
void PrintLongSummaryOneTest(IOR_test_t *test)
Definition: ior-output.c:632
const struct ior_aiori * backend
Definition: ior.h:96
static struct results * ops_values(const int reps, IOR_results_t *measured, IOR_offset_t transfer_size, const double *vals, const int access)
Definition: ior-output.c:516
#define MEGABYTE
Definition: iordef.h:74
void PrintRepeatStart()
Definition: ior-output.c:203
#define ERR(MSG)
Definition: aiori-debug.h:92
IOR_results_t * results
Definition: ior.h:210
char * debug
Definition: ior.h:97
static void PrintKeyValEnd()
Definition: ior-output.c:63
double max
Definition: ior-internal.h:32
int deadlineForStonewalling
Definition: ior.h:146
char * api
Definition: ior.h:99
long long int IOR_offset_t
Definition: iordef.h:109
int rank
Definition: utilities.c:68
IOR_offset_t blockSize
Definition: ior.h:136
#define TRUE
Definition: iordef.h:66
void ShowTestEnd(IOR_test_t *tptr)
Definition: ior-output.c:394
static void PrintKeyValDouble(char *key, double value)
Definition: ior-output.c:91
#define NULL
Definition: iordef.h:70
int id
Definition: ior.h:179