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