IOR
Enumerations | 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.

Enumerations

enum  {
  IOR_TIMER_OPEN_START, IOR_TIMER_OPEN_STOP, IOR_TIMER_RDWR_START, IOR_TIMER_RDWR_STOP,
  IOR_TIMER_CLOSE_START, IOR_TIMER_CLOSE_STOP, IOR_NB_TIMERS
}
 

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 *)
 
static void TestIoSys (IOR_test_t *)
 
static void ValidateTests (IOR_param_t *params, MPI_Comm com)
 
static IOR_offset_t WriteOrRead (IOR_param_t *test, IOR_results_t *results, aiori_fd_t *fd, const int access, IOR_io_buffers *ioBuffers)
 
static void ior_set_xfer_hints (IOR_param_t *p)
 
static int test_initialize (IOR_test_t *test)
 
static void test_finalize (IOR_test_t *test)
 
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, MPI_Comm com)
 
static void DisplayOutliers (int numTasks, double timerVal, char *timeString, int access, int outlierThreshold)
 
static void CheckForOutliers (IOR_param_t *test, const double *timer, const int access)
 
static void CheckFileSize (IOR_test_t *test, char *testFilename, IOR_offset_t dataMoved, int rep, const int access)
 
static size_t CompareData (void *expectedBuffer, size_t size, IOR_param_t *test, IOR_offset_t offset, int fillrank, int access)
 
static int CountErrors (IOR_param_t *test, int access, int errors)
 
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)
 
static void DistributeHints (MPI_Comm com)
 
char * GetPlatformName ()
 
void GetTestFileName (char *testFileName, IOR_param_t *test)
 
static void ReduceIterResults (IOR_test_t *test, double *timer, const int rep, const 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 void WriteTimes (IOR_param_t *test, const double *timer, const int iteration, const int access)
 
static void StoreRankInformation (IOR_test_t *test, double *timer, const int rep, const int access)
 
static void ProcessIterResults (IOR_test_t *test, double *timer, const int rep, const int access)
 
IOR_offset_tGetOffsetArrayRandom (IOR_param_t *test, int pretendRank, IOR_offset_t *out_count)
 
static IOR_offset_t WriteOrReadSingle (IOR_offset_t offset, int pretendRank, IOR_offset_t transfer, int *errors, IOR_param_t *test, aiori_fd_t *fd, IOR_io_buffers *ioBuffers, int access)
 
static void prefillSegment (IOR_param_t *test, void *randomPrefillBuffer, int pretendRank, aiori_fd_t *fd, IOR_io_buffers *ioBuffers, int startSegment, int endSegment)
 

Variables

char ** environ
 
static int totalErrorCount
 
static const ior_aiori_tbackend
 
int aiori_warning_as_errors = 0
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
IOR_TIMER_OPEN_START 
IOR_TIMER_OPEN_STOP 
IOR_TIMER_RDWR_START 
IOR_TIMER_RDWR_STOP 
IOR_TIMER_CLOSE_START 
IOR_TIMER_CLOSE_STOP 
IOR_NB_TIMERS 

Definition at line 48 of file ior.c.

Function Documentation

◆ AllocResults()

void AllocResults ( IOR_test_t test)

Definition at line 456 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,
char *  testFilename,
IOR_offset_t  dataMoved,
int  rep,
const int  access 
)
static

◆ CheckForOutliers()

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

Definition at line 335 of file ior.c.

References DisplayOutliers(), IOR_TIMER_CLOSE_START, IOR_TIMER_CLOSE_STOP, IOR_TIMER_OPEN_START, IOR_TIMER_OPEN_STOP, IOR_TIMER_RDWR_START, IOR_TIMER_RDWR_STOP, IOR_param_t::numTasks, and IOR_param_t::outlierThreshold.

Referenced by ProcessIterResults().

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

◆ CompareData()

static size_t CompareData ( void *  expectedBuffer,
size_t  size,
IOR_param_t test,
IOR_offset_t  offset,
int  fillrank,
int  access 
)
static

Definition at line 418 of file ior.c.

References IOR_param_t::dataPacketType, IOR_param_t::gpuMemoryFlags, READCHECK, IOR_param_t::timeStampSignatureValue, verify_memory_pattern(), 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 427 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, WARNF, 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 477 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 493 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 499 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 294 of file ior.c.

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

Referenced by CheckForOutliers().

Here is the caller graph for this function:

◆ DistributeHints()

static void DistributeHints ( MPI_Comm  com)
static

Definition at line 512 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 948 of file ior.c.

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

Referenced by TestIoSys().

Here is the caller graph for this function:

◆ FreeResults()

void FreeResults ( IOR_test_t test)

