IOR
Data Structures | Macros | Enumerations | Functions | Variables
mdtest.c File Reference
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include "option.h"
#include "utilities.h"
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#include "aiori.h"
#include "ior.h"
#include "mdtest.h"
#include <mpi.h>
Include dependency graph for mdtest.c:

Go to the source code of this file.

Data Structures

struct  mdtest_options_t
 
struct  rank_progress_t
 

Macros

#define FILEMODE   S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH
 
#define DIRMODE   S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH
 
#define RELEASE_VERS   META_VERSION
 
#define TEST_DIR   "test-dir"
 
#define ITEM_COUNT   25000
 
#define LLU   "%lu"
 
#define CHECK_STONE_WALL(p)   (((p)->stone_wall_timer_seconds != 0) && ((GetTimeStamp() - (p)->start_time) > (p)->stone_wall_timer_seconds))
 
#define VERBOSE(root, any, ...)   VerboseMessage(root,any,__LINE__,__VA_ARGS__)
 

Enumerations

enum  {
  MK_UNI_DIR, STAT_SUB_DIR, READ_SUB_DIR, RM_SUB_DIR,
  RM_UNI_DIR
}
 

Functions

void VerboseMessage (int root_level, int any_level, int line, char *format,...)
 
void offset_timers (double *t, int tcount)
 
void parse_dirpath (char *dirpath_arg)
 
static void prep_testdir (int j, int dir_iter)
 
static void phase_end ()
 
void unique_dir_access (int opt, char *to)
 
static void create_remove_dirs (const char *path, bool create, uint64_t itemNum)
 
static void remove_file (const char *path, uint64_t itemNum)
 
static void create_file (const char *path, uint64_t itemNum)
 
void create_remove_items_helper (const int dirs, const int create, const char *path, uint64_t itemNum, rank_progress_t *progress)
 
void collective_helper (const int dirs, const int create, const char *path, uint64_t itemNum, rank_progress_t *progress)
 
void create_remove_items (int currDepth, const int dirs, const int create, const int collective, const char *path, uint64_t dirNum, rank_progress_t *progress)
 
void mdtest_stat (const int random, const int dirs, const long dir_iter, const char *path, rank_progress_t *progress)
 
void mdtest_read (int random, int dirs, const long dir_iter, char *path)
 
void collective_create_remove (const int create, const int dirs, const int ntasks, const char *path, rank_progress_t *progress)
 
void rename_dir_test (const int dirs, const long dir_iter, const char *path, rank_progress_t *progress)
 
static void updateResult (mdtest_results_t *res, mdtest_test_num_t test, uint64_t item_count, int t, double *times, double *tBefore)
 
void directory_test (const int iteration, const int ntasks, const char *path, rank_progress_t *progress)
 
int updateStoneWallIterations (int iteration, uint64_t items_done, double tstart, uint64_t *out_max_iter)
 
void file_test_create (const int iteration, const int ntasks, const char *path, rank_progress_t *progress, double *t)
 
void file_test (const int iteration, const int ntasks, const char *path, rank_progress_t *progress)
 
char const * mdtest_test_name (int i)
 
static void StoreRankInformation (int iterations, mdtest_results_t *agg)
 
static mdtest_results_tget_result_index (mdtest_results_t *all_results, int proc, int iter, int interation_count)
 
static void summarize_results_rank0 (int iterations, mdtest_results_t *all_results, int print_time)
 
void summarize_results (int iterations, mdtest_results_t *results)
 
void md_validate_tests ()
 
void show_file_system_size (char *file_system)
 
void create_remove_directory_tree (int create, int currDepth, char *path, int dirNum, rank_progress_t *progress)
 
static void mdtest_iteration (int i, int j, MPI_Group testgroup, mdtest_results_t *summary_table)
 
void mdtest_init_args ()
 
mdtest_results_tmdtest_run (int argc, char **argv, MPI_Comm world_com, FILE *world_out)
 

Variables

static mdtest_options_t o
 

Macro Definition Documentation

◆ CHECK_STONE_WALL

