IOR
Functions | Variables
ior.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <mpi.h>
#include <string.h>
#include <sys/stat.h>
#include <time.h>
#include <sys/time.h>
#include <sys/utsname.h>
#include <assert.h>
#include "ior.h"
#include "ior-internal.h"
#include "aiori.h"
#include "utilities.h"
#include "parse_options.h"
Include dependency graph for ior.c:

Go to the source code of this file.

Functions

static void DestroyTests (IOR_test_t *tests_head)
 
static char * PrependDir (IOR_param_t *, char *)
 
static char ** ParseFileName (char *, int *)
 
static void InitTests (IOR_test_t *, MPI_Comm)
 
static void TestIoSys (IOR_test_t *)
 
static void ValidateTests (IOR_param_t *)
 
static IOR_offset_t WriteOrRead (IOR_param_t *test, IOR_results_t *results, void *fd, int access, IOR_io_buffers *ioBuffers)
 
static void WriteTimes (IOR_param_t *, double **, int, int)
 
IOR_test_tior_run (int argc, char **argv, MPI_Comm world_com, FILE *world_out)
 
int ior_main (int argc, char **argv)
 
void init_IOR_Param_t (IOR_param_t *p)
 
static void DisplayOutliers (int numTasks, double timerVal, char *timeString, int access, int outlierThreshold)
 
static void CheckForOutliers (IOR_param_t *test, double **timer, int rep, int access)
 
static void CheckFileSize (IOR_test_t *test, IOR_offset_t dataMoved, int rep)
 
static size_t CompareBuffers (void *expectedBuffer, void *unknownBuffer, size_t size, IOR_offset_t transferCount, IOR_param_t *test, int access)
 
static int CountErrors (IOR_param_t *test, int access, int errors)
 
static void * aligned_buffer_alloc (size_t size)
 
static void aligned_buffer_free (void *buf)
 
static void * safeMalloc (uint64_t size)
 
void AllocResults (IOR_test_t *test)
 
void FreeResults (IOR_test_t *test)
 
IOR_test_tCreateTest (IOR_param_t *init_params, int test_num)
 
static void DestroyTest (IOR_test_t *test)
 
void DistributeHints (void)
 
static void FillIncompressibleBuffer (void *buffer, IOR_param_t *test)
 
static void FillBuffer (void *buffer, IOR_param_t *test, unsigned long long offset, int fillrank)
 
char * GetPlatformName ()
 
void GetTestFileName (char *testFileName, IOR_param_t *test)
 
static void ReduceIterResults (IOR_test_t *test, double **timer, int rep, int access)
 
static void RemoveFile (char *testFileName, int filePerProc, IOR_param_t *test)
 
static void XferBuffersSetup (IOR_io_buffers *ioBuffers, IOR_param_t *test, int pretendRank)
 
static void XferBuffersFree (IOR_io_buffers *ioBuffers, IOR_param_t *test)
 
static void * malloc_and_touch (size_t size)
 
static void file_hits_histogram (IOR_param_t *params)
 
int test_time_elapsed (IOR_param_t *params, double startTime)
 
static void * HogMemory (IOR_param_t *params)
 
static IOR_offset_tGetOffsetArraySequential (IOR_param_t *test, int pretendRank)
 
static IOR_offset_tGetOffsetArrayRandom (IOR_param_t *test, int pretendRank, int access)
 
static IOR_offset_t WriteOrReadSingle (IOR_offset_t pairCnt, IOR_offset_t *offsetArray, int pretendRank, IOR_offset_t *transferCount, int *errors, IOR_param_t *test, int *fd, IOR_io_buffers *ioBuffers, int access)
 

Variables

char ** environ
 
static int totalErrorCount
 
static const ior_aiori_tbackend
 
unsigned int reseed_incompressible_prng = TRUE
 

Function Documentation

◆ aligned_buffer_alloc()

static void* aligned_buffer_alloc ( size_t  size)
static

Definition at line 462 of file ior.c.

References ERR, and NULL.

Referenced by XferBuffersSetup().

Here is the caller graph for this function:

