IOR
Macros | Functions | Variables
utilities.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <regex.h>
#include <sys/statfs.h>
#include <sys/time.h>
#include "utilities.h"
#include "aiori.h"
#include "ior.h"
Include dependency graph for utilities.c:

Go to the source code of this file.

Macros

#define O_DIRECT   000000
 

Functions

void * safeMalloc (uint64_t size)
 
void FailMessage (int rank, const char *location, char *format,...)
 
size_t NodeMemoryStringToBytes (char *size_str)
 
void updateParsedOptions (IOR_param_t *options, options_all_t *global_options)
 
void set_o_direct_flag (int *fd)
 
char * CurrentTimeString (void)
 
void DumpBuffer (void *buffer, size_t size)
 
int QueryNodeMapping (MPI_Comm comm, int print_nodemap)
 
int GetNumNodes (MPI_Comm comm)
 
int GetNumTasks (MPI_Comm comm)
 
int GetNumTasksOnNode0 (MPI_Comm comm)
 
void ExtractHint (char *settingVal, char *valueVal, char *hintString)
 
void SetHints (MPI_Info *mpiHints, char *hintsFileName)
 
void ShowHints (MPI_Info *mpiHints)
 
IOR_offset_t StringToBytes (char *size_str)
 
void ShowFileSystemSize (char *fileSystem)
 
int Regex (char *string, char *pattern)
 
void SeedRandGen (MPI_Comm testComm)
 
double GetTimeStamp (void)
 
static double TimeDeviation (void)
 
void init_clock ()
 
char * PrintTimestamp ()
 
int64_t ReadStoneWallingIterations (char *const filename)
 
void StoreStoneWallingIterations (char *const filename, int64_t count)
 
void DelaySecs (int delay)
 
char * HumanReadable (IOR_offset_t value, int base)
 

Variables

int errno
 
int numTasks
 
int rank = 0
 
int rankOffset = 0
 
int verbose = VERBOSE_0
 
MPI_Comm testComm
 
MPI_Comm mpi_comm_world
 
FILE * out_logfile
 
FILE * out_resultfile
 
enum OutputFormat_t outputFormat
 
double wall_clock_deviation
 
double wall_clock_delta = 0
 

Macro Definition Documentation

◆ O_DIRECT

#define O_DIRECT   000000

Referenced by set_o_direct_flag().

Function Documentation

◆ CurrentTimeString()

char* CurrentTimeString ( void  )

Definition at line 184 of file utilities.c.

References ERR, and NULL.

Referenced by PrintHeader(), PrintTestEnds(), ShowTestStart(), and TestIoSys().

Here is the caller graph for this function:

◆ DelaySecs()

void DelaySecs ( int  delay)

Definition at line 832 of file utilities.c.

References out_logfile, rank, verbose, and VERBOSE_1.

Referenced by mdtest_iteration(), and TestIoSys().

Here is the caller graph for this function:

◆ DumpBuffer()

void DumpBuffer ( void *  buffer,
size_t  size 
)

Definition at line 209 of file utilities.c.

References IOR_format, and out_logfile.

◆ ExtractHint()

void ExtractHint ( char *  settingVal,
char *  valueVal,
char *  hintString 
)

Definition at line 426 of file utilities.c.

References NULL, and out_logfile.

Referenced by SetHints().

Here is the caller graph for this function:

◆ FailMessage()

void FailMessage ( int  rank,
const char *  location,
char *  format,
  ... 
)

Definition at line 77 of file utilities.c.

References errno, out_logfile, PrintTimestamp(), and testComm.

Here is the call graph for this function:

◆ GetNumNodes()

int GetNumNodes ( MPI_Comm  comm)

Definition at line 274 of file utilities.c.

References GetNumTasks(), GetNumTasksOnNode0(), MPI_CHECK, numTasks, and rank.

Referenced by InitTests(), and mdtest_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumTasks()

int GetNumTasks ( MPI_Comm  comm)

Definition at line 311 of file utilities.c.

References MPI_CHECK, and numTasks.

Referenced by GetNumNodes(), and InitTests().

Here is the caller graph for this function:

◆ GetNumTasksOnNode0()

int GetNumTasksOnNode0 ( MPI_Comm  comm)

