IOR
utilities.c
Go to the documentation of this file.
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4 /******************************************************************************\
5 * *
6 * Copyright (c) 2003, The Regents of the University of California *
7 * See the file COPYRIGHT for a complete copyright notice and license. *
8 * *
9 ********************************************************************************
10 *
11 * Additional utilities
12 *
13 \******************************************************************************/
14 
15 #ifdef HAVE_CONFIG_H
16 # include "config.h"
17 #endif
18 
19 #ifdef __linux__
20 # define _GNU_SOURCE /* Needed for O_DIRECT in fcntl */
21 #endif /* __linux__ */
22 
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <errno.h>
26 #include <fcntl.h>
27 #include <math.h> /* pow() */
28 #include <string.h>
29 #include <sys/stat.h>
30 #include <sys/types.h>
31 #include <time.h>
32 
33 #ifndef _WIN32
34 # include <regex.h>
35 # ifdef __sun /* SunOS does not support statfs(), instead uses statvfs() */
36 # include <sys/statvfs.h>
37 # elif (defined __APPLE__)
38 # include <sys/param.h>
39 # include <sys/mount.h>
40 # else /* ! __sun or __APPLE__ */
41 # include <sys/statfs.h>
42 # endif /* __sun */
43 # include <sys/time.h> /* gettimeofday() */
44 #endif
45 
46 #include "utilities.h"
47 #include "aiori.h"
48 #include "ior.h"
49 
50 /************************** D E C L A R A T I O N S ***************************/
51 
52 extern int errno;
53 extern int numTasks;
54 
55 /* globals used by other files, also defined "extern" in ior.h */
56 int numTasksWorld = 0;
57 int rank = 0;
58 int rankOffset = 0;
59 int tasksPerNode = 0; /* tasks per node */
60 int verbose = VERBOSE_0; /* verbose output */
61 MPI_Comm testComm;
62 MPI_Comm mpi_comm_world;
63 FILE * out_logfile;
66 
67 /***************************** F U N C T I O N S ******************************/
68 
69 
70 /* Used in aiori-POSIX.c and aiori-PLFS.c
71  */
72 
73 void set_o_direct_flag(int *fd)
74 {
75 /* note that TRU64 needs O_DIRECTIO, SunOS uses directio(),
76  and everyone else needs O_DIRECT */
77 #ifndef O_DIRECT
78 # ifndef O_DIRECTIO
79  WARN("cannot use O_DIRECT");
80 # define O_DIRECT 000000
81 # else /* O_DIRECTIO */
82 # define O_DIRECT O_DIRECTIO
83 # endif /* not O_DIRECTIO */
84 #endif /* not O_DIRECT */
85 
86  *fd |= O_DIRECT;
87 }
88 
89 
90 /*
91  * Returns string containing the current time.
92  *
93  * NOTE: On some systems, MPI jobs hang while ctime() waits for a lock.
94  * This is true even though CurrentTimeString() is only called for rank==0.
95  * ctime_r() fixes this.
96  */
97 char *CurrentTimeString(void)
98 {
99  static time_t currentTime;
100  char* currentTimePtr;
101 
102  if ((currentTime = time(NULL)) == -1)
103  ERR("cannot get current time");
104 
105 #if (_POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE || _POSIX_SOURCE)
106  static char threadSafeBuff[32]; /* "must be at least 26 characters long" */
107  if ((currentTimePtr = ctime_r(&currentTime, threadSafeBuff)) == NULL) {
108  ERR("cannot read current time");
109  }
110 #else
111  if ((currentTimePtr = ctime(&currentTime)) == NULL) {
112  ERR("cannot read current time");
113  }
114 #endif
115  /* ctime string ends in \n */
116  return (currentTimePtr);
117 }
118 
119 /*
120  * Dump transfer buffer.
121  */
122 void DumpBuffer(void *buffer,
123  size_t size) /* <size> in bytes */
124 {
125  size_t i, j;
126  IOR_size_t *dumpBuf = (IOR_size_t *)buffer;
127 
128  /* Turns out, IOR_size_t is unsigned long long, but we don't want
129  to assume that it must always be */
130  for (i = 0; i < ((size / sizeof(IOR_size_t)) / 4); i++) {
131  for (j = 0; j < 4; j++) {
132  fprintf(out_logfile, IOR_format" ", dumpBuf[4 * i + j]);
133  }
134  fprintf(out_logfile, "\n");
135  }
136  return;
137 } /* DumpBuffer() */
138 
139 #if MPI_VERSION >= 3
140 int CountTasksPerNode(MPI_Comm comm) {
141  /* modern MPI provides a simple way to get the local process count */
142  MPI_Comm shared_comm;
143  int count;
144 
145  MPI_Comm_split_type (comm, MPI_COMM_TYPE_SHARED, 0, MPI_INFO_NULL, &shared_comm);
146  MPI_Comm_size (shared_comm, &count);
147  MPI_Comm_free (&shared_comm);
148 
149  return count;
150 }
151 #else
152 /*
153  * Count the number of tasks that share a host.
154  *
155  * This function employees the gethostname() call, rather than using
156  * MPI_Get_processor_name(). We are interested in knowing the number
157  * of tasks that share a file system client (I/O node, compute node,
158  * whatever that may be). However on machines like BlueGene/Q,
159  * MPI_Get_processor_name() uniquely identifies a cpu in a compute node,
160  * not the node where the I/O is function shipped to. gethostname()
161  * is assumed to identify the shared filesystem client in more situations.
162  *
163  * NOTE: This also assumes that the task count on all nodes is equal
164  * to the task count on the host running MPI task 0.
165  */
166 int CountTasksPerNode(MPI_Comm comm) {
167  int size;
168  MPI_Comm_size(comm, & size);
169  /* for debugging and testing */
170  if (getenv("IOR_FAKE_TASK_PER_NODES")){
171  int tasksPerNode = atoi(getenv("IOR_FAKE_TASK_PER_NODES"));
172  int rank;
173  MPI_Comm_rank(comm, & rank);
174  if(rank == 0){
175  printf("Fake tasks per node: using %d\n", tasksPerNode);
176  }
177  return tasksPerNode;
178  }
179  char localhost[MAX_PATHLEN],
181  int count = 1,
182  i;
183  MPI_Status status;
184 
185  if (( rank == 0 ) && ( verbose >= 1 )) {
186  fprintf( out_logfile, "V-1: Entering count_tasks_per_node...\n" );
187  fflush( out_logfile );
188  }
189 
190  if (gethostname(localhost, MAX_PATHLEN) != 0) {
191  FAIL("gethostname()");
192  }
193  if (rank == 0) {
194  /* MPI_receive all hostnames, and compares them to the local hostname */
195  for (i = 0; i < size-1; i++) {
196  MPI_Recv(hostname, MAX_PATHLEN, MPI_CHAR, MPI_ANY_SOURCE,
197  MPI_ANY_TAG, comm, &status);
198  if (strcmp(hostname, localhost) == 0) {
199  count++;
200  }
201  }
202  } else {
203  /* MPI_send hostname to root node */
204  MPI_Send(localhost, MAX_PATHLEN, MPI_CHAR, 0, 0, comm);
205  }
206  MPI_Bcast(&count, 1, MPI_INT, 0, comm);
207 
208  return(count);
209 }
210 #endif
211 
212 
213 /*
214  * Extract key/value pair from hint string.
215  */
216 void ExtractHint(char *settingVal, char *valueVal, char *hintString)
217 {
218  char *settingPtr, *valuePtr, *tmpPtr1, *tmpPtr2;
219 
220  settingPtr = (char *)strtok(hintString, " =");
221  valuePtr = (char *)strtok(NULL, " =\t\r\n");
222  tmpPtr1 = settingPtr;
223  tmpPtr2 = (char *)strstr(settingPtr, "IOR_HINT__MPI__");
224  if (tmpPtr1 == tmpPtr2) {
225  settingPtr += strlen("IOR_HINT__MPI__");
226 
227  } else {
228  tmpPtr2 = (char *)strstr(settingPtr, "IOR_HINT__GPFS__");
229  if (tmpPtr1 == tmpPtr2) {
230  settingPtr += strlen("IOR_HINT__GPFS__");
231  fprintf(out_logfile,
232  "WARNING: Unable to set GPFS hints (not implemented.)\n");
233  }
234  }
235  strcpy(settingVal, settingPtr);
236  strcpy(valueVal, valuePtr);
237 }
238 
239 /*
240  * Set hints for MPIIO, HDF5, or NCMPI.
241  */
242 void SetHints(MPI_Info * mpiHints, char *hintsFileName)
243 {
244  char hintString[MAX_STR];
245  char settingVal[MAX_STR];
246  char valueVal[MAX_STR];
247  extern char **environ;
248  int i;
249  FILE *fd;
250 
251  /*
252  * This routine checks for hints from the environment and/or from the
253  * hints files. The hints are of the form:
254  * 'IOR_HINT__<layer>__<hint>=<value>', where <layer> is either 'MPI'
255  * or 'GPFS', <hint> is the full name of the hint to be set, and <value>
256  * is the hint value. E.g., 'setenv IOR_HINT__MPI__IBM_largeblock_io true'
257  * or 'IOR_HINT__GPFS__hint=value' in the hints file.
258  */
259  MPI_CHECK(MPI_Info_create(mpiHints), "cannot create info object");
260 
261  /* get hints from environment */
262  for (i = 0; environ[i] != NULL; i++) {
263  /* if this is an IOR_HINT, pass the hint to the info object */
264  if (strncmp(environ[i], "IOR_HINT", strlen("IOR_HINT")) == 0) {
265  strcpy(hintString, environ[i]);
266  ExtractHint(settingVal, valueVal, hintString);
267  MPI_CHECK(MPI_Info_set(*mpiHints, settingVal, valueVal),
268  "cannot set info object");
269  }
270  }
271 
272  /* get hints from hints file */
273  if (hintsFileName != NULL && strcmp(hintsFileName, "") != 0) {
274 
275  /* open the hint file */
276  fd = fopen(hintsFileName, "r");
277  if (fd == NULL) {
278  WARN("cannot open hints file");
279  } else {
280  /* iterate over hints file */
281  while (fgets(hintString, MAX_STR, fd) != NULL) {
282  if (strncmp
283  (hintString, "IOR_HINT",
284  strlen("IOR_HINT")) == 0) {
285  ExtractHint(settingVal, valueVal,
286  hintString);
287  MPI_CHECK(MPI_Info_set
288  (*mpiHints, settingVal,
289  valueVal),
290  "cannot set info object");
291  }
292  }
293  /* close the hints files */
294  if (fclose(fd) != 0)
295  ERR("cannot close hints file");
296  }
297  }
298 }
299 
300 /*
301  * Show all hints (key/value pairs) in an MPI_Info object.
302  */
303 void ShowHints(MPI_Info * mpiHints)
304 {
305  char key[MPI_MAX_INFO_VAL];
306  char value[MPI_MAX_INFO_VAL];
307  int flag, i, nkeys;
308 
309  MPI_CHECK(MPI_Info_get_nkeys(*mpiHints, &nkeys),
310  "cannot get info object keys");
311 
312  for (i = 0; i < nkeys; i++) {
313  MPI_CHECK(MPI_Info_get_nthkey(*mpiHints, i, key),
314  "cannot get info object key");
315  MPI_CHECK(MPI_Info_get(*mpiHints, key, MPI_MAX_INFO_VAL - 1,
316  value, &flag),
317  "cannot get info object value");
318  fprintf(out_logfile, "\t%s = %s\n", key, value);
319  }
320 }
321 
322 /*
323  * Takes a string of the form 64, 8m, 128k, 4g, etc. and converts to bytes.
324  */
326 {
327  IOR_offset_t size = 0;
328  char range;
329  int rc;
330 
331  rc = sscanf(size_str, "%lld%c", &size, &range);
332  if (rc == 2) {
333  switch ((int)range) {
334  case 'k':
335  case 'K':
336  size <<= 10;
337  break;
338  case 'm':
339  case 'M':
340  size <<= 20;
341  break;
342  case 'g':
343  case 'G':
344  size <<= 30;
345  break;
346  }
347  } else if (rc == 0) {
348  size = -1;
349  }
350  return (size);
351 }
352 
353 /*
354  * Displays size of file system and percent of data blocks and inodes used.
355  */
356 void ShowFileSystemSize(char *fileSystem)
357 {
358 #ifndef _WIN32 /* FIXME */
359  char realPath[PATH_MAX];
360  char *fileSystemUnitStr;
361  long long int totalFileSystemSize;
362  long long int freeFileSystemSize;
363  long long int totalInodes;
364  long long int freeInodes;
365  double totalFileSystemSizeHR;
366  double usedFileSystemPercentage;
367  double usedInodePercentage;
368 #ifdef __sun /* SunOS does not support statfs(), instead uses statvfs() */
369  struct statvfs statusBuffer;
370 #else /* !__sun */
371  struct statfs statusBuffer;
372 #endif /* __sun */
373 
374 #ifdef __sun
375  if (statvfs(fileSystem, &statusBuffer) != 0) {
376  ERR("unable to statvfs() file system");
377  }
378 #else /* !__sun */
379  if (statfs(fileSystem, &statusBuffer) != 0) {
380  ERR("unable to statfs() file system");
381  }
382 #endif /* __sun */
383 
384  /* data blocks */
385 #ifdef __sun
386  totalFileSystemSize = statusBuffer.f_blocks * statusBuffer.f_frsize;
387  freeFileSystemSize = statusBuffer.f_bfree * statusBuffer.f_frsize;
388 #else /* !__sun */
389  totalFileSystemSize = statusBuffer.f_blocks * statusBuffer.f_bsize;
390  freeFileSystemSize = statusBuffer.f_bfree * statusBuffer.f_bsize;
391 #endif /* __sun */
392 
393  usedFileSystemPercentage = (1 - ((double)freeFileSystemSize
394  / (double)totalFileSystemSize)) * 100;
395  totalFileSystemSizeHR =
396  (double)totalFileSystemSize / (double)(1<<30);
397  fileSystemUnitStr = "GiB";
398  if (totalFileSystemSizeHR > 1024) {
399  totalFileSystemSizeHR = (double)totalFileSystemSize / (double)((long long)1<<40);
400  fileSystemUnitStr = "TiB";
401  }
402 
403  /* inodes */
404  totalInodes = statusBuffer.f_files;
405  freeInodes = statusBuffer.f_ffree;
406  usedInodePercentage =
407  (1 - ((double)freeInodes / (double)totalInodes)) * 100;
408 
409  /* show results */
410  if (realpath(fileSystem, realPath) == NULL) {
411  ERR("unable to use realpath()");
412  }
413 
415  fprintf(out_resultfile, "%-20s: %s\n", "Path", realPath);
416  fprintf(out_resultfile, "%-20s: %.1f %s Used FS: %2.1f%% ",
417  "FS", totalFileSystemSizeHR, fileSystemUnitStr,
418  usedFileSystemPercentage);
419  fprintf(out_resultfile, "Inodes: %.1f Mi Used Inodes: %2.1f%%\n",
420  (double)totalInodes / (double)(1<<20),
421  usedInodePercentage);
422  fflush(out_logfile);
423  }else if(outputFormat == OUTPUT_JSON){
424  fprintf(out_resultfile, " , \"Path\": \"%s\",", realPath);
425  fprintf(out_resultfile, "\"Capacity\": \"%.1f %s\", \"Used Capacity\": \"%2.1f%%\",",
426  totalFileSystemSizeHR, fileSystemUnitStr,
427  usedFileSystemPercentage);
428  fprintf(out_resultfile, "\"Inodes\": \"%.1f Mi\", \"Used Inodes\" : \"%2.1f%%\"\n",
429  (double)totalInodes / (double)(1<<20),
430  usedInodePercentage);
431  }else if(outputFormat == OUTPUT_CSV){
432 
433  }
434 
435 #endif /* !_WIN32 */
436 
437  return;
438 }
439 
440 /*
441  * Return match of regular expression -- 0 is failure, 1 is success.
442  */
443 int Regex(char *string, char *pattern)
444 {
445  int retValue = 0;
446 #ifndef _WIN32 /* Okay to always not match */
447  regex_t regEx;
448  regmatch_t regMatch;
449 
450  regcomp(&regEx, pattern, REG_EXTENDED);
451  if (regexec(&regEx, string, 1, &regMatch, 0) == 0) {
452  retValue = 1;
453  }
454  regfree(&regEx);
455 #endif
456 
457  return (retValue);
458 }
459 
460 /*
461  * Seed random generator.
462  */
463 void SeedRandGen(MPI_Comm testComm)
464 {
465  unsigned int randomSeed;
466 
467  if (rank == 0) {
468 #ifdef _WIN32
469  rand_s(&randomSeed);
470 #else
471  struct timeval randGenTimer;
472  gettimeofday(&randGenTimer, (struct timezone *)NULL);
473  randomSeed = randGenTimer.tv_usec;
474 #endif
475  }
476  MPI_CHECK(MPI_Bcast(&randomSeed, 1, MPI_INT, 0,
477  testComm), "cannot broadcast random seed value");
478  srandom(randomSeed);
479 }
480 
481 /*
482  * System info for Windows.
483  */
484 #ifdef _WIN32
485 int uname(struct utsname *name)
486 {
487  DWORD nodeNameSize = sizeof(name->nodename) - 1;
488 
489  memset(name, 0, sizeof(struct utsname));
490  if (!GetComputerNameEx
491  (ComputerNameDnsFullyQualified, name->nodename, &nodeNameSize))
492  ERR("GetComputerNameEx failed");
493 
494  strncpy(name->sysname, "Windows", sizeof(name->sysname) - 1);
495  /* FIXME - these should be easy to fetch */
496  strncpy(name->release, "-", sizeof(name->release) - 1);
497  strncpy(name->version, "-", sizeof(name->version) - 1);
498  strncpy(name->machine, "-", sizeof(name->machine) - 1);
499  return 0;
500 }
501 #endif /* _WIN32 */
502 
503 
505 double wall_clock_delta = 0;
506 
507 /*
508  * Get time stamp. Use MPI_Timer() unless _NO_MPI_TIMER is defined,
509  * in which case use gettimeofday().
510  */
511 double GetTimeStamp(void)
512 {
513  double timeVal;
514 #ifdef _NO_MPI_TIMER
515  struct timeval timer;
516 
517  if (gettimeofday(&timer, (struct timezone *)NULL) != 0)
518  ERR("cannot use gettimeofday()");
519  timeVal = (double)timer.tv_sec + ((double)timer.tv_usec / 1000000);
520 #else /* not _NO_MPI_TIMER */
521  timeVal = MPI_Wtime(); /* no MPI_CHECK(), just check return value */
522  if (timeVal < 0)
523  ERR("cannot use MPI_Wtime()");
524 #endif /* _NO_MPI_TIMER */
525 
526  /* wall_clock_delta is difference from root node's time */
527  timeVal -= wall_clock_delta;
528 
529  return (timeVal);
530 }
531 
532 /*
533  * Determine any spread (range) between node times.
534  */
535 static double TimeDeviation(void)
536 {
537  double timestamp;
538  double min = 0;
539  double max = 0;
540  double roottimestamp;
541 
542  MPI_CHECK(MPI_Barrier(mpi_comm_world), "barrier error");
543  timestamp = GetTimeStamp();
544  MPI_CHECK(MPI_Reduce(&timestamp, &min, 1, MPI_DOUBLE,
545  MPI_MIN, 0, mpi_comm_world),
546  "cannot reduce tasks' times");
547  MPI_CHECK(MPI_Reduce(&timestamp, &max, 1, MPI_DOUBLE,
548  MPI_MAX, 0, mpi_comm_world),
549  "cannot reduce tasks' times");
550 
551  /* delta between individual nodes' time and root node's time */
552  roottimestamp = timestamp;
553  MPI_CHECK(MPI_Bcast(&roottimestamp, 1, MPI_DOUBLE, 0, mpi_comm_world),
554  "cannot broadcast root's time");
555  wall_clock_delta = timestamp - roottimestamp;
556 
557  return max - min;
558 }
559 
560 void init_clock(){
561  /* check for skew between tasks' start times */
563 }
564 
565 char * PrintTimestamp() {
566  static char datestring[80];
567  time_t cur_timestamp;
568 
569  if (( rank == 0 ) && ( verbose >= 1 )) {
570  fprintf( out_logfile, "V-1: Entering PrintTimestamp...\n" );
571  }
572 
573  fflush(out_logfile);
574  cur_timestamp = time(NULL);
575  strftime(datestring, 80, "%m/%d/%Y %T", localtime(&cur_timestamp));
576 
577  return datestring;
578 }
579 
580 int64_t ReadStoneWallingIterations(char * const filename){
581  long long data;
582  if(rank != 0){
583  MPI_Bcast( & data, 1, MPI_LONG_LONG_INT, 0, mpi_comm_world);
584  return data;
585  }else{
586  FILE * out = fopen(filename, "r");
587  if (out == NULL){
588  data = -1;
589  MPI_Bcast( & data, 1, MPI_LONG_LONG_INT, 0, mpi_comm_world);
590  return data;
591  }
592  int ret = fscanf(out, "%lld", & data);
593  if (ret != 1){
594  return -1;
595  }
596  fclose(out);
597  MPI_Bcast( & data, 1, MPI_LONG_LONG_INT, 0, mpi_comm_world);
598  return data;
599  }
600 }
601 
602 void StoreStoneWallingIterations(char * const filename, int64_t count){
603  if(rank != 0){
604  return;
605  }
606  FILE * out = fopen(filename, "w");
607  if (out == NULL){
608  FAIL("Cannot write to the stonewalling file!");
609  }
610  fprintf(out, "%lld", (long long) count);
611  fclose(out);
612 }
613 
614 /*
615  * Sleep for 'delay' seconds.
616  */
617 void DelaySecs(int delay){
618  if (rank == 0 && delay > 0) {
619  if (verbose >= VERBOSE_1)
620  fprintf(out_logfile, "delaying %d seconds . . .\n", delay);
621  sleep(delay);
622  }
623 }
624 
625 
626 /*
627  * Convert IOR_offset_t value to human readable string. This routine uses a
628  * statically-allocated buffer internally and so is not re-entrant.
629  */
630 char *HumanReadable(IOR_offset_t value, int base)
631 {
632  static char valueStr[MAX_STR];
633  IOR_offset_t m = 0, g = 0, t = 0;
634  char m_str[8], g_str[8], t_str[8];
635 
636  if (base == BASE_TWO) {
637  m = MEBIBYTE;
638  g = GIBIBYTE;
639  t = GIBIBYTE * 1024llu;
640  strcpy(m_str, "MiB");
641  strcpy(g_str, "GiB");
642  strcpy(t_str, "TiB");
643  } else if (base == BASE_TEN) {
644  m = MEGABYTE;
645  g = GIGABYTE;
646  t = GIGABYTE * 1000llu;
647  strcpy(m_str, "MB");
648  strcpy(g_str, "GB");
649  strcpy(t_str, "TB");
650  }
651 
652  if (value >= t) {
653  if (value % t) {
654  snprintf(valueStr, MAX_STR-1, "%.2f %s",
655  (double)((double)value / t), t_str);
656  } else {
657  snprintf(valueStr, MAX_STR-1, "%d %s", (int)(value / t), t_str);
658  }
659  }else if (value >= g) {
660  if (value % g) {
661  snprintf(valueStr, MAX_STR-1, "%.2f %s",
662  (double)((double)value / g), g_str);
663  } else {
664  snprintf(valueStr, MAX_STR-1, "%d %s", (int)(value / g), g_str);
665  }
666  } else if (value >= m) {
667  if (value % m) {
668  snprintf(valueStr, MAX_STR-1, "%.2f %s",
669  (double)((double)value / m), m_str);
670  } else {
671  snprintf(valueStr, MAX_STR-1, "%d %s", (int)(value / m), m_str);
672  }
673  } else if (value >= 0) {
674  snprintf(valueStr, MAX_STR-1, "%d bytes", (int)value);
675  } else {
676  snprintf(valueStr, MAX_STR-1, "-");
677  }
678  return valueStr;
679 }
char * HumanReadable(IOR_offset_t value, int base)
Definition: utilities.c:630
MPI_Comm testComm
Definition: utilities.c:61
#define MEBIBYTE
Definition: iordef.h:87
void set_o_direct_flag(int *fd)
Definition: utilities.c:73
#define ERR(MSG)
Definition: iordef.h:169
void ShowHints(MPI_Info *mpiHints)
Definition: utilities.c:303
#define VERBOSE_0
Definition: iordef.h:102
static int size
Definition: mdtest.c:82
int rankOffset
Definition: utilities.c:58
int64_t ReadStoneWallingIterations(char *const filename)
Definition: utilities.c:580
OutputFormat_t
Definition: iordef.h:64
CURLcode rc
Definition: aiori-S3.c:121
int CountTasksPerNode(MPI_Comm comm)
Definition: utilities.c:166
enum OutputFormat_t outputFormat
Definition: utilities.c:65
int numTasks
IOR_offset_t StringToBytes(char *size_str)
Definition: utilities.c:325
#define GIBIBYTE
Definition: iordef.h:88
int verbose
Definition: utilities.c:60
static double TimeDeviation(void)
Definition: utilities.c:535
char * PrintTimestamp()
Definition: utilities.c:565
void init_clock()
Definition: utilities.c:560
double wall_clock_delta
Definition: utilities.c:505
void ShowFileSystemSize(char *fileSystem)
Definition: utilities.c:356
void SeedRandGen(MPI_Comm testComm)
Definition: utilities.c:463
char * CurrentTimeString(void)
Definition: utilities.c:97
#define MPI_CHECK(MPI_STATUS, MSG)
Definition: iordef.h:192
#define PATH_MAX
Definition: iordef.h:113
double wall_clock_deviation
Definition: utilities.c:504
int rank
Definition: utilities.c:57
int numTasksWorld
Definition: utilities.c:56
FILE * out_resultfile
Definition: utilities.c:64
double GetTimeStamp(void)
Definition: utilities.c:511
char ** environ
void StoreStoneWallingIterations(char *const filename, int64_t count)
Definition: utilities.c:602
static char hostname[MAX_PATHLEN]
Definition: mdtest.c:88
int tasksPerNode
Definition: utilities.c:59
#define GIGABYTE
Definition: iordef.h:84
long long int IOR_size_t
Definition: iordef.h:124
#define WARN(MSG)
Definition: iordef.h:145
Definition: ior.h:46
#define BASE_TWO
Definition: iordef.h:91
#define MAX_STR
Definition: iordef.h:109
void ExtractHint(char *settingVal, char *valueVal, char *hintString)
Definition: utilities.c:216
#define MAX_PATHLEN
Definition: utilities.h:35
#define FAIL(msg)
Definition: utilities.h:47
#define O_DIRECT
int errno
void SetHints(MPI_Info *mpiHints, char *hintsFileName)
Definition: utilities.c:242
#define MEGABYTE
Definition: iordef.h:83
#define BASE_TEN
Definition: iordef.h:92
void DelaySecs(int delay)
Definition: utilities.c:617
#define VERBOSE_1
Definition: iordef.h:103
MPI_Comm mpi_comm_world
Definition: utilities.c:62
int Regex(char *string, char *pattern)
Definition: utilities.c:443
#define IOR_format
Definition: iordef.h:126
void DumpBuffer(void *buffer, size_t size)
Definition: utilities.c:122
FILE * out_logfile
Definition: utilities.c:63
long long int IOR_offset_t
Definition: iordef.h:123
#define NULL
Definition: iordef.h:79