IOR
Macros | Functions | Variables
utilities.c File Reference
#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 set_o_direct_flag (int *fd)
 
char * CurrentTimeString (void)
 
void DumpBuffer (void *buffer, size_t size)
 
int CountTasksPerNode (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 numTasksWorld = 0
 
int rank = 0
 
int rankOffset = 0
 
int tasksPerNode = 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

◆ CountTasksPerNode()

int CountTasksPerNode ( MPI_Comm  comm)

Definition at line 166 of file utilities.c.

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

Referenced by DumpBuffer(), InitTests(), mdtest_run(), and TestIoSys().

Here is the caller graph for this function:

◆ CurrentTimeString()

char* CurrentTimeString ( void  )

Definition at line 97 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 617 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 122 of file utilities.c.

References CountTasksPerNode(), IOR_format, and out_logfile.

Here is the call graph for this function:

◆ ExtractHint()

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

Definition at line 216 of file utilities.c.

References NULL, and out_logfile.

Referenced by SetHints().

Here is the caller graph for this function:

◆ GetTimeStamp()

double GetTimeStamp ( void  )

Definition at line 511 of file utilities.c.

References ERR, NULL, and wall_clock_delta.

Referenced by mdtest_iteration(), test_time_elapsed(), TestIoSys(), TimeDeviation(), and WriteOrRead().

Here is the caller graph for this function:

◆ HumanReadable()

char* HumanReadable ( IOR_offset_t  value,
int  base 
)

Definition at line 630 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 560 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:

◆ PrintTimestamp()

char* PrintTimestamp ( )

Definition at line 565 of file utilities.c.

References NULL, out_logfile, rank, and verbose.

Referenced by mdtest_run().

Here is the caller graph for this function:

◆ ReadStoneWallingIterations()

int64_t ReadStoneWallingIterations ( char *const  filename)

Definition at line 580 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 443 of file utilities.c.

Referenced by ShowTestStart().

Here is the caller graph for this function:

◆ SeedRandGen()

void SeedRandGen ( MPI_Comm  testComm)

Definition at line 463 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 73 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 242 of file utilities.c.

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

Referenced by HDF5_Open(), 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 356 of file utilities.c.

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

Referenced by DisplayFreespace().

Here is the caller graph for this function:

◆ ShowHints()

void ShowHints ( MPI_Info *  mpiHints)

Definition at line 303 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 602 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 325 of file utilities.c.

References rc, and size.

◆ TimeDeviation()

static double TimeDeviation ( void  )
static

Definition at line 535 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:

Variable Documentation

◆ errno

int errno

Referenced by POSIX_Create().

◆ mpi_comm_world

MPI_Comm mpi_comm_world

◆ numTasks

int numTasks

◆ numTasksWorld

int numTasksWorld = 0

Definition at line 56 of file utilities.c.

Referenced by ior_main(), ior_run(), NCMPI_Xfer(), and TestIoSys().

◆ 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 CheckFileSize(), collective_create_remove(), collective_helper(), CompareBuffers(), CountErrors(), CountTasksPerNode(), create_file(), create_remove_directory_tree(), create_remove_dirs(), create_remove_items(), create_remove_items_helper(), DecodeDirective(), DelaySecs(), directory_test(), display_freespace(), DisplayOutliers(), DistributeHints(), DUMMY_Create(), DUMMY_Xfer(), file_hits_histogram(), file_test(), FillBuffer(), GetTestFileName(), HDF5_Open(), HDF5_Xfer(), HDFS_Create_Or_Open(), HDFS_Delete(), HDFS_GetFileSize(), HDFS_Xfer(), IME_Delete(), IME_GetFileSize(), IME_Xfer(), ior_main(), ior_run(), mdtest_iteration(), mdtest_read(), mdtest_run(), mdtest_stat(), MPIIO_GetFileSize(), NCMPI_Create(), NCMPI_Open(), NCMPI_Xfer(), offset_timers(), parse_dirpath(), POSIX_Create(), POSIX_Delete(), POSIX_GetFileSize(), POSIX_Xfer(), PrependDir(), PrintEarlyHeader(), PrintHeader(), PrintLongSummaryAllTests(), PrintLongSummaryHeader(), PrintLongSummaryOneOperation(), PrintRemoveTiming(), PrintShortSummary(), PrintTestEnds(), PrintTimestamp(), 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(), show_file_system_size(), ShowTestEnd(), StoreStoneWallingIterations(), summarize_results(), TestIoSys(), unique_dir_access(), updateStoneWallIterations(), valid_tests(), WriteOrRead(), and WriteTimes().

◆ rankOffset

int rankOffset = 0

◆ tasksPerNode

int tasksPerNode = 0

Definition at line 59 of file utilities.c.

Referenced by CountTasksPerNode(), InitTests(), and ShowTestStart().

◆ testComm

MPI_Comm testComm

◆ verbose

int verbose = VERBOSE_0

◆ wall_clock_delta

double wall_clock_delta = 0

Definition at line 505 of file utilities.c.

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

◆ wall_clock_deviation

double wall_clock_deviation

Definition at line 504 of file utilities.c.

Referenced by init_clock(), and PrintHeader().