IOR
Macros | Functions | Variables
utilities.h File Reference
#include <mpi.h>
#include "ior.h"
Include dependency graph for utilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_PATHLEN   PATH_MAX
 
#define ERROR_LOCATION   __func__
 

Functions

void * safeMalloc (uint64_t size)
 
void set_o_direct_flag (int *fd)
 
ior_dataPacketType_e parsePacketType (char t)
 
void update_write_memory_pattern (uint64_t item, char *buf, size_t bytes, int rand_seed, int rank, ior_dataPacketType_e dataPacketType, ior_memory_flags type)
 
void update_write_memory_pattern_gpu (uint64_t item, char *buf, size_t bytes, int rand_seed, int rank, ior_dataPacketType_e dataPacketType)
 
void generate_memory_pattern (char *buf, size_t bytes, int rand_seed, int rank, ior_dataPacketType_e dataPacketType, ior_memory_flags type)
 
void generate_memory_pattern_gpu (char *buf, size_t bytes, int rand_seed, int rank, ior_dataPacketType_e dataPacketType)
 
void invalidate_buffer_pattern (char *buf, size_t bytes, ior_memory_flags type)
 
int verify_memory_pattern (uint64_t item, char *buffer, size_t bytes, int rand_seed, int pretendRank, ior_dataPacketType_e dataPacketType, ior_memory_flags type)
 
int verify_memory_pattern_gpu (uint64_t item, char *buffer, size_t bytes, int rand_seed, int pretendRank, ior_dataPacketType_e dataPacketType)
 
void PrintKeyVal (char *key, char *value)
 
void initCUDA (int blockMapping, int rank, int numNodes, int tasksPerNode, int useGPUID)
 
char * CurrentTimeString (void)
 
int Regex (char *, char *)
 
void ShowFileSystemSize (char *filename, const struct ior_aiori *backend, void *backend_options)
 
void DumpBuffer (void *, size_t)
 
void SetHints (MPI_Info *, char *)
 
void ShowHints (MPI_Info *)
 
char * HumanReadable (IOR_offset_t value, int base)
 
int QueryNodeMapping (MPI_Comm comm, int print_nodemap)
 
int GetNumNodes (MPI_Comm)
 
int GetNumTasks (MPI_Comm)
 
int GetNumTasksOnNode0 (MPI_Comm)
 
void DelaySecs (int delay)
 
void updateParsedOptions (IOR_param_t *options, options_all_t *global_options)
 
size_t NodeMemoryStringToBytes (char *size_str)
 
int64_t ReadStoneWallingIterations (char *const filename, MPI_Comm com)
 
void StoreStoneWallingIterations (char *const filename, int64_t count)
 
void init_clock (MPI_Comm com)
 
double GetTimeStamp (void)
 
char * PrintTimestamp ()
 
unsigned long GetProcessorAndCore (int *chip, int *core)
 
void * aligned_buffer_alloc (size_t size, ior_memory_flags type)
 
void aligned_buffer_free (void *buf, ior_memory_flags type)
 

Variables

int rank
 
int rankOffset
 
int verbose
 
MPI_Comm testComm
 
FILE * out_resultfile
 
enum OutputFormat_t outputFormat
 

Macro Definition Documentation

◆ ERROR_LOCATION

#define ERROR_LOCATION   __func__

Definition at line 32 of file utilities.h.

◆ MAX_PATHLEN

#define MAX_PATHLEN   PATH_MAX

Function Documentation

◆ aligned_buffer_alloc()

void* aligned_buffer_alloc ( size_t  size,
ior_memory_flags  type 
)

Definition at line 1070 of file utilities.c.

References ERR, IOR_MEMORY_TYPE_GPU_DEVICE_ONLY, IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_CPU, IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_GPU, and safeMalloc().

Referenced by mdtest_read(), mdtest_run(), run_benchmark(), run_precreate(), WriteOrRead(), and XferBuffersSetup().

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

◆ aligned_buffer_free()

void aligned_buffer_free ( void *  buf,
ior_memory_flags  type 
)

Definition at line 1119 of file utilities.c.

References ERR, and WARN.

Referenced by mdtest_read(), mdtest_run(), run_benchmark(), run_precreate(), WriteOrRead(), and XferBuffersFree().

Here is the caller graph for this function:

◆ CurrentTimeString()

char* CurrentTimeString ( void  )