Definition at line 466 of file ior.c.

References NULL, and IOR_test_t::results.

Referenced by DestroyTest().

Here is the caller graph for this function:

◆ GetOffsetArrayRandom()

IOR_offset_t* GetOffsetArrayRandom ( IOR_param_t test,
int  pretendRank,
IOR_offset_t out_count 
)

Returns a precomputed array of IOR_offset_t for the inner benchmark loop. They get created sequentially and mixed up in the end. It should be noted that as the seeds get synchronised across all processes if not FilePerProcess is set every process computes the same random order. 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 offsets correctly
Returns
IOR_offset_t

Definition at line 1574 of file ior.c.

References IOR_param_t::blockSize, IOR_param_t::filePerProc, MPI_CHECK, NULL, IOR_param_t::numTasks, IOR_param_t::randomSeed, rank, safeMalloc(), IOR_param_t::testComm, and IOR_param_t::transferSize.

Referenced by WriteOrRead().

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

◆ GetPlatformName()

char* GetPlatformName ( void  )

Definition at line 551 of file ior.c.

References MAX_STR, and WARN.

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 636 of file ior.c.

References IOR_param_t::dualMount, ERR, IOR_param_t::filePerProc, GetProcessorAndCore(), 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 RemoveFile(), ShowTestStart(), 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 1008 of file ior.c.

References ERR, malloc_and_touch(), IOR_param_t::memoryPerNode, IOR_param_t::memoryPerTask, NULL, IOR_param_t::numTasksOnNode0, out_logfile, 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,
MPI_Comm  com 
)

◆ InitTests()

static void InitTests ( IOR_test_t tests)
static

◆ ior_main()

int ior_main ( int  argc,
char **  argv 
)

Definition at line 189 of file ior.c.

References DestroyTests(), InitTests(), MPI_CHECK, IOR_test_t::next, NULL, out_logfile, out_resultfile, ParseCommandLine(), PrintHeader(), PrintLongSummaryAllTests(), PrintTestEnds(), rank, ShowTestEnd(), test_finalize(), test_initialize(), TestIoSys(), totalErrorCount, verbose, VERBOSE_0, VERBOSE_1, and VERBOSE_4.

Referenced by main().

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

◆ ior_run()

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

◆ ior_set_xfer_hints()

static void ior_set_xfer_hints ( IOR_param_t p)
static

◆ malloc_and_touch()

static void* malloc_and_touch ( size_t  size)
static

Definition at line 926 of file ior.c.

References NULL.

Referenced by HogMemory().

Here is the caller graph for this function:

◆ ParseFileName()

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

Definition at line 595 of file ior.c.

References ERR, FILENAME_DELIMITER, and NULL.

Referenced by GetTestFileName().

Here is the caller graph for this function:

◆ prefillSegment()

static void prefillSegment ( IOR_param_t test,
void *  randomPrefillBuffer,
int  pretendRank,
aiori_fd_t fd,
IOR_io_buffers ioBuffers,
int  startSegment,
int  endSegment 
)
static

Definition at line 1692 of file ior.c.

References IOR_param_t::blockSize, IO_BUFFERS::buffer, IOR_param_t::filePerProc, IOR_param_t::numTasks, IOR_param_t::randomPrefillBlocksize, WRITE, and WriteOrReadSingle().

Referenced by WriteOrRead().

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

◆ PrependDir()

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

Definition at line 691 of file ior.c.

References ior_aiori::access, IOR_param_t::backend_options, ERR, ERRF, MAX_STR, ior_aiori::mkdir, NULL, IOR_param_t::numTasks, rank, and rankOffset.

Referenced by GetTestFileName().

Here is the caller graph for this function:

◆ ProcessIterResults()

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

Definition at line 1133 of file ior.c.

References CheckForOutliers(), IOR_param_t::outlierThreshold, IOR_test_t::params, ReduceIterResults(), IOR_param_t::saveRankDetailsCSV, StoreRankInformation(), verbose, VERBOSE_3, and WriteTimes().

Referenced by TestIoSys().

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

◆ ReduceIterResults()

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

◆ RemoveFile()

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

Definition at line 805 of file ior.c.

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

Referenced by TestIoSys().

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

◆ StoreRankInformation()

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

◆ test_finalize()

static void test_finalize ( IOR_test_t test)
static

Definition at line 145 of file ior.c.

References IOR_param_t::backend, IOR_param_t::backend_options, ior_aiori::finalize, MPI_CHECK, IOR_param_t::mpi_comm_world, IOR_test_t::params, and testComm.

Referenced by ior_main(), and ior_run().

Here is the caller graph for this function:

◆ test_initialize()