#define CHECK_STONE_WALL (   p)    (((p)->stone_wall_timer_seconds != 0) && ((GetTimeStamp() - (p)->start_time) > (p)->stone_wall_timer_seconds))

Definition at line 195 of file mdtest.c.

Referenced by collective_helper(), create_remove_items_helper(), and mdtest_iteration().

◆ DIRMODE

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

◆ FILEMODE

#define FILEMODE   S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH

Definition at line 85 of file mdtest.c.

◆ ITEM_COUNT

#define ITEM_COUNT   25000

Definition at line 89 of file mdtest.c.

Referenced by create_file(), create_remove_dirs(), mdtest_read(), mdtest_stat(), and remove_file().

◆ LLU

#define LLU   "%lu"

◆ RELEASE_VERS

#define RELEASE_VERS   META_VERSION

Definition at line 87 of file mdtest.c.

Referenced by mdtest_run().

◆ TEST_DIR

#define TEST_DIR   "test-dir"

Definition at line 88 of file mdtest.c.

Referenced by prep_testdir().

◆ VERBOSE

#define VERBOSE (   root,
  any,
  ... 
)    VerboseMessage(root,any,__LINE__,__VA_ARGS__)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MK_UNI_DIR 
STAT_SUB_DIR 
READ_SUB_DIR 
RM_SUB_DIR 
RM_UNI_DIR 

Definition at line 198 of file mdtest.c.

Function Documentation

◆ collective_create_remove()

void collective_create_remove ( const int  create,
const int  dirs,
const int  ntasks,
const char *  path,
rank_progress_t progress 
)

◆ collective_helper()

void collective_helper ( const int  dirs,
const int  create,
const char *  path,
uint64_t  itemNum,
rank_progress_t progress 
)

◆ create_file()

static void create_file ( const char *  path,
uint64_t  itemNum 
)
static

◆ create_remove_directory_tree()

void create_remove_directory_tree ( int  create,
int  currDepth,
char *  path,
int  dirNum,
rank_progress_t progress 
)

◆ create_remove_dirs()

static void create_remove_dirs ( const char *  path,
bool  create,
uint64_t  itemNum 
)
static

◆ create_remove_items()

void create_remove_items ( int  currDepth,
const int  dirs,
const int  create,
const int  collective,
const char *  path,
uint64_t  dirNum,
rank_progress_t progress 
)

◆ create_remove_items_helper()

void create_remove_items_helper ( const int  dirs,
const int  create,
const char *  path,
uint64_t  itemNum,
rank_progress_t progress 
)

Definition at line 420 of file mdtest.c.

References CHECK_STONE_WALL, create_file(), create_remove_dirs(), rank_progress_t::items_done, rank_progress_t::items_per_dir, rank_progress_t::items_start, remove_file(), and VERBOSE.

Referenced by create_remove_items().

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

◆ directory_test()

void directory_test ( const int  iteration,
const int  ntasks,
const char *  path,
rank_progress_t progress 
)

◆ file_test()

void file_test ( const int  iteration,
const int  ntasks,
const char *  path,
rank_progress_t progress 
)

◆ file_test_create()

void file_test_create ( const int  iteration,
const int  ntasks,
const char *  path,
rank_progress_t progress,
double *  t 
)

◆ get_result_index()

static mdtest_results_t* get_result_index ( mdtest_results_t all_results,
int  proc,
int  iter,
int  interation_count 
)
static

Definition at line 1428 of file mdtest.c.

Referenced by summarize_results(), and summarize_results_rank0().

Here is the caller graph for this function:

◆ md_validate_tests()

void md_validate_tests ( )

◆ mdtest_init_args()

void mdtest_init_args ( )

Definition at line 2150 of file mdtest.c.

References mdtest_options_t::barriers.

Referenced by mdtest_run().

Here is the caller graph for this function:

◆ mdtest_iteration()

static void mdtest_iteration ( int  i,
int  j,
MPI_Group  testgroup,
mdtest_results_t summary_table 
)
static

Definition at line 1936 of file mdtest.c.