Definition at line 356 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 974 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 *  ,
size_t   
)

Definition at line 381 of file utilities.c.

References IOR_format, and out_logfile.

◆ generate_memory_pattern()

void generate_memory_pattern ( char *  buf,
size_t  bytes,
int  rand_seed,
int  pretendRank,
ior_dataPacketType_e  dataPacketType,
ior_memory_flags  type 
)

Fills a buffer with bytes of a given pattern. Not performance-sensitive because it is called once per test.

Parameters
bufpointer to byte buffer to fill
bytesnumber of bytes to produce to fill buffer
rand_seedseed to use for PRNG
pretendRankunique identifier for this process
dataPacketTypeidentifier to designate pattern to fill buffer

Definition at line 137 of file utilities.c.

References DATA_INCOMPRESSIBLE, DATA_OFFSET, DATA_RANDOM, DATA_TIMESTAMP, generate_memory_pattern_gpu(), IOR_MEMORY_TYPE_GPU_DEVICE_ONLY, and IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_GPU.

Referenced by mdtest_run(), run_benchmark(), run_precreate(), and TestIoSys().

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

◆ generate_memory_pattern_gpu()

void generate_memory_pattern_gpu ( char *  buf,
size_t  bytes,
int  rand_seed,
int  rank,
ior_dataPacketType_e  dataPacketType 
)

Referenced by generate_memory_pattern().

Here is the caller graph for this function:

◆ GetNumNodes()

int GetNumNodes ( MPI_Comm  )

Definition at line 476 of file utilities.c.

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

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

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

◆ GetNumTasks()

int GetNumTasks ( MPI_Comm  )

Definition at line 513 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  )

Definition at line 551 of file utilities.c.

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

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

Here is the caller graph for this function:

◆ GetProcessorAndCore()

unsigned long GetProcessorAndCore ( int *  chip,
int *  core 
)

Definition at line 1057 of file utilities.c.

Referenced by GetTestFileName(), and HumanReadable().

Here is the caller graph for this function:

◆ GetTimeStamp()

double GetTimeStamp ( void  )

◆ HumanReadable()

char* HumanReadable ( IOR_offset_t  value,
int  base 
)

Definition at line 987 of file utilities.c.

References BASE_TEN, BASE_TWO, GetProcessorAndCore(), GIBIBYTE, GIGABYTE, MAX_STR, MEBIBYTE, MEGABYTE, and NULL.

Referenced by ShowSetup().

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

◆ init_clock()

void init_clock ( MPI_Comm  com)

Definition at line 917 of file utilities.c.

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

Here is the caller graph for this function:

◆ initCUDA()

void initCUDA ( int  blockMapping,
int  rank,
int  numNodes,
int  tasksPerNode,
int  useGPUID 
)

Definition at line 438 of file utilities.c.

References ERRF, and WARNF.

Referenced by md_workbench_run(), mdtest_run(), and test_initialize().

Here is the caller graph for this function:

◆ invalidate_buffer_pattern()

void invalidate_buffer_pattern ( char *  buf,
size_t  bytes,
ior_memory_flags  type 
)

Definition at line 172 of file utilities.c.

References IOR_MEMORY_TYPE_GPU_DEVICE_ONLY, and IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_GPU.

Referenced by mdtest_read(), run_benchmark(), and WriteOrReadSingle().

Here is the caller graph for this function:

◆ NodeMemoryStringToBytes()

size_t NodeMemoryStringToBytes ( char *  size_str)

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

◆ parsePacketType()

ior_dataPacketType_e parsePacketType ( char  t)

Definition at line 291 of file utilities.c.

References DATA_INCOMPRESSIBLE, DATA_OFFSET, DATA_RANDOM, DATA_TIMESTAMP, and ERRF.

Referenced by DecodeDirective(), md_workbench_run(), mdtest_run(), and updateParsedOptions().

Here is the caller graph for this function:

◆ PrintKeyVal()

void PrintKeyVal ( char *  key,
char *  value 
)

Definition at line 73 of file ior-output.c.

References needNextToken, NULL, out_resultfile, OUTPUT_CSV, OUTPUT_DEFAULT, OUTPUT_JSON, outputFormat, and PrintNextToken().

Referenced by PrintHeader(), PrintLongSummaryOneOperation(), PrintReducedResult(), PrintRemoveTiming(), PrintTestEnds(), ShowSetup(), and ShowTestStart().

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

