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