static int test_initialize ( IOR_test_t test)
static

◆ test_time_elapsed()

int test_time_elapsed ( IOR_param_t params,
double  startTime 
)

Definition at line 993 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 1151 of file ior.c.

References IOR_param_t::backend_options, IO_BUFFERS::buffer, CheckFileSize(), IOR_param_t::checkRead, IOR_param_t::checkWrite, ior_aiori::close, ior_aiori::create, CurrentTimeString(), IOR_param_t::dataPacketType, IOR_param_t::deadlineForStonewalling, DelaySecs(), ERR, IOR_param_t::errorFound, FAIL, FALSE, file_hits_histogram(), aiori_xfer_hint_t::filePerProc, IOR_param_t::filePerProc, generate_memory_pattern(), GetTestFileName(), GetTimeStamp(), IOR_param_t::gpuMemoryFlags, IOR_param_t::hints, HogMemory(), IOR_param_t::interTestDelay, IOR_param_t::intraTestBarriers, IOR_CREAT, IOR_NB_TIMERS, IOR_RDONLY, IOR_TIMER_CLOSE_START, IOR_TIMER_CLOSE_STOP, IOR_TIMER_OPEN_START, IOR_TIMER_OPEN_STOP, IOR_TIMER_RDWR_START, IOR_TIMER_RDWR_STOP, IOR_TRUNC, IOR_WRONLY, IOR_param_t::keepFile, IOR_param_t::keepFileWithError, MAX_STR, MPI_CHECK, IOR_param_t::multiFile, NULL, IOR_param_t::numNodes, IOR_param_t::numTasks, IOR_param_t::numTasksOnNode0, ior_aiori::open, IOR_param_t::open, out_logfile, IOR_point_t::pairs_accessed, IOR_test_t::params, PrintLongSummaryHeader(), PrintLongSummaryOneTest(), PrintRemoveTiming(), PrintRepeatEnd(), PrintShortSummary(), PrintTableHeader(), ProcessIterResults(), rank, rankOffset, READ, READCHECK, IOR_param_t::readFile, ReadStoneWallingIterations(), RemoveFile(), IOR_param_t::reorderTasks, IOR_param_t::reorderTasksRandom, IOR_param_t::reorderTasksRandomSeed, IOR_param_t::repCounter, IOR_param_t::repetitions, IOR_test_t::results, IOR_param_t::setTimeStampSignature, ShowSetup(), ior_aiori::stat, IOR_param_t::stoneWallingStatusFile, IOR_param_t::stoneWallingWearOutIterations, IOR_param_t::summary_every_test, IOR_param_t::taskPerNodeOffset, IOR_param_t::tasksBlockMapping, test_time_elapsed(), IOR_param_t::testComm, testComm, IOR_param_t::timeStampSignatureValue, IOR_param_t::transferSize, TRUE, IOR_param_t::useExistingTestFile, verbose, IOR_param_t::verbose, VERBOSE_0, VERBOSE_1, VERBOSE_2, VERBOSE_3, VERBOSE_4, WARN, WARNF, WRITE, IOR_results_t::write, WRITECHECK, IOR_param_t::writeFile, WriteOrRead(), 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 params,
MPI_Comm  com 
)
static

◆ WriteOrRead()

static IOR_offset_t WriteOrRead ( IOR_param_t test,
IOR_results_t results,
aiori_fd_t fd,
const int  access,
IOR_io_buffers ioBuffers 
)
static

◆ WriteOrReadSingle()

static IOR_offset_t WriteOrReadSingle ( IOR_offset_t  offset,
int  pretendRank,
IOR_offset_t  transfer,
int *  errors,
IOR_param_t test,
aiori_fd_t fd,
IOR_io_buffers ioBuffers,
int  access 
)
static

◆ WriteTimes()

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

◆ XferBuffersFree()

static void XferBuffersFree ( IOR_io_buffers ioBuffers,
IOR_param_t test 
)
static

Definition at line 915 of file ior.c.

References aligned_buffer_free(), IO_BUFFERS::buffer, and IOR_param_t::gpuMemoryFlags.

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 906 of file ior.c.

References aligned_buffer_alloc(), IO_BUFFERS::buffer, IOR_param_t::gpuMemoryFlags, 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

◆ aiori_warning_as_errors

int aiori_warning_as_errors = 0

Definition at line 93 of file ior.c.

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

◆ backend

const ior_aiori_t* backend
static

Definition at line 61 of file ior.c.

Referenced by updateParsedOptions().

◆ environ

char** environ

Referenced by DistributeHints().

◆ totalErrorCount

int totalErrorCount
static

Definition at line 60 of file ior.c.

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