◆ PrintTimestamp()

char* PrintTimestamp ( )

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

References FAIL, MAX_PATHLEN, out_logfile, and rank.

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

Here is the caller graph for this function:

◆ ReadStoneWallingIterations()

int64_t ReadStoneWallingIterations ( char *const  filename,
MPI_Comm  com 
)

Definition at line 936 of file utilities.c.

References NULL, and rank.

Referenced by file_test(), and TestIoSys().

Here is the caller graph for this function:

◆ Regex()

int Regex ( char *  ,
char *   
)

Definition at line 833 of file utilities.c.

References ERR.

◆ safeMalloc()

void* safeMalloc ( uint64_t  size)

◆ set_o_direct_flag()

void set_o_direct_flag ( int *  fd)

Definition at line 332 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 *  ,
char *   
)

Definition at line 656 of file utilities.c.

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

Referenced by HDF5_Open(), MPIIO_Access(), MPIIO_GetFileSize(), MPIIO_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 *  filename,
const struct ior_aiori backend,
void *  backend_options 
)

◆ ShowHints()

void ShowHints ( MPI_Info *  )

Definition at line 717 of file utilities.c.

References MPI_CHECK, and out_logfile.

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

References FAIL, NULL, and rank.

Referenced by file_test_create(), and ShowTestEnd().

Here is the caller graph for this function:

◆ update_write_memory_pattern()

void update_write_memory_pattern ( uint64_t  item,
char *  buf,
size_t  bytes,
int  rand_seed,
int  pretendRank,
ior_dataPacketType_e  dataPacketType,
ior_memory_flags  type 
)

Modifies a buffer for a write. Performance sensitive because it is called before each write.

Parameters
bufpointer to byte buffer to fill
bytesnumber of bytes to produce to fill buffer
rand_seedseed to use for PRNG
pretendRankunique identifier for this process
dataPacketTypeidentifier to designate pattern to fill buffer

Definition at line 94 of file utilities.c.

References DATA_RANDOM, DATA_TIMESTAMP, IOR_MEMORY_TYPE_GPU_DEVICE_ONLY, IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_GPU, RANDALGO_GOLDEN_RATIO_PRIME, and update_write_memory_pattern_gpu().

Referenced by create_file(), run_benchmark(), run_precreate(), and WriteOrReadSingle().

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

◆ update_write_memory_pattern_gpu()

void update_write_memory_pattern_gpu ( uint64_t  item,
char *  buf,
size_t  bytes,
int  rand_seed,
int  rank,
ior_dataPacketType_e  dataPacketType 
)

Referenced by update_write_memory_pattern().

Here is the caller graph for this function:

◆ updateParsedOptions()

void updateParsedOptions ( IOR_param_t options,
options_all_t global_options 
)

◆ verify_memory_pattern()

int verify_memory_pattern ( uint64_t  item,
char *  buffer,
size_t  bytes,
int  rand_seed,
int  pretendRank,
ior_dataPacketType_e  dataPacketType,
ior_memory_flags  type 
)

Definition at line 182 of file utilities.c.

References DATA_INCOMPRESSIBLE, DATA_OFFSET, DATA_RANDOM, DATA_TIMESTAMP, IOR_MEMORY_TYPE_GPU_DEVICE_ONLY, IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_GPU, RANDALGO_GOLDEN_RATIO_PRIME, and verify_memory_pattern_gpu().

Referenced by CompareData(), create_file(), mdtest_read(), and run_benchmark().

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

◆ verify_memory_pattern_gpu()

int verify_memory_pattern_gpu ( uint64_t  item,
char *  buffer,
size_t  bytes,
int  rand_seed,
int  pretendRank,
ior_dataPacketType_e  dataPacketType 
)

Referenced by verify_memory_pattern().

Here is the caller graph for this function:

Variable Documentation

◆ out_resultfile

FILE* out_resultfile

◆ outputFormat

enum OutputFormat_t outputFormat

◆ rank

int rank

◆ rankOffset

int rankOffset

Definition at line 71 of file utilities.c.

◆ testComm

MPI_Comm testComm

Definition at line 73 of file utilities.c.

Referenced by FailMessage().

◆ verbose

int verbose

Definition at line 72 of file utilities.c.

Referenced by DelaySecs(), GetNumTasksOnNode0(), and PrintTimestamp().