Definition at line 349 of file utilities.c.

References FAIL, hostname, MAX_PATHLEN, MPI_CHECK, out_logfile, rank, size, and verbose.

Referenced by GetNumNodes(), InitTests(), and mdtest_run().

Here is the caller graph for this function:

◆ GetTimeStamp()

double GetTimeStamp ( void  )

Definition at line 726 of file utilities.c.

References ERR, NULL, and wall_clock_delta.

Referenced by directory_test(), file_test(), mdtest_iteration(), offset_timers(), test_time_elapsed(), TestIoSys(), TimeDeviation(), updateStoneWallIterations(), and WriteOrRead().

Here is the caller graph for this function:

◆ HumanReadable()

char* HumanReadable ( IOR_offset_t  value,
int  base 
)

Definition at line 845 of file utilities.c.

References BASE_TEN, BASE_TWO, GIBIBYTE, GIGABYTE, MAX_STR, MEBIBYTE, and MEGABYTE.

Referenced by ShowSetup().

Here is the caller graph for this function:

◆ init_clock()

void init_clock ( void  )

Definition at line 775 of file utilities.c.

References TimeDeviation(), and wall_clock_deviation.

Referenced by InitTests(), and mdtest_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NodeMemoryStringToBytes()

size_t NodeMemoryStringToBytes ( char *  size_str)

Definition at line 89 of file utilities.c.

References ERR, rc, and string_to_bytes().

Referenced by DecodeDirective(), and updateParsedOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintTimestamp()

char* PrintTimestamp ( )

Definition at line 780 of file utilities.c.

References NULL, out_logfile, rank, and verbose.

Referenced by FailMessage(), and mdtest_run().

Here is the caller graph for this function:

◆ QueryNodeMapping()

int QueryNodeMapping ( MPI_Comm  comm,
int  print_nodemap 
)

Definition at line 230 of file utilities.c.

References FAIL, MAX_PATHLEN, out_logfile, and rank.

Referenced by InitTests(), and mdtest_run().

Here is the caller graph for this function:

◆ ReadStoneWallingIterations()

int64_t ReadStoneWallingIterations ( char *const  filename)

Definition at line 795 of file utilities.c.

References mpi_comm_world, NULL, and rank.

Referenced by file_test(), and TestIoSys().

Here is the caller graph for this function:

◆ Regex()

int Regex ( char *  string,
char *  pattern 
)

Definition at line 658 of file utilities.c.

Referenced by ShowTestStart().

Here is the caller graph for this function:

◆ safeMalloc()

void* safeMalloc ( uint64_t  size)

Definition at line 68 of file utilities.c.

References ERR, and NULL.

Referenced by AllocResults().

Here is the caller graph for this function:

◆ SeedRandGen()

void SeedRandGen ( MPI_Comm  testComm)

Definition at line 678 of file utilities.c.

References ERR, MPI_CHECK, NULL, and rank.

Referenced by GetOffsetArrayRandom(), and InitTests().

Here is the caller graph for this function:

◆ set_o_direct_flag()

void set_o_direct_flag ( int *  fd)

Definition at line 160 of file utilities.c.

References O_DIRECT, and WARN.

Referenced by IME_Open(), POSIX_Create(), and POSIX_Open().

Here is the caller graph for this function:

◆ SetHints()

void SetHints ( MPI_Info *  mpiHints,
char *  hintsFileName 
)

Definition at line 454 of file utilities.c.

References environ, ERR, ExtractHint(), MAX_STR, MPI_CHECK, NULL, and WARN.

Referenced by HDF5_Open(), MPIIO_Access(), MPIIO_GetFileSize(), NCMPI_Create(), and NCMPI_Open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowFileSystemSize()

void ShowFileSystemSize ( char *  fileSystem)

Definition at line 568 of file utilities.c.

References NULL, out_logfile, out_resultfile, OUTPUT_CSV, OUTPUT_DEFAULT, OUTPUT_JSON, outputFormat, PATH_MAX, and WARN.

Referenced by DisplayFreespace().

Here is the caller graph for this function:

◆ ShowHints()

void ShowHints ( MPI_Info *  mpiHints)