◆ aligned_buffer_free()

static void aligned_buffer_free ( void *  buf)
static

Definition at line 488 of file ior.c.

Referenced by XferBuffersFree().

Here is the caller graph for this function:

◆ AllocResults()

void AllocResults ( IOR_test_t test)

Definition at line 502 of file ior.c.

References NULL, IOR_test_t::params, IOR_param_t::repetitions, IOR_test_t::results, and safeMalloc().

Referenced by ParseCommandLine(), and ReadConfigScript().

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

◆ CheckFileSize()

static void CheckFileSize ( IOR_test_t test,
IOR_offset_t  dataMoved,
int  rep 
)
static

◆ CheckForOutliers()

static void CheckForOutliers ( IOR_param_t test,
double **  timer,
int  rep,
int  access 
)
static

Definition at line 259 of file ior.c.

References DisplayOutliers(), IOR_param_t::numTasks, IOR_param_t::outlierThreshold, and WRITE.

Referenced by TestIoSys().

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

◆ CompareBuffers()

static size_t CompareBuffers ( void *  expectedBuffer,
void *  unknownBuffer,
size_t  size,
IOR_offset_t  transferCount,
IOR_param_t test,
int  access 
)
static

Definition at line 330 of file ior.c.

References ERR, GetTestFileName(), MAX_PATHLEN, MAX_STR, IOR_param_t::offset, out_logfile, IOR_param_t::quitOnError, rank, READCHECK, TRUE, verbose, VERBOSE_2, VERBOSE_3, VERBOSE_5, and WRITECHECK.

Referenced by WriteOrReadSingle().

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

◆ CountErrors()

static int CountErrors ( IOR_param_t test,
int  access,
int  errors 
)
static

Definition at line 430 of file ior.c.

References IOR_param_t::checkRead, IOR_param_t::checkWrite, IOR_param_t::errorFound, MPI_CHECK, out_logfile, rank, testComm, IOR_param_t::timeStampSignatureValue, totalErrorCount, TRUE, WARN, and WRITECHECK.

Referenced by WriteOrRead().

Here is the caller graph for this function:

◆ CreateTest()

IOR_test_t* CreateTest ( IOR_param_t init_params,
int  test_num 
)

Create new test for list of tests.

Definition at line 523 of file ior.c.

References ERR, GetPlatformName(), IOR_param_t::id, IOR_test_t::next, NULL, IOR_test_t::params, IOR_param_t::platform, and IOR_test_t::results.

Referenced by ParseCommandLine(), and ReadConfigScript().

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

◆ DestroyTest()

static void DestroyTest ( IOR_test_t test)
static

Definition at line 539 of file ior.c.

References FreeResults().

Referenced by DestroyTests().

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

◆ DestroyTests()

static void DestroyTests ( IOR_test_t tests_head)
static

Definition at line 545 of file ior.c.

References DestroyTest(), IOR_test_t::next, and NULL.

Referenced by ior_main().

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

◆ DisplayOutliers()

static void DisplayOutliers ( int  numTasks,
double  timerVal,
char *  timeString,
int  access,
int  outlierThreshold 
)
static

Definition at line 222 of file ior.c.

References MAX_STR, results::mean, MPI_CHECK, numTasks, out_logfile, rank, results::sd, results::sum, testComm, results::var, wall_clock_delta, and WRITE.

Referenced by CheckForOutliers().

Here is the caller graph for this function:

◆ DistributeHints()

void DistributeHints ( void  )

Definition at line 558 of file ior.c.

References environ, MAX_HINTS, MAX_STR, MPI_CHECK, NULL, rank, and WARN.

Referenced by InitTests().

Here is the caller graph for this function:

◆ file_hits_histogram()

static void file_hits_histogram ( IOR_param_t params)
static

Definition at line 1034 of file ior.c.

References MPI_CHECK, mpi_comm_world, NULL, numTasks, IOR_param_t::numTasks, out_logfile, rank, and rankOffset.

Referenced by TestIoSys().

Here is the caller graph for this function:

◆ FillBuffer()

