IOR
Data Structures | Macros | Functions | Variables
md-workbench.c File Reference
#include <mpi.h>
#include <time.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include "md-workbench.h"
#include "config.h"
#include "aiori.h"
#include "utilities.h"
#include "parse_options.h"
Include dependency graph for md-workbench.c:

Go to the source code of this file.

Data Structures

struct  op_stat_t
 
struct  time_result_t
 
struct  phase_stat_t
 
struct  benchmark_options
 

Macros

#define DIRMODE   S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH
 
#define CHECK_MPI_RET(ret)   if (ret != MPI_SUCCESS){ printf("Unexpected error in MPI on Line %d\n", __LINE__);}
 
#define LLU   (long long unsigned)
 
#define min(a, b)   (a < b ? a : b)
 
#define oprintf(...)   do { fprintf(o.logfile, __VA_ARGS__); fflush(o.logfile); } while(0);
 

Functions

static void def_dset_name (char *out_name, int n, int d)
 
static void def_obj_name (char *out_name, int n, int d, int i)
 
void init_options ()
 
static void mdw_wait (double runtime)
 
static void init_stats (phase_stat_t *p, size_t repeats)
 
static float add_timed_result (double start, double phase_start_timer, time_result_t *results, size_t pos, double *max_time, double *out_op_time)
 
static void print_detailed_stat_header ()
 
static int sum_err (phase_stat_t *p)
 
static double statistics_mean (int count, double *arr)
 
static double statistics_std_dev (int count, double *arr)
 
static void statistics_minmax (int count, double *arr, double *out_min, double *out_max)
 
static void print_p_stat (char *buff, const char *name, phase_stat_t *p, double t, int print_global)
 
static int compare_floats (time_result_t *x, time_result_t *y)
 
static double runtime_quantile (int repeats, time_result_t *times, float quantile)
 
static uint64_t aggregate_timers (int repeats, int max_repeats, time_result_t *times, time_result_t *global_times)
 
static void compute_histogram (const char *name, time_result_t *times, time_statistics_t *stats, size_t repeats, int writeLatencyFile)
 
static void end_phase (const char *name, phase_stat_t *p)
 
void run_precreate (phase_stat_t *s, int current_index)
 
void run_benchmark (phase_stat_t *s, int *current_index_p)
 
void run_cleanup (phase_stat_t *s, int start_index)
 
static void printTime ()
 
static int return_position ()
 
static void store_position (int position)
 
mdworkbench_results_tmd_workbench_run (int argc, char **argv, MPI_Comm world_com, FILE *out_logfile)
 

Variables

struct benchmark_options o
 
static option_help options []
 

Macro Definition Documentation

◆ CHECK_MPI_RET

#define CHECK_MPI_RET (   ret)    if (ret != MPI_SUCCESS){ printf("Unexpected error in MPI on Line %d\n", __LINE__);}

Definition at line 24 of file md-workbench.c.

Referenced by aggregate_timers(), end_phase(), and run_benchmark().

◆ DIRMODE

#define DIRMODE   S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH

Definition at line 22 of file md-workbench.c.

Referenced by md_workbench_run(), and run_precreate().

◆ LLU

#define LLU   (long long unsigned)

Definition at line 25 of file md-workbench.c.

◆ min

#define min (   a,
 
)    (a < b ? a : b)

◆ oprintf

#define oprintf (   ...)    do { fprintf(o.logfile, __VA_ARGS__); fflush(o.logfile); } while(0);

Function Documentation

◆ add_timed_result()

static float add_timed_result ( double  start,
double  phase_start_timer,
time_result_t results,
size_t  pos,
double *  max_time,
double *  out_op_time 
)
static

Definition at line 181 of file md-workbench.c.

References GetTimeStamp(), time_result_t::runtime, and time_result_t::time_since_app_start.

Referenced by run_benchmark(), run_cleanup(), and run_precreate().

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

◆ aggregate_timers()

static uint64_t aggregate_timers ( int  repeats,
int  max_repeats,
time_result_t times,
time_result_t global_times 
)
static

Definition at line 356 of file md-workbench.c.

References CHECK_MPI_RET, benchmark_options::com, o, benchmark_options::rank, and benchmark_options::size.