Definition at line 515 of file utilities.c.

References MPI_CHECK, and out_logfile.

Referenced by HDF5_Open(), NCMPI_Create(), and NCMPI_Open().

Here is the caller graph for this function:

◆ StoreStoneWallingIterations()

void StoreStoneWallingIterations ( char *const  filename,
int64_t  count 
)

Definition at line 817 of file utilities.c.

References FAIL, NULL, and rank.

Referenced by file_test(), and ShowTestEnd().

Here is the caller graph for this function:

◆ StringToBytes()

IOR_offset_t StringToBytes ( char *  size_str)

Definition at line 537 of file utilities.c.

References rc, and size.

◆ TimeDeviation()

static double TimeDeviation ( void  )
static

Definition at line 750 of file utilities.c.

References GetTimeStamp(), MPI_CHECK, mpi_comm_world, timestamp, and wall_clock_delta.

Referenced by init_clock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateParsedOptions()

void updateParsedOptions ( IOR_param_t options,
options_all_t global_options 
)

Variable Documentation

◆ errno

int errno

◆ mpi_comm_world

MPI_Comm mpi_comm_world

◆ numTasks

int numTasks

Referenced by GetNumNodes(), and GetNumTasks().

◆ out_logfile

FILE* out_logfile

◆ out_resultfile

FILE* out_resultfile

◆ outputFormat

enum OutputFormat_t outputFormat

◆ rank

int rank = 0

Definition at line 57 of file utilities.c.

Referenced by CEPHFS_GetFileSize(), CheckFileSize(), collective_helper(), CompareBuffers(), CountErrors(), DAOS_Create(), DAOS_Fini(), DAOS_GetFileSize(), DAOS_Init(), DAOS_Open(), DecodeDirective(), DelaySecs(), DFS_Create(), DFS_Finalize(), DFS_GetFileSize(), DFS_Init(), directory_test(), DisplayOutliers(), DistributeHints(), DUMMY_Create(), DUMMY_Xfer(), file_hits_histogram(), file_test(), FillBuffer(), GetNumNodes(), GetNumTasksOnNode0(), GetTestFileName(), Gfarm_get_file_size(), HandleDistribute(), HDF5_Open(), HDF5_Xfer(), HDFS_Create_Or_Open(), HDFS_Delete(), HDFS_GetFileSize(), HDFS_Xfer(), IME_Delete(), IME_GetFileSize(), IME_options(), IME_Xfer(), InitTests(), ior_main(), ior_run(), mdtest_iteration(), mdtest_run(), MPIIO_GetFileSize(), NCMPI_Create(), NCMPI_Open(), NCMPI_Xfer(), POSIX_Create(), POSIX_Delete(), POSIX_GetFileSize(), POSIX_Xfer(), PrependDir(), PrintArrayEnd(), PrintArrayNamedStart(), PrintArrayStart(), PrintEndSection(), PrintHeader(), PrintLongSummaryAllTests(), PrintLongSummaryHeader(), PrintLongSummaryOneOperation(), PrintRemoveTiming(), PrintRepeatEnd(), PrintRepeatStart(), PrintShortSummary(), PrintTestEnds(), PrintTimestamp(), QueryNodeMapping(), RADOS_GetFileSize(), ReadStoneWallingIterations(), ReduceIterResults(), remove_file(), RemoveFile(), S3_Close_internal(), s3_connect(), S3_Create_Or_Open_internal(), S3_GetFileSize(), S3_Xfer_internal(), SeedRandGen(), SeekOffset(), SetupDataSet(), ShowTestEnd(), StoreStoneWallingIterations(), summarize_results(), TestIoSys(), valid_tests(), VerboseMessage(), WriteOrRead(), and WriteTimes().

◆ rankOffset

int rankOffset = 0

◆ testComm

MPI_Comm testComm

◆ verbose

int verbose = VERBOSE_0

◆ wall_clock_delta

double wall_clock_delta = 0

Definition at line 720 of file utilities.c.

Referenced by DisplayOutliers(), GetTimeStamp(), and TimeDeviation().

◆ wall_clock_deviation

double wall_clock_deviation

Definition at line 719 of file utilities.c.

Referenced by init_clock(), and PrintHeader().