static void FillBuffer ( void *  buffer,
IOR_param_t test,
unsigned long long  offset,
int  fillrank 
)
static

◆ FillIncompressibleBuffer()

static void FillIncompressibleBuffer ( void *  buffer,
IOR_param_t test 
)
static

Definition at line 605 of file ior.c.

References IOR_param_t::incompressibleSeed, and IOR_param_t::transferSize.

Referenced by FillBuffer().

Here is the caller graph for this function:

◆ FreeResults()

void FreeResults ( IOR_test_t test)

Definition at line 512 of file ior.c.

References NULL, and IOR_test_t::results.

Referenced by DestroyTest().

Here is the caller graph for this function:

◆ GetOffsetArrayRandom()

static IOR_offset_t* GetOffsetArrayRandom ( IOR_param_t test,
int  pretendRank,
int  access 
)
static

Returns a precomputed array of IOR_offset_t for the inner benchmark loop. They get created sequentially and mixed up in the end. The last array element is set to -1 as end marker. It should be noted that as the seeds get synchronised across all processes every process computes the same random order if used with filePerProc. For a shared file all transfers get randomly assigned to ranks. The processes can also have differen't numbers of transfers. This might lead to a bigger diversion in accesse as it dose with filePerProc. This is expected but should be mined.

Parameters
testIOR_param_t for getting transferSize, blocksize and SegmentCount
pretendRankint pretended Rank for shifting the offsest corectly
Returns
IOR_offset_t

Definition at line 1709 of file ior.c.

References IOR_param_t::blockSize, ERR, FALSE, IOR_param_t::filePerProc, NULL, IOR_param_t::numTasks, IOR_param_t::randomSeed, READ, SeedRandGen(), IOR_param_t::segmentCount, IOR_param_t::testComm, IOR_param_t::transferSize, and WRITE.

Referenced by WriteOrRead().

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

◆ GetOffsetArraySequential()

static IOR_offset_t* GetOffsetArraySequential ( IOR_param_t test,
int  pretendRank 
)
static

Returns a precomputed array of IOR_offset_t for the inner benchmark loop. They are sequential and the last element is set to -1 as end marker.

Parameters
testIOR_param_t for getting transferSize, blocksize and SegmentCount
pretendRankint pretended Rank for shifting the offsest corectly
Returns
IOR_offset_t

Definition at line 1659 of file ior.c.

References IOR_param_t::blockSize, ERR, IOR_param_t::filePerProc, NULL, IOR_param_t::numTasks, IOR_param_t::segmentCount, and IOR_param_t::transferSize.

Referenced by WriteOrRead().

Here is the caller graph for this function:

◆ GetPlatformName()

char* GetPlatformName ( )

Definition at line 657 of file ior.c.

References EWARN, and MAX_STR.

Referenced by CreateTest(), and ParseCommandLine().

Here is the caller graph for this function:

◆ GetTestFileName()

void GetTestFileName ( char *  testFileName,
IOR_param_t test 
)

Definition at line 742 of file ior.c.

References ERR, IOR_param_t::filePerProc, MAX_PATHLEN, MAX_STR, IOR_param_t::numTasks, ParseFileName(), PrependDir(), rank, rankOffset, IOR_param_t::repCounter, IOR_param_t::testFileName, TRUE, and IOR_param_t::uniqueDir.

Referenced by CompareBuffers(), DisplayFreespace(), RemoveFile(), and TestIoSys().

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

◆ HogMemory()

static void* HogMemory ( IOR_param_t params)
static

Definition at line 1094 of file ior.c.

References ERR, malloc_and_touch(), IOR_param_t::memoryPerNode, IOR_param_t::memoryPerTask, NULL, out_logfile, size, IOR_param_t::tasksPerNode, verbose, and VERBOSE_3.

Referenced by TestIoSys().

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

◆ init_IOR_Param_t()

void init_IOR_Param_t ( IOR_param_t p)

◆ InitTests()

static void InitTests ( IOR_test_t tests,
MPI_Comm  com 
)
static

◆ ior_main()

int ior_main ( int  argc,
char **  argv 
)