References ior_aiori::access, mdtest_options_t::backend, mdtest_options_t::backend_options, mdtest_options_t::base_tree_name, CHECK_STONE_WALL, mdtest_options_t::collective_creates, mdtest_options_t::create_only, create_remove_directory_tree(), DelaySecs(), mdtest_options_t::directory_loops, directory_test(), DIRMODE, mdtest_options_t::dirs_only, EWARNF, file_test(), mdtest_options_t::files_only, GetTimeStamp(), mdtest_results_t::items, mdtest_options_t::items_per_dir, rank_progress_t::items_per_dir, rank_progress_t::items_start, MDTEST_TREE_CREATE_NUM, MDTEST_TREE_REMOVE_NUM, mdtest_options_t::mk_name, ior_aiori::mkdir, mdtest_options_t::nstride, NULL, mdtest_options_t::num_dirs_in_tree, mdtest_options_t::path_count, mdtest_options_t::pre_delay, prep_testdir(), rank, mdtest_results_t::rate, mdtest_options_t::read_name, mdtest_options_t::remove_only, mdtest_options_t::rm_name, ior_aiori::rmdir, mdtest_options_t::shared_file, mdtest_options_t::size, mdtest_options_t::stat_name, rank_progress_t::stone_wall_timer_seconds, mdtest_results_t::stonewall_last_item, testComm, mdtest_options_t::testdir, mdtest_results_t::time, mdtest_options_t::unique_chdir_dir, mdtest_options_t::unique_dir_per_task, mdtest_options_t::unique_mk_dir, mdtest_options_t::unique_read_dir, mdtest_options_t::unique_rm_dir, mdtest_options_t::unique_rm_uni_dir, mdtest_options_t::unique_stat_dir, and VERBOSE.

Referenced by mdtest_run().

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

◆ mdtest_read()

void mdtest_read ( int  random,
int  dirs,
const long  dir_iter,
char *  path 
)

◆ mdtest_run()

mdtest_results_t* mdtest_run ( int  argc,
char **  argv,
MPI_Comm  world_com,
FILE *  world_out 
)

Definition at line 2158 of file mdtest.c.

References ior_aiori::access, aiori_select(), aiori_supported_apis(), aiori_warning_as_errors, airoi_create_all_module_options(), airoi_update_module_options(), aligned_buffer_alloc(), aligned_buffer_free(), mdtest_options_t::api, mdtest_options_t::backend, mdtest_options_t::backend_options, mdtest_options_t::barriers, mdtest_options_t::base_tree_name, mdtest_options_t::branch_factor, mdtest_options_t::call_sync, ior_aiori::check_params, mdtest_options_t::collective_creates, mdtest_options_t::create_only, mdtest_options_t::depth, mdtest_options_t::directory_loops, DIRMODE, mdtest_options_t::dirs_only, ior_aiori::enable_mdtest, ERR, EWARNF, FAIL, mdtest_options_t::filenames, mdtest_options_t::files_only, ior_aiori::finalize, generate_memory_pattern(), GetNumNodes(), GetNumTasksOnNode0(), global_options, mdtest_options_t::gpu_memory_flags, mdtest_options_t::hints, mdtest_options_t::hostname, init_clock(), ior_aiori::initialize, mdtest_options_t::items, mdtest_options_t::items_per_dir, LAST_OPTION, mdtest_options_t::leaf_only, LLU, mdtest_options_t::make_node, MAX_PATHLEN, md_validate_tests(), MDTEST, mdtest_init_args(), mdtest_iteration(), mdtest_options_t::mk_name, ior_aiori::mkdir, options_all_t::modules, mdtest_options_t::nstride, NULL, mdtest_options_t::num_dirs_in_tree, mdtest_options_t::num_dirs_in_tree_calc, OPTION_FLAG, OPTION_OPTIONAL_ARGUMENT, option_parse(), options, out_logfile, out_resultfile, parse_dirpath(), mdtest_options_t::path_count, mdtest_options_t::pid, mdtest_options_t::pre_delay, mdtest_options_t::print_all_proc, mdtest_options_t::print_rate_and_time, mdtest_options_t::print_time, PrintTimestamp(), QueryNodeMapping(), mdtest_options_t::rand_array, mdtest_options_t::random_buffer_offset, mdtest_options_t::random_seed, rank, mdtest_options_t::read_bytes, mdtest_options_t::read_name, mdtest_options_t::read_only, RELEASE_VERS, mdtest_options_t::remove_only, mdtest_options_t::rm_name, ior_aiori::rmdir, safeMalloc(), mdtest_options_t::saveRankDetailsCSV, mdtest_options_t::shared_file, ShowFileSystemSize(), mdtest_options_t::size, mdtest_options_t::stat_name, mdtest_options_t::stat_only, mdtest_options_t::stone_wall_timer_seconds, mdtest_options_t::stoneWallingStatusFile, StoreRankInformation(), summarize_results(), mdtest_options_t::summary_table, mdtest_options_t::sync_file, testComm, mdtest_options_t::testdirpath, mdtest_options_t::time_unique_dir_overhead, mdtest_options_t::uid, mdtest_options_t::unique_dir_per_task, verbose, VERBOSE, mdtest_options_t::verification_error, mdtest_options_t::verify_read, mdtest_options_t::verify_write, mdtest_options_t::write_buffer, mdtest_options_t::write_bytes, and ior_aiori::xfer_hints.

