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  }
24 }
25 
26 static int indent = 0;
27 static int needNextToken = 0;
28 
29 static void PrintIndent(){
31  return;
32  }
33  for(int i=0; i < indent; i++){
34  fprintf(out_resultfile, " ");
35  }
36 }
37 
38 
39 static void PrintKeyValStart(char * key){
42  PrintIndent();
43  fprintf(out_resultfile, "%-20s: ", key);
44  return;
45  }
47  fprintf(out_resultfile, "\"%s\": \"", key);
48  }else if(outputFormat == OUTPUT_CSV){
49 
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 (rank != 0 || verbose < VERBOSE_0) {
214  PrintEndSection();
215  return;
216  }
217 
218  PrintKeyVal("Finished", CurrentTimeString());
219  PrintEndSection();
220 }
221 
222 void PrintReducedResult(IOR_test_t *test, int access, double bw, double iops, double latency,
223  double *diff_subset, double totalTime, int rep){
225  fprintf(out_resultfile, "%-10s", access == WRITE ? "write" : "read");
226  PPDouble(1, bw / MEBIBYTE, " ");
227  PPDouble(1, iops, " ");
228  PPDouble(1, latency, " ");
229  PPDouble(1, (double)test->params.blockSize / KIBIBYTE, " ");
230  PPDouble(1, (double)test->params.transferSize / KIBIBYTE, " ");
231  PPDouble(1, diff_subset[0], " ");
232  PPDouble(1, diff_subset[1], " ");
233  PPDouble(1, diff_subset[2], " ");
234  PPDouble(1, totalTime, " ");
235  fprintf(out_resultfile, "%-4d\n", rep);
236  }else if (outputFormat == OUTPUT_JSON){
238  PrintKeyVal("access", access == WRITE ? "write" : "read");
239  PrintKeyValDouble("bwMiB", bw / MEBIBYTE);
240  PrintKeyValDouble("blockKiB", (double)test->params.blockSize / KIBIBYTE);
241  PrintKeyValDouble("xferKiB", (double)test->params.transferSize / KIBIBYTE);
242  PrintKeyValDouble("iops", iops);
243  PrintKeyValDouble("latency", latency);
244  PrintKeyValDouble("openTime", diff_subset[0]);
245  PrintKeyValDouble("wrRdTime", diff_subset[1]);
246  PrintKeyValDouble("closeTime", diff_subset[2]);
247  PrintKeyValDouble("totalTime", totalTime);
248  PrintEndSection();
249  }
250  fflush(out_resultfile);
251 }
252 
253 void PrintHeader(int argc, char **argv)
254 {
255  struct utsname unamebuf;
256  int i;
257 
258  if (rank != 0)
259  return;
260 
263  PrintKeyVal("Version", META_VERSION);
264  }else{
265  fprintf(out_resultfile, "IOR-" META_VERSION ": MPI Coordinated Test of Parallel I/O\n");
266  }
267  PrintKeyVal("Began", CurrentTimeString());
268  PrintKeyValStart("Command line");
269  fprintf(out_resultfile, "%s", argv[0]);
270  for (i = 1; i < argc; i++) {
271  fprintf(out_resultfile, " %s", argv[i]);
272  }
273  PrintKeyValEnd();
274  if (uname(&unamebuf) != 0) {
275  EWARN("uname failed");
276  PrintKeyVal("Machine", "Unknown");
277  } else {
278  PrintKeyValStart("Machine");
279  fprintf(out_resultfile, "%s %s", unamebuf.sysname,
280  unamebuf.nodename);
281  if (verbose >= VERBOSE_2) {
282  fprintf(out_resultfile, " %s %s %s", unamebuf.release,
283  unamebuf.version, unamebuf.machine);
284  }
285  PrintKeyValEnd();
286  }
287 
288 #ifdef _NO_MPI_TIMER
289  if (verbose >= VERBOSE_2)
290  fprintf(out_logfile, "Using unsynchronized POSIX timer\n");
291 #else /* not _NO_MPI_TIMER */
292  if (MPI_WTIME_IS_GLOBAL) {
293  if (verbose >= VERBOSE_2)
294  fprintf(out_logfile, "Using synchronized MPI timer\n");
295  } else {
296  if (verbose >= VERBOSE_2)
297  fprintf(out_logfile, "Using unsynchronized MPI timer\n");
298  }
299 #endif /* _NO_MPI_TIMER */
300  if (verbose >= VERBOSE_1) {
301  fprintf(out_logfile, "Start time skew across all tasks: %.02f sec\n",
303  }
304  if (verbose >= VERBOSE_3) { /* show env */
305  fprintf(out_logfile, "STARTING ENVIRON LOOP\n");
306  for (i = 0; environ[i] != NULL; i++) {
307  fprintf(out_logfile, "%s\n", environ[i]);
308  }
309  fprintf(out_logfile, "ENDING ENVIRON LOOP\n");
310  }
311 
312  PrintArrayNamedStart("tests");
313  fflush(out_resultfile);
314  fflush(out_logfile);
315 }
316 
317 /*
318  * Print header information for test output.
319  */
321 {
323  PrintKeyValInt("TestID", test->id);
324  PrintKeyVal("StartTime", CurrentTimeString());
325  /* if pvfs2:, then skip */
326  if (strcasecmp(test->api, "DFS") &&
327  Regex(test->testFileName, "^[a-z][a-z].*:") == 0) {
328  DisplayFreespace(test);
329  }
330 
331  if (verbose >= VERBOSE_3 || outputFormat == OUTPUT_JSON) {
332  char* data_packets[] = {"g","t","o","i"};
333 
334  PrintNamedSectionStart("Parameters");
335  PrintKeyValInt("testID", test->id);
336  PrintKeyValInt("refnum", test->referenceNumber);
337  PrintKeyVal("api", test->api);
338  PrintKeyVal("platform", test->platform);
339  PrintKeyVal("testFileName", test->testFileName);
340  PrintKeyVal("hintsFileName", test->hintsFileName);
341  PrintKeyValInt("deadlineForStonewall", test->deadlineForStonewalling);
342  PrintKeyValInt("stoneWallingWearOut", test->stoneWallingWearOut);
343  PrintKeyValInt("maxTimeDuration", test->maxTimeDuration);
344  PrintKeyValInt("outlierThreshold", test->outlierThreshold);
345 
346  PrintKeyVal("options", test->options);
347  PrintKeyValInt("dryRun", test->dryRun);
348  PrintKeyValInt("nodes", test->numNodes);
349  PrintKeyValInt("memoryPerTask", (unsigned long) test->memoryPerTask);
350  PrintKeyValInt("memoryPerNode", (unsigned long) test->memoryPerNode);
351  PrintKeyValInt("tasksPerNode", test->numTasksOnNode0);
352  PrintKeyValInt("repetitions", test->repetitions);
353  PrintKeyValInt("multiFile", test->multiFile);
354  PrintKeyValInt("interTestDelay", test->interTestDelay);
355  PrintKeyValInt("fsync", test->fsync);
356  PrintKeyValInt("fsyncperwrite", test->fsyncPerWrite);
357  PrintKeyValInt("useExistingTestFile", test->useExistingTestFile);
358  PrintKeyValInt("showHints", test->showHints);
359  PrintKeyValInt("uniqueDir", test->uniqueDir);
360  PrintKeyValInt("individualDataSets", test->individualDataSets);
361  PrintKeyValInt("singleXferAttempt", test->singleXferAttempt);
362  PrintKeyValInt("readFile", test->readFile);
363  PrintKeyValInt("writeFile", test->writeFile);
364  PrintKeyValInt("filePerProc", test->filePerProc);
365  PrintKeyValInt("reorderTasks", test->reorderTasks);
366  PrintKeyValInt("reorderTasksRandom", test->reorderTasksRandom);
367  PrintKeyValInt("reorderTasksRandomSeed", test->reorderTasksRandomSeed);
368  PrintKeyValInt("randomOffset", test->randomOffset);
369  PrintKeyValInt("checkWrite", test->checkWrite);
370  PrintKeyValInt("checkRead", test->checkRead);
371  PrintKeyValInt("preallocate", test->preallocate);
372  PrintKeyValInt("useFileView", test->useFileView);
373  PrintKeyValInt("setAlignment", test->setAlignment);
374  PrintKeyValInt("storeFileOffset", test->storeFileOffset);
375  PrintKeyValInt("useSharedFilePointer", test->useSharedFilePointer);
376  PrintKeyValInt("useStridedDatatype", test->useStridedDatatype);
377  PrintKeyValInt("keepFile", test->keepFile);
378  PrintKeyValInt("keepFileWithError", test->keepFileWithError);
379  PrintKeyValInt("quitOnError", test->quitOnError);
380  PrintKeyValInt("verbose", verbose);
381  PrintKeyVal("data packet type", data_packets[test->dataPacketType]);
382  PrintKeyValInt("setTimeStampSignature/incompressibleSeed", test->setTimeStampSignature); /* Seed value was copied into setTimeStampSignature as well */
383  PrintKeyValInt("collective", test->collective);
384  PrintKeyValInt("segmentCount", test->segmentCount);
385  #ifdef HAVE_GPFS_FCNTL_H
386  PrintKeyValInt("gpfsHintAccess", test->gpfs_hint_access);
387  PrintKeyValInt("gpfsReleaseToken", test->gpfs_release_token);
388  #endif
389  PrintKeyValInt("transferSize", test->transferSize);
390  PrintKeyValInt("blockSize", test->blockSize);
391  PrintEndSection();
392  }
393 
394  fflush(out_resultfile);
395 }
396 
398  if(rank == 0 && tptr->params.stoneWallingWearOut){
399 
400  size_t pairs_accessed = tptr->results->write.pairs_accessed;
401  if (tptr->params.stoneWallingStatusFile){
403  }else{
404  fprintf(out_logfile, "Pairs deadlineForStonewallingaccessed: %ld\n", pairs_accessed);
405  }
406  }
407  PrintEndSection();
408 }
409 
410 /*
411  * Show simple test output with max results for iterations.
412  */
413 void ShowSetup(IOR_param_t *params)
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 
456 #ifdef HAVE_LUSTRE_LUSTRE_USER_H
457  if (params->lustre_set_striping) {
458  PrintKeyVal("Lustre stripe size", ((params->lustre_stripe_size == 0) ? "Use default" :
460  PrintKeyValInt("Lustre stripe count", params->lustre_stripe_count);
461  }
462 #endif /* HAVE_LUSTRE_LUSTRE_USER_H */
463  if (params->deadlineForStonewalling > 0) {
464  PrintKeyValInt("stonewallingTime", params->deadlineForStonewalling);
465  PrintKeyValInt("stoneWallingWearOut", params->stoneWallingWearOut );
466  }
467  PrintEndSection();
468 
469  PrintNamedArrayStart("Results");
470 
471  fflush(out_resultfile);
472 }
473 
474 static struct results *bw_ops_values(const int reps, IOR_results_t *measured,
475  IOR_offset_t transfer_size,
476  const double *vals, const int access)
477 {
478  struct results *r;
479  int i;
480 
481  r = (struct results *)malloc(sizeof(struct results)
482  + (reps * sizeof(double)));
483  if (r == NULL)
484  ERR("malloc failed");
485  r->val = (double *)&r[1];
486 
487  for (i = 0; i < reps; i++, measured++) {
488  IOR_point_t *point = (access == WRITE) ? &measured->write :
489  &measured->read;
490 
491  r->val[i] = ((double) (point->aggFileSizeForBW))
492  / transfer_size / vals[i];
493 
494  if (i == 0) {
495  r->min = r->val[i];
496  r->max = r->val[i];
497  r->sum = 0.0;
498  }
499  r->min = MIN(r->min, r->val[i]);
500  r->max = MAX(r->max, r->val[i]);
501  r->sum += r->val[i];
502  }
503  r->mean = r->sum / reps;
504  r->var = 0.0;
505  for (i = 0; i < reps; i++) {
506  r->var += pow((r->mean - r->val[i]), 2);
507  }
508  r->var = r->var / reps;
509  r->sd = sqrt(r->var);
510 
511  return r;
512 }
513 
514 static struct results *bw_values(const int reps, IOR_results_t *measured,
515  const double *vals, const int access)
516 {
517  return bw_ops_values(reps, measured, 1, vals, access);
518 }
519 
520 static struct results *ops_values(const int reps, IOR_results_t *measured,
521  IOR_offset_t transfer_size,
522  const double *vals, const int access)
523 {
524  return bw_ops_values(reps, measured, transfer_size, vals, access);
525 }
526 
527 /*
528  * Summarize results
529  */
530 static void PrintLongSummaryOneOperation(IOR_test_t *test, const int access)
531 {
532  IOR_param_t *params = &test->params;
533  IOR_results_t *results = test->results;
534  struct results *bw;
535  struct results *ops;
536 
537  int reps;
538  if (rank != 0 || verbose < VERBOSE_0)
539  return;
540 
541  reps = params->repetitions;
542 
543  double * times = malloc(sizeof(double)* reps);
544  long long stonewall_avg_data_accessed = 0;
545  double stonewall_time = 0;
546  for(int i=0; i < reps; i++){
547  IOR_point_t *point = (access == WRITE) ? &results[i].write :
548  &results[i].read;
549  times[i] = point->time;
550  stonewall_time += point->stonewall_time;
551  stonewall_avg_data_accessed += point->stonewall_avg_data_accessed;
552  }
553 
554  bw = bw_values(reps, results, times, access);
555  ops = ops_values(reps, results, params->transferSize, times, access);
556 
557  IOR_point_t *point = (access == WRITE) ? &results[0].write :
558  &results[0].read;
559 
560 
562  fprintf(out_resultfile, "%-9s ", access == WRITE ? "write" : "read");
563  fprintf(out_resultfile, "%10.2f ", bw->max / MEBIBYTE);
564  fprintf(out_resultfile, "%10.2f ", bw->min / MEBIBYTE);
565  fprintf(out_resultfile, "%10.2f ", bw->mean / MEBIBYTE);
566  fprintf(out_resultfile, "%10.2f ", bw->sd / MEBIBYTE);
567  fprintf(out_resultfile, "%10.2f ", ops->max);
568  fprintf(out_resultfile, "%10.2f ", ops->min);
569  fprintf(out_resultfile, "%10.2f ", ops->mean);
570  fprintf(out_resultfile, "%10.2f ", ops->sd);
571  fprintf(out_resultfile, "%10.5f ", mean_of_array_of_doubles(times, reps));
572  if(test->params.stoneWallingWearOut){
573  fprintf(out_resultfile, "%10.2f ", stonewall_time / reps);
574  fprintf(out_resultfile, "%13.2f ", stonewall_avg_data_accessed / stonewall_time / MEBIBYTE);
575  }else{
576  fprintf(out_resultfile, "%10s ", "NA");
577  fprintf(out_resultfile, "%13s ", "NA");
578  }
579  fprintf(out_resultfile, "%5d ", params->id);
580  fprintf(out_resultfile, "%6d ", params->numTasks);
581  fprintf(out_resultfile, "%3d ", params->numTasksOnNode0);
582  fprintf(out_resultfile, "%4d ", params->repetitions);
583  fprintf(out_resultfile, "%3d ", params->filePerProc);
584  fprintf(out_resultfile, "%5d ", params->reorderTasks);
585  fprintf(out_resultfile, "%8d ", params->taskPerNodeOffset);
586  fprintf(out_resultfile, "%9d ", params->reorderTasksRandom);
587  fprintf(out_resultfile, "%4d ", params->reorderTasksRandomSeed);
588  fprintf(out_resultfile, "%6lld ", params->segmentCount);
589  fprintf(out_resultfile, "%8lld ", params->blockSize);
590  fprintf(out_resultfile, "%8lld ", params->transferSize);
591  fprintf(out_resultfile, "%9.1f ", (float)point->aggFileSizeForBW / MEBIBYTE);
592  fprintf(out_resultfile, "%3s ", params->api);
593  fprintf(out_resultfile, "%6d", params->referenceNumber);
594  fprintf(out_resultfile, "\n");
595  }else if (outputFormat == OUTPUT_JSON){
597  PrintKeyVal("operation", access == WRITE ? "write" : "read");
598  PrintKeyVal("API", params->api);
599  PrintKeyValInt("TestID", params->id);
600  PrintKeyValInt("ReferenceNumber", params->referenceNumber);
601  PrintKeyValInt("segmentCount", params->segmentCount);
602  PrintKeyValInt("blockSize", params->blockSize);
603  PrintKeyValInt("transferSize", params->transferSize);
604  PrintKeyValInt("numTasks", params->numTasks);
605  PrintKeyValInt("tasksPerNode", params->numTasksOnNode0);
606  PrintKeyValInt("repetitions", params->repetitions);
607  PrintKeyValInt("filePerProc", params->filePerProc);
608  PrintKeyValInt("reorderTasks", params->reorderTasks);
609  PrintKeyValInt("taskPerNodeOffset", params->taskPerNodeOffset);
610  PrintKeyValInt("reorderTasksRandom", params->reorderTasksRandom);
611  PrintKeyValInt("reorderTasksRandomSeed", params->reorderTasksRandomSeed);
612  PrintKeyValInt("segmentCount", params->segmentCount);
613  PrintKeyValInt("blockSize", params->blockSize);
614  PrintKeyValInt("transferSize", params->transferSize);
615  PrintKeyValDouble("bwMaxMIB", bw->max / MEBIBYTE);
616  PrintKeyValDouble("bwMinMIB", bw->min / MEBIBYTE);
617  PrintKeyValDouble("bwMeanMIB", bw->mean / MEBIBYTE);
618  PrintKeyValDouble("bwStdMIB", bw->sd / MEBIBYTE);
619  PrintKeyValDouble("OPsMax", ops->max);
620  PrintKeyValDouble("OPsMin", ops->min);
621  PrintKeyValDouble("OPsMean", ops->mean);
622  PrintKeyValDouble("OPsSD", ops->sd);
623  PrintKeyValDouble("MeanTime", mean_of_array_of_doubles(times, reps));
624  if(test->params.stoneWallingWearOut){
625  PrintKeyValDouble("StoneWallTime", stonewall_time / reps);
626  PrintKeyValDouble("StoneWallbwMeanMIB", stonewall_avg_data_accessed / stonewall_time / MEBIBYTE);
627  }
628  PrintKeyValDouble("xsizeMiB", (double) point->aggFileSizeForBW / MEBIBYTE);
629  PrintEndSection();
630  }else if (outputFormat == OUTPUT_CSV){
631 
632  }
633 
634  fflush(out_resultfile);
635 
636  free(bw);
637  free(ops);
638  free(times);
639 }
640 
642 {
643  IOR_param_t *params = &test->params;
644 
645  if (params->writeFile)
647  if (params->readFile)
649 }
650 
652 {
653  if (rank != 0 || verbose < VERBOSE_0)
654  return;
656  return;
657  }
658 
659  fprintf(out_resultfile, "\n");
660  fprintf(out_resultfile, "%-9s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %13s",
661  "Operation", "Max(MiB)", "Min(MiB)", "Mean(MiB)", "StdDev",
662  "Max(OPs)", "Min(OPs)", "Mean(OPs)", "StdDev",
663  "Mean(s)", "Stonewall(s)", "Stonewall(MiB)");
664  fprintf(out_resultfile, " Test# #Tasks tPN reps fPP reord reordoff reordrand seed"
665  " segcnt ");
666  fprintf(out_resultfile, "%8s %8s %9s %5s", " blksiz", "xsize","aggs(MiB)", "API");
667  fprintf(out_resultfile, " RefNum\n");
668 }
669 
671 {
672  IOR_test_t *tptr;
673  if (rank != 0 || verbose < VERBOSE_0)
674  return;
675 
676  PrintArrayEnd();
677 
679  fprintf(out_resultfile, "\n");
680  fprintf(out_resultfile, "Summary of all tests:");
681  }else if (outputFormat == OUTPUT_JSON){
682  PrintNamedArrayStart("summary");
683  }else if (outputFormat == OUTPUT_CSV){
684 
685  }
686 
688 
689  for (tptr = tests_head; tptr != NULL; tptr = tptr->next) {
691  }
692 
693  PrintArrayEnd();
694 }
695 
697 {
698  IOR_param_t *params = &test->params;
699  IOR_results_t *results = test->results;
700  double max_write_bw = 0.0;
701  double max_read_bw = 0.0;
702  double bw;
703  int reps;
704  int i;
705 
706  if (rank != 0 || verbose < VERBOSE_0)
707  return;
708 
709  PrintArrayEnd();
710 
711  reps = params->repetitions;
712 
713  for (i = 0; i < reps; i++) {
714  bw = (double)results[i].write.aggFileSizeForBW / results[i].write.time;
715  max_write_bw = MAX(bw, max_write_bw);
716  bw = (double)results[i].read.aggFileSizeForBW / results[i].read.time;
717  max_read_bw = MAX(bw, max_read_bw);
718  }
719 
721  if (params->writeFile) {
722  fprintf(out_resultfile, "Max Write: %.2f MiB/sec (%.2f MB/sec)\n",
723  max_write_bw/MEBIBYTE, max_write_bw/MEGABYTE);
724  }
725  if (params->readFile) {
726  fprintf(out_resultfile, "Max Read: %.2f MiB/sec (%.2f MB/sec)\n",
727  max_read_bw/MEBIBYTE, max_read_bw/MEGABYTE);
728  }
729  }else if (outputFormat == OUTPUT_JSON){
730  PrintNamedSectionStart("max");
731  if (params->writeFile) {
732  PrintKeyValDouble("writeMiB", max_write_bw/MEBIBYTE);
733  PrintKeyValDouble("writeMB", max_write_bw/MEGABYTE);
734  }
735  if (params->readFile) {
736  PrintKeyValDouble("readMiB", max_read_bw/MEBIBYTE);
737  PrintKeyValDouble("readMB", max_read_bw/MEGABYTE);
738  }
739  PrintEndSection();
740  }
741 }
742 
743 
744 /*
745  * Display freespace (df).
746  */
748 {
749  char fileName[MAX_STR] = { 0 };
750  int i;
751  int directoryFound = FALSE;
752 
753  /* get outfile name */
754  GetTestFileName(fileName, test);
755 
756  /* get directory for outfile */
757  i = strlen(fileName);
758  while (i-- > 0) {
759  if (fileName[i] == '/') {
760  fileName[i] = '\0';
761  directoryFound = TRUE;
762  break;
763  }
764  }
765 
766  /* if no directory/, use '.' */
767  if (directoryFound == FALSE) {
768  strcpy(fileName, ".");
769  }
770 
771  ShowFileSystemSize(fileName);
772 }
773 
774 
775 void PrintRemoveTiming(double start, double finish, int rep)
776 {
777  if (rank != 0 || verbose < VERBOSE_0)
778  return;
779 
781  fprintf(out_resultfile, "remove - - - - - - - - ");
782  PPDouble(1, finish-start, " ");
783  fprintf(out_resultfile, "%-4d\n", rep);
784  }else if (outputFormat == OUTPUT_JSON){
786  PrintKeyVal("access", "remove");
787  PrintKeyValDouble("totalTime", finish - start);
788  PrintEndSection();
789  }
790 }
791 
792 
793 /*
794  * Pretty Print a Double. The First parameter is a flag determining if left
795  * justification should be used. The third parameter a null-terminated string
796  * that should be appended to the number field.
797  */
798 static void PPDouble(int leftjustify, double number, char *append)
799 {
800  char format[16];
801  int width = 10;
802  int precision;
803 
804  if (number < 0) {
805  fprintf(out_resultfile, " - %s", append);
806  return;
807  }
808 
809  if (number < 1)
810  precision = 6;
811  else if (number < 3600)
812  precision = 2;
813  else
814  precision = 0;
815 
816  sprintf(format, "%%%s%d.%df%%s",
817  leftjustify ? "-" : "",
818  width, precision);
819 
820  fprintf(out_resultfile, format, number, append);
821 }
822 
823 static double mean_of_array_of_doubles(double *values, int len)
824 {
825  double tot = 0.0;
826  int i;
827 
828  for (i = 0; i < len; i++) {
829  tot += values[i];
830  }
831  return tot / len;
832 
833 }
int reorderTasks
Definition: ior.h:112
int uniqueDir
Definition: ior.h:134
char * HumanReadable(IOR_offset_t value, int base)
Definition: utilities.c:845
int lustre_stripe_count
Definition: ior.h:195
IOR_offset_t setAlignment
Definition: ior.h:173
int quitOnError
Definition: ior.h:121
#define MEBIBYTE
Definition: iordef.h:87
int reorderTasksRandomSeed
Definition: ior.h:115
size_t pairs_accessed
Definition: ior.h:216
int showHints
Definition: ior.h:132
long long stonewall_avg_data_accessed
Definition: ior.h:220
void PrintLongSummaryHeader()
Definition: ior-output.c:651
int lustre_stripe_size
Definition: ior.h:196
int multiFile
Definition: ior.h:105
#define ERR(MSG)
Definition: iordef.h:184
void PrintHeader(int argc, char **argv)
Definition: ior-output.c:253
#define VERBOSE_0
Definition: iordef.h:101
int filePerProc
Definition: ior.h:111
#define VERBOSE_3
Definition: iordef.h:104
double stonewall_time
Definition: ior.h:218
double min
Definition: ior-internal.h:33
void PrintTestEnds()
Definition: ior-output.c:212
int repetitions
Definition: ior.h:103
void PrintRepeatEnd()
Definition: ior-output.c:197
IOR_offset_t segmentCount
Definition: ior.h:123
int useStridedDatatype
Definition: ior.h:131
int keepFile
Definition: ior.h:118
static void PrintKeyValStart(char *key)
Definition: ior-output.c:39
int checkRead
Definition: ior.h:117
void DisplayFreespace(IOR_param_t *test)
Definition: ior-output.c:747
enum OutputFormat_t outputFormat
Definition: utilities.c:64
int useSharedFilePointer
Definition: ior.h:130
int numTasksOnNode0
Definition: ior.h:101
void GetTestFileName(char *, IOR_param_t *)
Definition: ior.c:749
static void PrintArrayNamedStart(char *key)
Definition: ior-output.c:176
IOR_offset_t transferSize
Definition: ior.h:125
size_t memoryPerNode
Definition: ior.h:152
void PrintTableHeader()
Definition: ior-output.c:18
IOR_param_t params
Definition: ior.h:235
int gpfs_release_token
Definition: ior.h:203
int storeFileOffset
Definition: ior.h:136
double sd
Definition: ior-internal.h:37
static void PrintArrayStart()
Definition: ior-output.c:166
void PrintRemoveTiming(double start, double finish, int rep)
Definition: ior-output.c:775
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:514
char * apiVersion
Definition: ior.h:91
int numNodes
Definition: ior.h:100
int setTimeStampSignature
Definition: ior.h:145
static void PrintKeyValInt(char *key, int64_t value)
Definition: ior-output.c:106
int fsyncPerWrite
Definition: ior.h:162
int interTestDelay
Definition: ior.h:106
#define WRITE
Definition: iordef.h:95
#define EWARN(MSG)
Definition: iordef.h:169
int maxTimeDuration
Definition: ior.h:142
char * testFileName
Definition: ior.h:93
char * stoneWallingStatusFile
Definition: ior.h:140
#define READ
Definition: iordef.h:97
double * val
Definition: ior-internal.h:39
int taskPerNodeOffset
Definition: ior.h:113
static int needNextToken
Definition: ior-output.c:27
static void PrintIndent()
Definition: ior-output.c:29
double sum
Definition: ior-internal.h:38
int fsync
Definition: ior.h:163
char * hintsFileName
Definition: ior.h:95
static void PrintNamedArrayStart(char *key)
Definition: ior-output.c:142
double var
Definition: ior-internal.h:36
struct IOR_test_t * next
Definition: ior.h:237
int outlierThreshold
Definition: ior.h:143
void ShowFileSystemSize(char *fileSystem)
Definition: utilities.c:568
int reorderTasksRandom
Definition: ior.h:114
int checkWrite
Definition: ior.h:116
IOR_point_t write
Definition: ior.h:229
IOR_offset_t aggFileSizeForBW
Definition: ior.h:224
void ShowSetup(IOR_param_t *params)
Definition: ior-output.c:413
#define KIBIBYTE
Definition: iordef.h:86
char * CurrentTimeString(void)
Definition: utilities.c:184
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:474
static void PPDouble(int leftjustify, double number, char *append)
Definition: ior-output.c:798
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:823
double time
Definition: ior.h:215
double wall_clock_deviation
Definition: utilities.c:719
IOR_point_t read
Definition: ior.h:230
static void PrintArrayEnd()
Definition: ior-output.c:186
int dryRun
Definition: ior.h:98
IOR_offset_t expectedAggFileSize
Definition: ior.h:127
char * options
Definition: ior.h:96
char * platform
Definition: ior.h:92
static void PrintEndSection()
Definition: ior-output.c:153
int singleXferAttempt
Definition: ior.h:161
static void PrintStartSection()
Definition: ior-output.c:120
FILE * out_resultfile
Definition: utilities.c:63
void PrintLongSummaryAllTests(IOR_test_t *tests_head)
Definition: ior-output.c:670
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:222
int stoneWallingWearOut
Definition: ior.h:138
static int indent
Definition: ior-output.c:26
char ** environ
void StoreStoneWallingIterations(char *const filename, int64_t count)
Definition: utilities.c:817
void PrintShortSummary(IOR_test_t *test)
Definition: ior-output.c:696
int keepFileWithError
Definition: ior.h:119
#define FALSE
Definition: iordef.h:71
int useExistingTestFile
Definition: ior.h:135
enum PACKET_TYPE dataPacketType
Definition: ior.h:156
int useFileView
Definition: ior.h:129
int readFile
Definition: ior.h:109
void ShowTestStart(IOR_param_t *test)
Definition: ior-output.c:320
int randomOffset
Definition: ior.h:150
int numTasks
Definition: ior.h:99
size_t memoryPerTask
Definition: ior.h:151
static void PrintKeyVal(char *key, char *value)
Definition: ior-output.c:73
int referenceNumber
Definition: ior.h:89
#define VERBOSE_2
Definition: iordef.h:103
int individualDataSets
Definition: ior.h:171
int writeFile
Definition: ior.h:110
#define BASE_TWO
Definition: iordef.h:91
#define MAX_STR
Definition: iordef.h:108
int collective
Definition: ior.h:122
static void PrintLongSummaryOneOperation(IOR_test_t *test, const int access)
Definition: ior-output.c:530
double mean
Definition: ior-internal.h:35
void PrintLongSummaryOneTest(IOR_test_t *test)
Definition: ior-output.c:641
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:520
#define MEGABYTE
Definition: iordef.h:83
void PrintRepeatStart()
Definition: ior-output.c:203
#define VERBOSE_1
Definition: iordef.h:102
IOR_results_t * results
Definition: ior.h:236
char * debug
Definition: ior.h:86
int verbose
Definition: utilities.c:59
int preallocate
Definition: ior.h:128
static void PrintKeyValEnd()
Definition: ior-output.c:63
double max
Definition: ior-internal.h:34
int deadlineForStonewalling
Definition: ior.h:137
int Regex(char *string, char *pattern)
Definition: utilities.c:658
char * api
Definition: ior.h:90
FILE * out_logfile
Definition: utilities.c:62
long long int IOR_offset_t
Definition: iordef.h:122
int rank
Definition: utilities.c:57
int gpfs_hint_access
Definition: ior.h:202
IOR_offset_t blockSize
Definition: ior.h:124
#define TRUE
Definition: iordef.h:75
int lustre_set_striping
Definition: ior.h:198
void ShowTestEnd(IOR_test_t *tptr)
Definition: ior-output.c:397
static void PrintKeyValDouble(char *key, double value)
Definition: ior-output.c:91
#define NULL
Definition: iordef.h:79
int id
Definition: ior.h:209