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 "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  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   "1.9.3"
 
#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))
 

Enumerations

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

Functions

void offset_timers (double *t, int tcount)
 
void parse_dirpath (char *dirpath_arg)
 
static void prep_testdir (int j, int dir_iter)
 
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 directory_test (const int iteration, const int ntasks, const char *path, rank_progress_t *progress)
 
int updateStoneWallIterations (int iteration, rank_progress_t *progress, double tstart)
 
void file_test (const int iteration, const int ntasks, const char *path, rank_progress_t *progress)
 
void print_help (void)
 
int calc_allreduce_index (int iter, int rank, int op)
 
void summarize_results (int iterations)
 
void valid_tests ()
 
void show_file_system_size (char *file_system)
 
void display_freespace (char *testdirpath)
 
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 int size
 
static uint64_t * rand_array
 
static char testdir [MAX_PATHLEN]
 
static char testdirpath [MAX_PATHLEN]
 
static char base_tree_name [MAX_PATHLEN]
 
static char ** filenames
 
static char hostname [MAX_PATHLEN]
 
static char mk_name [MAX_PATHLEN]
 
static char stat_name [MAX_PATHLEN]
 
static char read_name [MAX_PATHLEN]
 
static char rm_name [MAX_PATHLEN]
 
static char unique_mk_dir [MAX_PATHLEN]
 
static char unique_chdir_dir [MAX_PATHLEN]
 
static char unique_stat_dir [MAX_PATHLEN]
 
static char unique_read_dir [MAX_PATHLEN]
 
static char unique_rm_dir [MAX_PATHLEN]
 
static char unique_rm_uni_dir [MAX_PATHLEN]
 
static char * write_buffer
 
static char * read_buffer
 
static char * stoneWallingStatusFile
 
static int barriers
 
static int create_only
 
static int stat_only
 
static int read_only
 
static int remove_only
 
static int leaf_only
 
static unsigned branch_factor
 
static int depth
 
static uint64_t num_dirs_in_tree
 
static uint64_t items
 
static uint64_t items_per_dir
 
static uint64_t num_dirs_in_tree_calc
 
static int directory_loops
 
static int print_time
 
static int random_seed
 
static int shared_file
 
static int files_only
 
static int dirs_only
 
static int pre_delay
 
static int unique_dir_per_task
 
static int time_unique_dir_overhead
 
static int throttle
 
static int collective_creates
 
static size_t write_bytes
 
static int stone_wall_timer_seconds
 
static size_t read_bytes
 
static int sync_file
 
static int path_count
 
static int nstride
 
static mdtest_results_tsummary_table
 
static pid_t pid
 
static uid_t uid
 
static const char * backend_name = "POSIX"
 
static const ior_aiori_tbackend
 
static IOR_param_t param
 

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 167 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 74 of file mdtest.c.

◆ ITEM_COUNT

#define ITEM_COUNT   25000

Definition at line 78 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   "1.9.3"

Definition at line 76 of file mdtest.c.

Referenced by mdtest_run().

◆ TEST_DIR

#define TEST_DIR   "#test-dir"

Definition at line 77 of file mdtest.c.

Referenced by prep_testdir().

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 170 of file mdtest.c.

Function Documentation

◆ calc_allreduce_index()

int calc_allreduce_index ( int  iter,
int  rank,
int  op 
)

Definition at line 1375 of file mdtest.c.

References MDTEST_LAST_NUM, and size.

Referenced by summarize_results().

Here is the caller graph for this function:

◆ collective_create_remove()

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

Definition at line 756 of file mdtest.c.

References base_tree_name, create_remove_items(), MAX_PATHLEN, mk_name, nstride, out_logfile, rank, read_name, rm_name, shared_file, stat_name, testdir, unique_chdir_dir, unique_dir_per_task, unique_mk_dir, unique_read_dir, unique_rm_dir, unique_rm_uni_dir, unique_stat_dir, and verbose.

Referenced by directory_test(), and file_test().

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

◆ 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 
)

Definition at line 1795 of file mdtest.c.

References base_tree_name, branch_factor, depth, DIRMODE, FAIL, MAX_PATHLEN, ior_aiori::mkdir, out_logfile, rank, ior_aiori::rmdir, and verbose.

Referenced by mdtest_iteration().

Here is the caller graph for this function:

◆ create_remove_dirs()

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

Definition at line 258 of file mdtest.c.

References DIRMODE, FAIL, ITEM_COUNT, LLU, MAX_PATHLEN, mk_name, ior_aiori::mkdir, out_logfile, rank, rm_name, ior_aiori::rmdir, and verbose.

Referenced by collective_helper(), and create_remove_items_helper().

Here is the caller graph for this function:

◆ 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 
)

Definition at line 459 of file mdtest.c.

References base_tree_name, branch_factor, collective_helper(), create_remove_items_helper(), depth, items_per_dir, leaf_only, MAX_PATHLEN, out_logfile, rank, and verbose.

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

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

◆ 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 386 of file mdtest.c.

References CHECK_STONE_WALL, create_file(), create_remove_dirs(), rank_progress_t::items_done, items_per_dir, rank_progress_t::items_per_dir, rank_progress_t::items_start, out_logfile, rank, 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 
)