Referenced by main().

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

◆ mdtest_stat()

void mdtest_stat ( const int  random,
const int  dirs,
const long  dir_iter,
const char *  path,
rank_progress_t progress 
)

◆ mdtest_test_name()

char const* mdtest_test_name ( int  i)

◆ offset_timers()

void offset_timers ( double *  t,
int  tcount 
)

Definition at line 225 of file mdtest.c.

References GetTimeStamp(), and VERBOSE.

Referenced by directory_test(), file_test(), and file_test_create().

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

◆ parse_dirpath()

void parse_dirpath ( char *  dirpath_arg)

Definition at line 237 of file mdtest.c.

References mdtest_options_t::filenames, NULL, mdtest_options_t::path_count, safeMalloc(), and VERBOSE.

Referenced by mdtest_run().

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

◆ phase_end()

static void phase_end ( )
static

Definition at line 275 of file mdtest.c.

References mdtest_options_t::backend, mdtest_options_t::backend_options, mdtest_options_t::barriers, mdtest_options_t::call_sync, FAIL, ior_aiori::sync, and testComm.

Referenced by directory_test(), and file_test().

Here is the caller graph for this function:

◆ prep_testdir()

static void prep_testdir ( int  j,
int  dir_iter 
)
static

Definition at line 266 of file mdtest.c.

References TEST_DIR, mdtest_options_t::testdir, and mdtest_options_t::testdirpath.

Referenced by directory_test(), file_test(), file_test_create(), and mdtest_iteration().

Here is the caller graph for this function:

◆ remove_file()

static void remove_file ( const char *  path,
uint64_t  itemNum 
)
static

◆ rename_dir_test()

void rename_dir_test ( const int  dirs,
const long  dir_iter,
const char *  path,
rank_progress_t progress 
)

◆ show_file_system_size()

void show_file_system_size ( char *  file_system)

◆ StoreRankInformation()

static void StoreRankInformation ( int  iterations,
mdtest_results_t agg 
)
static

◆ summarize_results()

void summarize_results ( int  iterations,
mdtest_results_t results 
)

◆ summarize_results_rank0()

static void summarize_results_rank0 ( int  iterations,
mdtest_results_t all_results,
int  print_time 
)
static

◆ unique_dir_access()

void unique_dir_access ( int  opt,
char *  to 
)

◆ updateResult()

static void updateResult ( mdtest_results_t res,
mdtest_test_num_t  test,
uint64_t  item_count,
int  t,
double *  times,
double *  tBefore 
)
static

◆ updateStoneWallIterations()

int updateStoneWallIterations ( int  iteration,
uint64_t  items_done,
double  tstart,
uint64_t *  out_max_iter 
)

◆ VerboseMessage()

void VerboseMessage ( int  root_level,
int  any_level,
int  line,
char *  format,
  ... 
)

Definition at line 207 of file mdtest.c.

References out_logfile, rank, and verbose.

Variable Documentation

◆ o

mdtest_options_t o
static

Definition at line 180 of file mdtest.c.