Referenced by end_phase().

Here is the caller graph for this function:

◆ compare_floats()

static int compare_floats ( time_result_t x,
time_result_t y 
)
static

Definition at line 346 of file md-workbench.c.

References time_result_t::runtime.

Referenced by compute_histogram().

Here is the caller graph for this function:

◆ compute_histogram()

static void compute_histogram ( const char *  name,
time_result_t times,
time_statistics_t stats,
size_t  repeats,
int  writeLatencyFile 
)
static

◆ def_dset_name()

static void def_dset_name ( char *  out_name,
int  n,
int  d 
)
static

Definition at line 130 of file md-workbench.c.

References o, and benchmark_options::prefix.

Referenced by run_cleanup(), and run_precreate().

Here is the caller graph for this function:

◆ def_obj_name()

static void def_obj_name ( char *  out_name,
int  n,
int  d,
int  i 
)
static

Definition at line 134 of file md-workbench.c.

References o, and benchmark_options::prefix.

Referenced by run_benchmark(), run_cleanup(), and run_precreate().

Here is the caller graph for this function:

◆ end_phase()

static void end_phase ( const char *  name,
phase_stat_t p 
)
static

◆ init_options()

void init_options ( )

Definition at line 138 of file md-workbench.c.

References benchmark_options::interface, and o.

Referenced by md_workbench_run().

Here is the caller graph for this function:

◆ init_stats()

static void init_stats ( phase_stat_t p,
size_t  repeats 
)
static

Definition at line 171 of file md-workbench.c.

References phase_stat_t::repeats, phase_stat_t::time_create, phase_stat_t::time_delete, phase_stat_t::time_read, and phase_stat_t::time_stat.

Referenced by end_phase(), and md_workbench_run().

Here is the caller graph for this function:

◆ md_workbench_run()

mdworkbench_results_t* md_workbench_run ( int  argc,
char **  argv,
MPI_Comm  world_com,
FILE *  out_logfile 
)

Definition at line 876 of file md-workbench.c.

References benchmark_options::adaptive_waiting_mode, aiori_select(), airoi_create_all_module_options(), airoi_update_module_options(), benchmark_options::backend, benchmark_options::backend_options, ior_aiori::check_params, benchmark_options::com, mdworkbench_results_t::count, DIRMODE, benchmark_options::dset_count, ior_aiori::enable_mdtest, end_phase(), ERR, EWARNF, benchmark_options::file_size, ior_aiori::finalize, GetTimeStamp(), benchmark_options::global_iteration, global_options, benchmark_options::hints, init_clock(), init_options(), init_stats(), ior_aiori::initialize, benchmark_options::interface, benchmark_options::iterations, benchmark_options::logfile, ior_aiori::mkdir, NULL, benchmark_options::num, o, oprintf, option_parse(), out_logfile, benchmark_options::phase_benchmark, benchmark_options::phase_cleanup, benchmark_options::phase_precreate, phase_stat_t::phase_start_timer, benchmark_options::precreate, benchmark_options::prefix, print_detailed_stat_header(), benchmark_options::print_detailed_stats, printTime(), benchmark_options::quiet_output, benchmark_options::random_buffer_offset, benchmark_options::rank, benchmark_options::relative_waiting_factor, benchmark_options::results, return_position(), ior_aiori::rmdir, run_benchmark(), run_cleanup(), run_precreate(), benchmark_options::size, benchmark_options::start_item_number, benchmark_options::stonewall_timer, benchmark_options::stonewall_timer_wear_out, store_position(), phase_stat_t::t, and ior_aiori::xfer_hints.

Referenced by main().

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

◆ mdw_wait()

static void mdw_wait ( double  runtime)
static

Definition at line 152 of file md-workbench.c.

References GetTimeStamp(), NULL, o, and benchmark_options::relative_waiting_factor.

Referenced by run_benchmark().

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

◆ print_detailed_stat_header()

static void print_detailed_stat_header ( )
static

Definition at line 193 of file md-workbench.c.

Referenced by md_workbench_run().

Here is the caller graph for this function:

◆ print_p_stat()