◆ display_freespace()

void display_freespace ( char *  testdirpath)

Definition at line 1746 of file mdtest.c.

References MAX_PATHLEN, out_logfile, rank, show_file_system_size(), and verbose.

Referenced by mdtest_run().

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

◆ file_test()

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

◆ mdtest_init_args()

void mdtest_init_args ( )

◆ mdtest_iteration()

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

◆ 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 
)

◆ mdtest_stat()

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

Definition at line 538 of file mdtest.c.

References base_tree_name, branch_factor, depth, directory_loops, FAIL, ITEM_COUNT, items, items_per_dir, leaf_only, LLU, MAX_PATHLEN, num_dirs_in_tree, out_logfile, rand_array, rank, ior_aiori::stat, stat_name, and verbose.

Referenced by directory_test(), and file_test().

Here is the caller graph for this function:

◆ offset_timers()

void offset_timers ( double *  t,
int  tcount 
)

Definition at line 173 of file mdtest.c.

References out_logfile, rank, and verbose.

Referenced by directory_test(), and file_test().

Here is the caller graph for this function:

◆ parse_dirpath()

void parse_dirpath ( char *  dirpath_arg)

Definition at line 189 of file mdtest.c.

References FAIL, filenames, NULL, out_logfile, path_count, rank, and verbose.

Referenced by mdtest_run().

Here is the caller graph for this function:

◆ prep_testdir()

static void prep_testdir ( int  j,
int  dir_iter 
)
static

Definition at line 224 of file mdtest.c.

References TEST_DIR, testdir, and testdirpath.

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

Here is the caller graph for this function:

◆ print_help()

void print_help ( void  )

Definition at line 1317 of file mdtest.c.

References aiori_supported_apis(), and out_logfile.

Here is the call graph for this function:

◆ remove_file()

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

Definition at line 288 of file mdtest.c.

References ior_aiori::delete, ITEM_COUNT, LLU, MAX_PATHLEN, out_logfile, rank, rm_name, shared_file, and verbose.

Referenced by create_remove_items_helper().

Here is the caller graph for this function:

◆ show_file_system_size()

void show_file_system_size ( char *  file_system)

◆ summarize_results()

void summarize_results ( int  iterations)

Definition at line 1380 of file mdtest.c.

References barriers, calc_allreduce_index(), dirs_only, files_only, MAX_PATHLEN, MDTEST_LAST_NUM, out_logfile, print_time, rank, mdtest_results_t::rate, size, testComm, mdtest_results_t::time, and verbose.

Referenced by mdtest_run().

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

◆ unique_dir_access()

void unique_dir_access ( int  opt,
char *  to 
)

Definition at line 238 of file mdtest.c.

References MK_UNI_DIR, out_logfile, rank, READ_SUB_DIR, RM_SUB_DIR, RM_UNI_DIR, STAT_SUB_DIR, testComm, testdir, unique_chdir_dir, unique_read_dir, unique_rm_dir, unique_rm_uni_dir, unique_stat_dir, and verbose.

Referenced by directory_test(), and file_test().

Here is the caller graph for this function:

◆ updateStoneWallIterations()

int updateStoneWallIterations ( int  iteration,
rank_progress_t progress,
double  tstart 
)

◆ valid_tests()

void valid_tests ( )

Variable Documentation

◆ backend

const ior_aiori_t* backend
static

Definition at line 151 of file mdtest.c.

◆ backend_name

const char* backend_name = "POSIX"
static

Definition at line 150 of file mdtest.c.

Referenced by mdtest_run(), and valid_tests().

◆ barriers

int barriers
static

◆ base_tree_name

char base_tree_name[MAX_PATHLEN]
static

◆ branch_factor

unsigned branch_factor
static

◆ collective_creates

int collective_creates
static

◆ create_only

int create_only
static

◆ depth

int depth
static

◆ directory_loops

int directory_loops
static

◆ dirs_only

int dirs_only
static

◆ filenames

char** filenames
static

Definition at line 87 of file mdtest.c.

Referenced by mdtest_run(), and parse_dirpath().

◆ files_only

int files_only
static

◆ hostname

char hostname[MAX_PATHLEN]
static

Definition at line 88 of file mdtest.c.

Referenced by CountTasksPerNode(), and mdtest_run().

◆ items

uint64_t items
static

◆ items_per_dir

uint64_t items_per_dir
static

◆ leaf_only

int leaf_only
static

Definition at line 109 of file mdtest.c.

Referenced by create_remove_items(), mdtest_init_args(), mdtest_read(), mdtest_run(), and mdtest_stat().

◆ mk_name

char mk_name[MAX_PATHLEN]
static

◆ nstride

int nstride
static

◆ num_dirs_in_tree

uint64_t num_dirs_in_tree
static

Definition at line 118 of file mdtest.c.

Referenced by mdtest_init_args(), mdtest_iteration(), mdtest_read(), mdtest_run(), and mdtest_stat().

◆ num_dirs_in_tree_calc

uint64_t num_dirs_in_tree_calc
static

Definition at line 126 of file mdtest.c.