◆ ior_run()

IOR_test_t* ior_run ( int  argc,
char **  argv,
MPI_Comm  world_com,
FILE *  world_out 
)

◆ malloc_and_touch()

static void* malloc_and_touch ( size_t  size)
static

Definition at line 1012 of file ior.c.

References NULL, and size.

Referenced by HogMemory().

Here is the caller graph for this function:

◆ ParseFileName()

static char ** ParseFileName ( char *  name,
int *  count 
)
static

Definition at line 701 of file ior.c.

References ERR, FILENAME_DELIMITER, and NULL.

Referenced by GetTestFileName().

Here is the caller graph for this function:

◆ PrependDir()

static char * PrependDir ( IOR_param_t test,
char *  rootDir 
)
static

Definition at line 791 of file ior.c.

References ERR, MAX_STR, NULL, IOR_param_t::numTasks, rank, and rankOffset.

Referenced by GetTestFileName().

Here is the caller graph for this function:

◆ ReduceIterResults()

static void ReduceIterResults ( IOR_test_t test,
double **  timer,
int  rep,
int  access 
)
static

Definition at line 852 of file ior.c.

References IOR_results_t::aggFileSizeForBW, MPI_CHECK, PrintReducedResult(), rank, READ, IOR_results_t::readTime, IOR_test_t::results, testComm, verbose, VERBOSE_0, WRITE, and IOR_results_t::writeTime.

Referenced by TestIoSys().

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

◆ RemoveFile()

static void RemoveFile ( char *  testFileName,
int  filePerProc,
IOR_param_t test 
)
static

Definition at line 905 of file ior.c.

References ior_aiori::access, ior_aiori::delete, GetTestFileName(), rank, rankOffset, IOR_param_t::reorderTasksRandom, and TRUE.

Referenced by TestIoSys().

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

◆ safeMalloc()

static void* safeMalloc ( uint64_t  size)
static

Definition at line 493 of file ior.c.

References ERR, and NULL.

Referenced by AllocResults().

Here is the caller graph for this function:

◆ test_time_elapsed()

int test_time_elapsed ( IOR_param_t params,
double  startTime 
)

Definition at line 1079 of file ior.c.

References GetTimeStamp(), and IOR_param_t::maxTimeDuration.

Referenced by TestIoSys().

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

◆ TestIoSys()

static void TestIoSys ( IOR_test_t test)
static

Definition at line 1123 of file ior.c.

References IOR_results_t::aggFileSizeFromStat, aiori_select(), IOR_param_t::api, IO_BUFFERS::buffer, CheckFileSize(), CheckForOutliers(), IOR_param_t::checkRead, IOR_param_t::checkWrite, ior_aiori::close, CountTasksPerNode(), ior_aiori::create, CurrentTimeString(), IOR_param_t::deadlineForStonewalling, DelaySecs(), ERR, ERR_SIMPLE, IOR_param_t::errorFound, FALSE, file_hits_histogram(), IOR_param_t::filePerProc, FillBuffer(), ior_aiori::get_file_size, GetTestFileName(), GetTimeStamp(), HogMemory(), IOR_param_t::interTestDelay, IOR_param_t::intraTestBarriers, IOR_param_t::keepFile, IOR_param_t::keepFileWithError, MAX_STR, MPI_CHECK, mpi_comm_world, IOR_param_t::multiFile, IOR_param_t::nodes, NULL, IOR_param_t::numTasks, numTasksWorld, ior_aiori::open, IOR_param_t::open, out_logfile, IOR_param_t::outlierThreshold, IOR_results_t::pairs_accessed, IOR_test_t::params, PrintLongSummaryHeader(), PrintLongSummaryOneTest(), PrintRemoveTiming(), PrintRepeatEnd(), PrintRepeatStart(), PrintShortSummary(), PrintTableHeader(), rank, rankOffset, READ, READCHECK, IO_BUFFERS::readCheckBuffer, IOR_param_t::readFile, ReadStoneWallingIterations(), ReduceIterResults(), RemoveFile(), IOR_param_t::reorderTasks, IOR_param_t::reorderTasksRandom, IOR_param_t::reorderTasksRandomSeed, IOR_param_t::repCounter, IOR_param_t::repetitions, reseed_incompressible_prng, IOR_test_t::results, IOR_param_t::setTimeStampSignature, ShowSetup(), IOR_param_t::stoneWallingStatusFile, IOR_param_t::stoneWallingWearOutIterations, IOR_param_t::summary_every_test, IOR_param_t::taskPerNodeOffset, IOR_param_t::tasksPerNode, test_time_elapsed(), testComm, IOR_param_t::testComm, IOR_param_t::timeStampSignatureValue, TRUE, IOR_param_t::useExistingTestFile, verbose, IOR_param_t::verbose, VERBOSE_0, VERBOSE_1, VERBOSE_2, VERBOSE_3, VERBOSE_4, WRITE, WRITECHECK, IOR_param_t::writeFile, WriteOrRead(), WriteTimes(), XferBuffersFree(), and XferBuffersSetup().