static void print_p_stat ( char *  buff,
const char *  name,
phase_stat_t p,
double  t,
int  print_global 
)
static

◆ printTime()

static void printTime ( )
static

Definition at line 837 of file md-workbench.c.

References oprintf.

Referenced by md_workbench_run().

Here is the caller graph for this function:

◆ return_position()

static int return_position ( )
static

Definition at line 844 of file md-workbench.c.

References benchmark_options::com, ERRF, o, benchmark_options::rank, and benchmark_options::run_info_file.

Referenced by md_workbench_run().

Here is the caller graph for this function:

◆ run_benchmark()

void run_benchmark ( phase_stat_t s,
int *  current_index_p 
)

Definition at line 594 of file md-workbench.c.

References add_timed_result(), aligned_buffer_alloc(), aligned_buffer_free(), benchmark_options::backend, benchmark_options::backend_options, CHECK_MPI_RET, ior_aiori::close, benchmark_options::com, ior_aiori::create, def_obj_name(), ior_aiori::delete, benchmark_options::dset_count, op_stat_t::err, ERRF, EWARNF, FAIL, benchmark_options::file_size, generate_memory_pattern(), GetTimeStamp(), benchmark_options::gpu_memory_flags, benchmark_options::ignore_precreate_errors, IOR_CREAT, IOR_RDONLY, IOR_WRONLY, phase_stat_t::max_op_time, MAX_PATHLEN, mdw_wait(), NULL, benchmark_options::num, o, phase_stat_t::obj_create, phase_stat_t::obj_delete, phase_stat_t::obj_read, phase_stat_t::obj_stat, benchmark_options::offset, ior_aiori::open, oprintf, phase_stat_t::phase_start_timer, benchmark_options::precreate, benchmark_options::random_buffer_offset, benchmark_options::rank, READ, benchmark_options::read_only, benchmark_options::relative_waiting_factor, phase_stat_t::repeats, benchmark_options::size, ior_aiori::stat, phase_stat_t::stonewall_iterations, benchmark_options::stonewall_timer, benchmark_options::stonewall_timer_wear_out, op_stat_t::suc, phase_stat_t::t, phase_stat_t::time_create, phase_stat_t::time_delete, phase_stat_t::time_read, phase_stat_t::time_stat, update_write_memory_pattern(), benchmark_options::verbosity, verify_memory_pattern(), benchmark_options::verify_read, WRITE, and ior_aiori::xfer.

Referenced by md_workbench_run().

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

◆ run_cleanup()

void run_cleanup ( phase_stat_t s,
int  start_index 
)

◆ run_precreate()

void run_precreate ( phase_stat_t s,
int  current_index 
)

◆ runtime_quantile()

static double runtime_quantile ( int  repeats,
time_result_t times,
float  quantile 
)
static

Definition at line 350 of file md-workbench.c.

References time_result_t::runtime.

Referenced by compute_histogram().

Here is the caller graph for this function:

◆ statistics_mean()

static double statistics_mean ( int  count,
double *  arr 
)
static

Definition at line 201 of file md-workbench.c.

References o, and benchmark_options::size.

Referenced by print_p_stat(), and statistics_std_dev().

Here is the caller graph for this function:

◆ statistics_minmax()

static void statistics_minmax ( int  count,
double *  arr,
double *  out_min,
double *  out_max 
)
static

Definition at line 218 of file md-workbench.c.

References min, o, and benchmark_options::size.

Referenced by print_p_stat().

Here is the caller graph for this function:

◆ statistics_std_dev()

static double statistics_std_dev ( int  count,
double *  arr 
)
static

Definition at line 209 of file md-workbench.c.

References o, benchmark_options::size, and statistics_mean().

Referenced by print_p_stat().

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

◆ store_position()

static void store_position ( int  position)
static

Definition at line 863 of file md-workbench.c.

References ERRF, o, benchmark_options::rank, and benchmark_options::run_info_file.

Referenced by md_workbench_run().

Here is the caller graph for this function:

◆ sum_err()

static int sum_err ( phase_stat_t p)
static

Variable Documentation

◆ o

◆ options

option_help options[]
static

Definition at line 803 of file md-workbench.c.