Referenced by file_test(), mdtest_init_args(), and mdtest_run().

◆ param

IOR_param_t param
static

Definition at line 153 of file mdtest.c.

Referenced by MPIIO_Xfer().

◆ path_count

int path_count
static

Definition at line 142 of file mdtest.c.

Referenced by mdtest_init_args(), mdtest_iteration(), mdtest_run(), parse_dirpath(), and valid_tests().

◆ pid

pid_t pid
static

Definition at line 146 of file mdtest.c.

Referenced by mdtest_run().

◆ pre_delay

int pre_delay
static

Definition at line 133 of file mdtest.c.

Referenced by mdtest_init_args(), mdtest_iteration(), and mdtest_run().

◆ print_time

int print_time
static

Definition at line 128 of file mdtest.c.

Referenced by mdtest_init_args(), mdtest_run(), and summarize_results().

◆ rand_array

uint64_t* rand_array
static

Definition at line 83 of file mdtest.c.

Referenced by mdtest_read(), mdtest_run(), and mdtest_stat().

◆ random_seed

int random_seed
static

Definition at line 129 of file mdtest.c.

Referenced by directory_test(), file_test(), mdtest_init_args(), and mdtest_run().

◆ read_buffer

char* read_buffer
static

Definition at line 100 of file mdtest.c.

Referenced by mdtest_read().

◆ read_bytes

size_t read_bytes
static

Definition at line 140 of file mdtest.c.

Referenced by mdtest_init_args(), mdtest_read(), and mdtest_run().

◆ read_name

char read_name[MAX_PATHLEN]
static

Definition at line 91 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), mdtest_read(), and mdtest_run().

◆ read_only

int read_only
static

Definition at line 107 of file mdtest.c.

Referenced by directory_test(), file_test(), mdtest_init_args(), mdtest_run(), and valid_tests().

◆ remove_only

int remove_only
static

◆ rm_name

char rm_name[MAX_PATHLEN]
static

◆ shared_file

int shared_file
static

◆ size

int size
static

◆ stat_name

char stat_name[MAX_PATHLEN]
static

Definition at line 90 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), mdtest_run(), and mdtest_stat().

◆ stat_only

int stat_only
static

Definition at line 106 of file mdtest.c.

Referenced by directory_test(), file_test(), mdtest_init_args(), mdtest_run(), and valid_tests().

◆ stone_wall_timer_seconds

int stone_wall_timer_seconds
static

Definition at line 139 of file mdtest.c.

Referenced by file_test(), mdtest_init_args(), mdtest_iteration(), mdtest_run(), and valid_tests().

◆ stoneWallingStatusFile

char* stoneWallingStatusFile
static

Definition at line 101 of file mdtest.c.

Referenced by file_test(), mdtest_init_args(), and mdtest_run().

◆ summary_table

mdtest_results_t* summary_table
static

Definition at line 145 of file mdtest.c.

Referenced by mdtest_run().

◆ sync_file

int sync_file
static

Definition at line 141 of file mdtest.c.

Referenced by create_file(), mdtest_init_args(), and mdtest_run().

◆ testdir

char testdir[MAX_PATHLEN]
static

◆ testdirpath

char testdirpath[MAX_PATHLEN]
static

Definition at line 85 of file mdtest.c.

Referenced by mdtest_run(), and prep_testdir().

◆ throttle

int throttle
static

Definition at line 136 of file mdtest.c.

Referenced by mdtest_init_args().

◆ time_unique_dir_overhead

int time_unique_dir_overhead
static

Definition at line 135 of file mdtest.c.

Referenced by directory_test(), file_test(), mdtest_init_args(), and mdtest_run().

◆ uid

uid_t uid
static

Definition at line 147 of file mdtest.c.

Referenced by mdtest_run().

◆ unique_chdir_dir

char unique_chdir_dir[MAX_PATHLEN]
static

Definition at line 94 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), and unique_dir_access().

◆ unique_dir_per_task

int unique_dir_per_task
static

◆ unique_mk_dir

char unique_mk_dir[MAX_PATHLEN]
static

Definition at line 93 of file mdtest.c.

Referenced by collective_create_remove(), and mdtest_iteration().

◆ unique_read_dir

char unique_read_dir[MAX_PATHLEN]
static

Definition at line 96 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), and unique_dir_access().

◆ unique_rm_dir

char unique_rm_dir[MAX_PATHLEN]
static

Definition at line 97 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), and unique_dir_access().

◆ unique_rm_uni_dir

char unique_rm_uni_dir[MAX_PATHLEN]
static

Definition at line 98 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), and unique_dir_access().

◆ unique_stat_dir

char unique_stat_dir[MAX_PATHLEN]
static

Definition at line 95 of file mdtest.c.

Referenced by collective_create_remove(), mdtest_iteration(), and unique_dir_access().

◆ write_buffer

char* write_buffer
static

Definition at line 99 of file mdtest.c.

Referenced by create_file(), and mdtest_run().

◆ write_bytes

size_t write_bytes
static

Definition at line 138 of file mdtest.c.

Referenced by create_file(), mdtest_init_args(), and mdtest_run().