Referenced by ior_main(), and ior_run().

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

◆ ValidateTests()

static void ValidateTests ( IOR_param_t test)
static

◆ WriteOrRead()

static IOR_offset_t WriteOrRead ( IOR_param_t test,
IOR_results_t results,
void *  fd,
int  access,
IOR_io_buffers ioBuffers 
)
static

◆ WriteOrReadSingle()

static IOR_offset_t WriteOrReadSingle ( IOR_offset_t  pairCnt,
IOR_offset_t offsetArray,
int  pretendRank,
IOR_offset_t transferCount,
int *  errors,
IOR_param_t test,
int *  fd,
IOR_io_buffers ioBuffers,
int  access 
)
static

Definition at line 1779 of file ior.c.

References IO_BUFFERS::buffer, IO_BUFFERS::checkBuffer, CompareBuffers(), ERR, FillBuffer(), IOR_param_t::offset, READ, READCHECK, IO_BUFFERS::readCheckBuffer, IOR_param_t::storeFileOffset, IOR_param_t::transferSize, TRUE, WRITE, WRITECHECK, and ior_aiori::xfer.

Referenced by WriteOrRead().

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

◆ WriteTimes()

static void WriteTimes ( IOR_param_t test,
double **  timer,
int  iteration,
int  writeOrRead 
)
static

Definition at line 1921 of file ior.c.

References ERR, IOR_param_t::id, MAX_STR, out_logfile, rank, READ, and WRITE.

Referenced by TestIoSys().

Here is the caller graph for this function:

◆ XferBuffersFree()

static void XferBuffersFree ( IOR_io_buffers ioBuffers,
IOR_param_t test 
)
static

Definition at line 992 of file ior.c.

References aligned_buffer_free(), IO_BUFFERS::buffer, IO_BUFFERS::checkBuffer, IOR_param_t::checkRead, IOR_param_t::checkWrite, and IO_BUFFERS::readCheckBuffer.

Referenced by TestIoSys().

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

◆ XferBuffersSetup()

static void XferBuffersSetup ( IOR_io_buffers ioBuffers,
IOR_param_t test,
int  pretendRank 
)
static

Definition at line 974 of file ior.c.

References aligned_buffer_alloc(), IO_BUFFERS::buffer, IO_BUFFERS::checkBuffer, IOR_param_t::checkRead, IOR_param_t::checkWrite, IO_BUFFERS::readCheckBuffer, and IOR_param_t::transferSize.

Referenced by TestIoSys().

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

Variable Documentation

◆ backend

const ior_aiori_t* backend
static

Definition at line 43 of file ior.c.

Referenced by ParseCommandLine().

◆ environ

char** environ

Referenced by DistributeHints().

◆ reseed_incompressible_prng

unsigned int reseed_incompressible_prng = TRUE

Definition at line 619 of file ior.c.

Referenced by FillBuffer(), and TestIoSys().

◆ totalErrorCount

int totalErrorCount
static

Definition at line 42 of file ior.c.

Referenced by CountErrors(), ior_main(), ior_run(), and WriteOrRead().