iozone.c File Reference

Include dependency graph for iozone.c:

Go to the source code of this file.

Data Structures

struct  child_stats
struct  runtime
struct  client_command
struct  client_neutral_command
struct  master_command
struct  master_neutral_command
struct  size_entry
struct  child_ident

Defines

#define THISVERSION   " Version $Revision$"
#define MODE   "\tCompiled for 32 bit mode."
#define MAP_FAILED   -1
#define VOLATILE
#define DEDUPSEED   0x2719362
#define R_CHILD_JOIN   1
#define R_STAT_DATA   2
#define R_FLAG_DATA   3
#define R_JOIN_ACK   4
#define R_STOP_FLAG   5
#define R_TERMINATE   6
#define R_DEATH   7
#define CACHE_LINE_SIZE   32
#define CACHE_SIZE   ( 1024 * 1024 )
#define MEG   (1024 * 1024)
#define STRIDE   17
#define IBUFSIZE   100
#define DISRUPT   100
#define LARGE_REC   65536
#define KILOBYTES   512
#define RECLEN   1024
#define FILESIZE   (KILOBYTES*1024)
#define NUMRECS   FILESIZE/RECLEN
#define CROSSOVER   (16*1024)
#define MAXBUFFERSIZE   (16*1024*1024)
#define MAXSTREAMS   256
#define MINBUFFERSIZE   128
#define TOOFAST   10
#define MAXTESTS   12
#define PATTERN   get_pattern();
#define PATTERN1   0xBB
#define MAX_X   100
#define MAX_Y   512
#define USAGE   "\tUsage: For usage information type iozone -h \n\n"
#define MAXNAMESIZE   1000
#define CONTROL_STRING1   "%16lld%8ld%8ld%8ld%8ld%8ld%8ld%8ld %8ld %8ld%8ld%8ld%8ld%9ld%9ld\n"
#define CONTROL_STRING2   "%16s%8s%8s%8s%8s%10s%8s%8s%8s %8s %8s%9s%9s%8s%9s\n"
#define CONTROL_STRING3   "%16s%8s%8s%8s%8s%10s%8s%8s%8s %8s %8s%9s%9s%8s%9s\n"
#define CONTROL_STRING4   "%16s%8s%8s%8s%8s%10s\n"
#define KILOBYTES_START   64
#define KILOBYTES_END   (1024*512)
#define RECLEN_START   4096
#define RECLEN_END   (MAXBUFFERSIZE)
#define MULTIPLIER   2
#define WRITER_TEST   0
#define READER_TEST   1
#define RANDOM_RW_TEST   2
#define REVERSE_TEST   3
#define REWRITE_REC_TEST   4
#define STRIDE_READ_TEST   5
#define FWRITER_TEST   6
#define FREADER_TEST   7
#define RANDOM_MIX_TEST   8
#define WRITER_MASK   (1 << WRITER_TEST)
#define READER_MASK   (1 << READER_TEST)
#define RANDOM_RW_MASK   (1 << RANDOM_RW_TEST)
#define RANDOM_MIX_MASK   (1 << RANDOM_MIX_TEST)
#define REVERSE_MASK   (1 << REVERSE_TEST)
#define REWRITE_REC_MASK   (1 << REWRITE_REC_TEST)
#define STRIDE_READ_MASK   (1 << STRIDE_READ_TEST)
#define FWRITER_MASK   (1 << FWRITER_TEST)
#define FREADER_MASK   (1 << FREADER_TEST)
#define CHILD_STATE_HOLD   0
#define CHILD_STATE_READY   1
#define CHILD_STATE_BEGIN   2
#define CHILD_STATE_DONE   3
#define MERSENNE
#define cputime_so_far()   time_so_far()
#define I_LSEEK(x, y, z)   lseek(x,(off_t)(y),z)
#define I_OPEN(x, y, z)   open(x,(int)(y),(int)(z))
#define I_CREAT(x, y)   creat(x,(int)(y))
#define I_FOPEN(x, y)   fopen(x,y)
#define I_STAT(x, y)   stat(x,y)
#define I_MMAP(a, b, c, d, e, f)   mmap((void *)(a),(size_t)(b),(int)(c),(int)(d),(int)(e),(off_t)(f))
#define SHMSIZE   ((( sizeof(struct child_stats) * MAXSTREAMS) )+4096 )
#define HOST_LIST_PORT   20000
#define HOST_ESEND_PORT   (HOST_LIST_PORT+MAXSTREAMS)
#define HOST_ASEND_PORT   (HOST_ESEND_PORT+MAXSTREAMS)
#define CHILD_ESEND_PORT   (HOST_ASEND_PORT+MAXSTREAMS)
#define CHILD_LIST_PORT   (CHILD_ESEND_PORT+MAXSTREAMS)
#define CHILD_ALIST_PORT   (CHILD_LIST_PORT+MAXSTREAMS)
#define SP_CHILD_LISTEN_PORT   31000
#define SP_CHILD_ESEND_PORT   (SP_CHILD_LISTEN_PORT+10)
#define SP_MASTER_LISTEN_PORT   (SP_CHILD_ESEND_PORT+10)
#define SP_MASTER_ESEND_PORT   (SP_MASTER_LISTEN_PORT+10)
#define SP_MASTER_RESULTS_PORT   (SP_MASTER_ESEND_PORT+10)
#define THREAD_WRITE_TEST   1
#define THREAD_REWRITE_TEST   2
#define THREAD_READ_TEST   3
#define THREAD_REREAD_TEST   4
#define THREAD_STRIDE_TEST   5
#define THREAD_RANDOM_READ_TEST   6
#define THREAD_RANDOM_WRITE_TEST   7
#define THREAD_REVERSE_READ_TEST   8
#define THREAD_RANDOM_MIX_TEST   9
#define THREAD_PWRITE_TEST   10
#define THREAD_PREAD_TEST   11
#define THREAD_FWRITE_TEST   12
#define THREAD_FREAD_TEST   13
#define THREAD_CLEANUP_TEST   14
#define C_STATE_ZERO   1
#define C_STATE_WAIT_WHO   2
#define C_STATE_WAIT_BARRIER   3
#define NN   312
#define MM   156
#define MATRIX_A   0xB5026F5AA96619E9ULL
#define UM   0xFFFFFFFF80000000ULL
#define LM   0x7FFFFFFFULL
#define DFLT_SERVICE   "PIT"
#define INVALID_DESC   -1
#define MAXBFRSIZE   256
#define BUCKETS   40

Typedefs

typedef long long off64_t
typedef struct sockaddr_in sockaddr_in_t
typedef struct sockaddr_in6 sockaddr_in6_t

Enumerations

enum  boolean { false = 0, true }

Functions

int atoi ()
int close ()
int unlink ()
int main ()
void record_command_line ()
int wait ()
int fsync ()
void srand48 ()
long lrand48 ()
void create_list ()
void Poll ()
void print_header ()
void Kill ()
long long l_min ()
long long l_max ()
long long mythread_create ()
int gen_new_buf ()
void touch_dedup ()
void init_by_array64 (unsigned long long *, unsigned long long)
unsigned long long genrand64_int64 (void)
char * initfile ()
int pit_gettimeofday ()
static int openSckt (const char *, const char *, unsigned int)
static void pit (int, struct timeval *)
void mmap_end ()
void alloc_pbuf ()
void auto_test ()
void show_help ()
static double time_so_far ()
static double time_so_far1 ()
void get_resolution ()
void get_rusage_resolution ()
void signal_handler ()
void begin ()
void fetchit ()
void purgeit ()
void throughput_test ()
void multi_throughput_test ()
void prepage ()
void get_date ()
int get_pattern ()
float do_compute ()
void write_perf_test ()
void fwrite_perf_test ()
void fread_perf_test ()
void read_perf_test ()
void mix_perf_test ()
void random_perf_test ()
void reverse_perf_test ()
void rewriterec_perf_test ()
void read_stride_perf_test ()
void store_dvalue ()
void dump_excel ()
void dump_throughput ()
int sp_start_child_send ()
int sp_start_master_listen ()
void do_speed_check ()
char * getenv ()
char * inet_ntoa ()
int system ()
void my_nap ()
void my_unap ()
int thread_exit ()
void close_xls ()
void do_label ()
int create_xls ()
void do_float ()
int mylockf ()
int mylockr ()
int rand ()
void srand ()
int get_client_info ()
void exit ()
void find_remote_shell ()
void traj_vers ()
void r_traj_size ()
long long w_traj_size ()
FILE * open_w_traj ()
FILE * open_r_traj ()
void create_temp ()
void fill_buffer ()
char * alloc_mem ()
void *() thread_rwrite_test ()
void *() thread_write_test ()
void *() thread_fwrite_test ()
void *() thread_fread_test ()
void *() thread_read_test ()
void *() thread_cleanup_test ()
void *() thread_ranread_test ()
void *() thread_mix_test ()
void *() thread_ranwrite_test ()
void *() thread_rread_test ()
void *() thread_reverse_read_test ()
void *() thread_stride_read_test ()
void *() thread_set_base ()
void *() thread_join ()
void disrupt ()
long long get_traj ()
void init_file_sizes ()
off64_t get_next_file_size ()
void add_file_size ()
void init_record_sizes ()
off64_t get_next_record_size ()
void add_record_size ()
void dump_cputimes ()
static double cpu_util ()
void del_record_sizes ()
void hist_insert ()
void dump_hist ()
void child_send ()
int start_child_listen ()
int start_child_listen_async ()
void start_child_listen_loop ()
void child_listen ()
void child_listen_async ()
void stop_child_send ()
void stop_child_listen ()
void cleanup_comm ()
void master_send ()
int start_master_send ()
int start_master_listen ()
int check_filename ()
void master_listen ()
void stop_master_send ()
void stop_master_listen ()
long long start_child_proc ()
int parse_client_line ()
void wait_dist_join ()
void tell_children_begin ()
void start_master_listen_loop ()
void wait_for_master_go ()
void tell_master_ready ()
void stop_master_listen_loop ()
void tell_master_stats ()
void become_client ()
int pick_client ()
void child_remove_files ()
void terminate_child_async ()
void distribute_stop ()
void send_stop ()
void cleanup_children ()
int main (int argc, char **argv)
void record_command_line (int argc, char **argv)
void begin (off64_t kilos64, long long reclength)
void fetchit (char *buffer, long long length)
long long verify_buffer (char *buffer, long long length, off64_t recnum, long long recsize, unsigned long long patt, char sverify)
void fill_buffer (char *buffer, long long length, long long pattern, char sverify, long long recnum)
void purgeit (char *buffer, long long reclen)
void prepage (char *buffer, long long reclen)
void write_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void fwrite_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void fread_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void read_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void random_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void reverse_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void rewriterec_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void read_stride_perf_test (off64_t kilos64, long long reclen, long long *data1, long long *data2)
 store_value (off64_t value)
 store_times (double walltime, double cputime)
 dump_report (long long who)
 dump_times (long long who)
char * alloc_mem (long long size, int shared_flag)
void Poll (longlong time1)
long long l_max (long long one, long long two)
void Kill (long long pid, long long sig)
long long l_min (long long num1, long long num2)
void multi_throughput_test (long long mint, long long maxt)
 purge_buffer_cache ()
void * thread_write_test (x)
void * thread_rwrite_test (x)
void * thread_read_test (x)
void * thread_rread_test (x)
void * thread_reverse_read_test (x)
void * thread_stride_read_test (x)
void * thread_mix_test (x)
void * thread_ranread_test (x)
void * thread_ranwrite_test (x)
void * thread_cleanup_test (x)
long long mythread_create (void *(*func)(void *), void *x)
pthread_t mythread_self ()
void * thread_join (long long tid, void *status)
void dump_throughput_cpu ()
void store_dvalue (double value)
char * initfile (int fd, off64_t filebytes, int flag, int prot)
void mmap_end (char *buffer, long long size)
 fill_area (long long *src_buffer, long long *dest_buffer, long long length)
int async_read ()
size_t async_write_no_copy ()
size_t async_write ()
void async_init ()
int async_read_no_copy ()
void async_release ()
void my_nap (int ntime)
void my_unap (unsigned long long microsecs)
static double cpu_util (double cputime, double walltime)
int mylockf (int fd, int op, int rdwr)
int mylockr (int fd, int op, int rdwr, off64_t offset, off64_t size)
float do_compute (float comp_delay)
void disrupt (int fd)
long long get_traj (FILE *traj_fd, long long *traj_size, float *delay, long which)
void init_file_sizes (off64_t min_f_size, off64_t max_f_size)
void add_file_size (off64_t size)
off64_t get_next_file_size (off64_t size)
void init_record_sizes (off64_t min_r_size, off64_t max_r_size)
void add_record_size (off64_t size)
off64_t get_next_record_size (off64_t size)
void master_listen (int sock, int size_of_message)
void child_send (char *controlling_host_name, struct master_command *send_buffer, int send_size)
void master_send (int child_socket_val, char *host_name, struct client_command *send_buffer, int send_size)
void stop_child_listen (int child_socket_val)
void O_stop_child_send (int child_socket_val)
void stop_master_listen (int master_socket_val)
void stop_master_send (int child_socket_val)
int start_child_listen (int size_of_message)
int child_attach (int s, int flag)
void child_listen (int sock, int size_of_message)
int start_child_listen_async (int size_of_message)
void child_listen_async (int sock, int size_of_message)
int start_master_send (char *child_host_name, int child_port, struct in_addr *my_s_addr)
int start_master_send_async (char *child_host_name, int child_port, struct in_addr my_s_addr)
long long start_child_proc (int testnum, long long numrecs64, long long reclen)
int pick_client (int testnum, long long numrecs64, long long reclen)
void tell_master_stats (int testnum, long long chid, double throughput, double actual, float cpu_time, double wall_time, char stop_flag, long long child_flag)
void tell_master_ready (long long chid)
void wait_for_master_go (long long chid)
void start_master_listen_loop (int num)
void tell_children_begin (long long childnum)
int parse_client_line (char *buffer, int line_num)
void child_remove_files (int i)
void find_remote_shell (char *shell)
void find_external_mon (char *imon_start, char *imon_stop)
void mix_perf_test (off64_t kilo64, long long reclen, long long *data1, long long *data2)
void sp_send_result (int, int, float)
void sp_get_result (int, int)
void sp_do_child_t (void)
void sp_do_master_t (void)
void speed_main (char *, char *, long long, long long, int)
int sp_start_master_send (char *sp_child_host_name, int sp_child_listen_port, struct in_addr *sp_my_ms_addr)
int sp_start_child_listen (int listen_port, int size_of_message)
int sp_start_master_listen (int sp_master_listen_port, int sp_size_of_message)
int sp_start_child_send (char *sp_master_host_name, int sp_master_listen_port, struct in_addr *sp_my_cs_addr)
void do_speed_check (int client_flag)
 get_date (char *where)
 check_filename (char *name)
 start_monitor (char *test)
 stop_monitor (char *test)
int gen_new_buf (char *ibuf, char *obuf, long seed, int size, int percent, int percent_interior, int percent_compress, int all)
void touch_dedup (char *i, int size)
void init_genrand64 (unsigned long long seed)
void init_by_array64 (unsigned long long init_key[], unsigned long long key_length)
long long genrand64_int63 (void)
double genrand64_real1 (void)
double genrand64_real2 (void)
double genrand64_real3 (void)
int pit_gettimeofday (struct timeval *tp, struct timezone *foo, char *pit_hostname, char *pit_service)
void hist_insert (double my_value)
void dump_hist (char *what, int id)
void * thread_fwrite_test (x)
void * thread_fread_test (x)

Variables

int errno
int h_errno
char * help []
char * head1 []
long long page_size = 4096
struct child_statschild_stat
void(* func [])()
char * test_output []
long long test_soutput [] = {2,2,2,1,1,1,2,2,2,2,2,2,2,2}
VOLATILE struct child_statsshmaddr
double totaltime
double total_time
double temp_time
double total_kilos
off64_t report_array [MAX_X][MAX_Y]
double report_darray [MAX_X][MAXSTREAMS]
double time_res
double cputime_res
long long throughput_array [MAX_X]
short current_x
short current_y
long long orig_size
long long max_x
long long max_y
unsigned long long goodkilos
off64_t kilobytes64 = (off64_t)KILOBYTES
long long goodrecl
off64_t offset = 0
off64_t offset64 = 0
off64_t filebytes64
off64_t r_range [100]
off64_t s_range [100]
int t_range [100]
int t_count = 0
int r_count
int s_count
char * barray [MAXSTREAMS]
char * haveshm
int optind
long long onetime
long long auto_mode
long long sfd
long long multi_buffer
int fd
int sp_msfd
int sp_mrfd
int sp_csfd
int sp_crfd
int begin_proc
int num_processors
int ioz_processor_bind
long long res_prob
long long rec_prob
char silent
char read_sync
char master_iozone
char client_iozone
char distributed
int bif_fd
int bif_row
int bif_column
int dedup_mseed = 1
int hist_summary
int op_rate
int op_rate_flag
char aflag
char Eflag
char hflag
char Rflag
char rflag
char sflag
char diag_v
char sent_stop
char dedup
char dedup_interior
char dedup_compress
char * dedup_ibuf
char * dedup_temp
char bif_flag
int rlocking
int share_file
int ecount
char gflag
char nflag
char yflag
char qflag
char * build_name = NAME
char imon_start [256]
char imon_stop [256]
char imon_sync
char trflag
char cpuutilflag
char seq_mix
long base_time
long long mint
long long maxt
long long w_traj_ops
long long r_traj_ops
long long w_traj_fsize
long long r_traj_fsize
long long r_traj_ops_completed
long long r_traj_bytes_completed
long long w_traj_ops_completed
long long w_traj_bytes_completed
int w_traj_items
int r_traj_items
char fflag
char Uflag
char uflag
char lflag
char include_tflag
struct runtime runtimes [MAX_X][MAX_Y]
long long include_test [50]
long long include_mask
char RWONLYflag
char NOCROSSflag
char mfflag
long long status
long long x
long long y
long long childids [MAXSTREAMS+1]
long long myid
long long num_child
int pct_read
int speed_code
pthread_t p_childids [MAXSTREAMS+1]
off64_t next64
char wol_opened
char rol_opened
FILE * wqfd
FILE * rwqfd
FILE * rqfd
FILE * rrqfd
char * optarg
long long ret
struct size_entrysize_list = 0
struct size_entryrec_size_list = 0
off64_t maximum_file_size
off64_t minimum_file_size
char bif_filename [MAXNAMESIZE]
char filename [MAXNAMESIZE]
char mountname [MAXNAMESIZE]
char dummyfile [MAXSTREAMS][MAXNAMESIZE]
char dummyfile1 [MAXNAMESIZE]
char * filearray [MAXSTREAMS]
char tfile [] = "iozone"
char * buffer
char * buffer1
char * mbuffer
char * mainbuffer
FILE * pi
FILE * r_traj_fd
FILE * w_traj_fd
VOLATILE char * pbuffer
char * default_filename = "iozone.tmp"
VOLATILE char stoptime
char Cflag
char use_thread = 0
long long debug1 = 0
long long debug = 0
unsigned long cache_size = CACHE_SIZE
unsigned long cache_line_size = CACHE_LINE_SIZE
long long * pstatus
off64_t min_file_size = KILOBYTES_START
off64_t max_file_size = KILOBYTES_END
long long min_rec_size = RECLEN_START
long long max_rec_size = RECLEN_END
long long orig_min_rec_size = RECLEN_START
long long orig_max_rec_size = RECLEN_END
long long xover = CROSSOVER
char * throughput_tests []
char command_line [1024] = "\0"
int argcsave
char ** argvsave
char splash [80][80]
int splash_line
char client_filename [256]
char remote_shell [256]
int client_error
char pit_hostname [40]
char pit_service [8]
int junk
int controlling_host_port = HOST_LIST_PORT
int c_port
int a_port
int child_port
int child_async_port
int client_listen_pid
int master_join_count
int l_sock
int l_async_sock
char master_rcv_buf [4096]
int master_listen_pid
char master_send_buf [4096]
char child_rcv_buf [4096]
char child_async_rcv_buf [4096]
char child_send_buf [4096]
int child_send_socket
int child_listen_socket
int child_listen_socket_async
int master_send_socket
int master_send_sockets [MAXSTREAMS]
int master_send_async_sockets [MAXSTREAMS]
int master_listen_port
int master_listen_socket
int clients_found
FILE * newstdin
FILE * newstdout
FILE * newstderr
char toutput [20][20]
int toutputindex
int cdebug = 0
int mdebug = 0
int aggflag
struct sockaddr_in child_sync_sock child_async_sock
int proto_version = 25
char controlling_host_name [100]
struct child_ident child_idents [MAXSTREAMS]
int Kplus_readers
char write_traj_filename [MAXNAMESIZE]
char read_traj_filename [MAXNAMESIZE]
char oflag
char jflag
char k_flag
char h_flag
char mflag
char pflag
char unbuffered
char Kplus_flag
char noretest
char notruncate
char async_flag
char stride_flag
char mmapflag
char mmapasflag
char mmapssflag
char mmapnsflag
char mmap_mix
char verify = 1
int restf
char sverify = 1
char odsync = 0
char Q_flag
char OPS_flag
char L_flag = 0
char no_copy_flag
char include_close
char include_flush
char disrupt_flag
char compute_flag
char xflag
char Z_flag
char X_flag
int no_unlink = 0
int no_write = 0
int r_traj_flag
int w_traj_flag
int mygen
char MS_flag
int advise_op
int advise_flag
int direct_flag
int current_client_number
long long chid
int file_lock
unsigned int pattern
long long stride = STRIDE
long long delay
long long purge
long long fetchon
off64_t numrecs64 = (off64_t)NUMRECS
long long reclen = RECLEN
long long delay_start
long long depth
VOLATILE char * stop_flag
float compute_time
int multiplier = MULTIPLIER
long long rest_val
int nap_once
double nap_res
struct sockaddr_in listener_sync_sock
char * sp_dest
int sp_child_listen_port = SP_CHILD_LISTEN_PORT
int sp_child_esend_port = SP_CHILD_ESEND_PORT
int sp_master_listen_port = SP_MASTER_LISTEN_PORT
int sp_master_esend_port = SP_MASTER_ESEND_PORT
int sp_master_results_port = SP_MASTER_RESULTS_PORT
struct in_addr sp_my_cs_addr
struct in_addr sp_my_ms_addr
struct sockaddr_in
sp_child_sync_sock 
sp_child_async_sock
struct sockaddr_in
sp_master_sync_sock 
sp_master_async_sock
char * sp_buf
char sp_command [1024]
char sp_remote_shell [100]
int sp_child_mode
int sp_count
int sp_msize
int sp_once
int sp_tcount
double sp_start_time
double sp_finish_time
int sp_cret
char sp_remote_host [256]
char sp_master_host [256]
char sp_location [256]
static unsigned long long mt [NN]
static int mti = NN+1
long long buckets [BUCKETS]
long long bucket_val [BUCKETS]

Define Documentation

#define BUCKETS   40

Definition at line 24211 of file iozone.c.

#define C_STATE_WAIT_BARRIER   3

Definition at line 1451 of file iozone.c.

#define C_STATE_WAIT_WHO   2

Definition at line 1450 of file iozone.c.

#define C_STATE_ZERO   1

Definition at line 1449 of file iozone.c.

#define CACHE_LINE_SIZE   32

Definition at line 750 of file iozone.c.

#define CACHE_SIZE   ( 1024 * 1024 )

Definition at line 751 of file iozone.c.

#define CHILD_ALIST_PORT   (CHILD_LIST_PORT+MAXSTREAMS)

Definition at line 1419 of file iozone.c.

#define CHILD_ESEND_PORT   (HOST_ASEND_PORT+MAXSTREAMS)

Definition at line 1415 of file iozone.c.

#define CHILD_LIST_PORT   (CHILD_ESEND_PORT+MAXSTREAMS)

Definition at line 1416 of file iozone.c.

#define CHILD_STATE_BEGIN   2

Definition at line 946 of file iozone.c.

#define CHILD_STATE_DONE   3

Definition at line 948 of file iozone.c.

#define CHILD_STATE_HOLD   0

Definition at line 942 of file iozone.c.

#define CHILD_STATE_READY   1

Definition at line 944 of file iozone.c.

#define CONTROL_STRING1   "%16lld%8ld%8ld%8ld%8ld%8ld%8ld%8ld %8ld %8ld%8ld%8ld%8ld%9ld%9ld\n"

Definition at line 876 of file iozone.c.

#define CONTROL_STRING2   "%16s%8s%8s%8s%8s%10s%8s%8s%8s %8s %8s%9s%9s%8s%9s\n"

Definition at line 877 of file iozone.c.

#define CONTROL_STRING3   "%16s%8s%8s%8s%8s%10s%8s%8s%8s %8s %8s%9s%9s%8s%9s\n"

Definition at line 878 of file iozone.c.

#define CONTROL_STRING4   "%16s%8s%8s%8s%8s%10s\n"

Definition at line 879 of file iozone.c.

 
#define cputime_so_far (  )     time_so_far()

Definition at line 973 of file iozone.c.

#define CROSSOVER   (16*1024)

Definition at line 807 of file iozone.c.

#define DEDUPSEED   0x2719362

Definition at line 449 of file iozone.c.

#define DFLT_SERVICE   "PIT"

Definition at line 24038 of file iozone.c.

#define DISRUPT   100

Definition at line 779 of file iozone.c.

#define FILESIZE   (KILOBYTES*1024)

Definition at line 795 of file iozone.c.

#define FREADER_MASK   (1 << FREADER_TEST)

Definition at line 928 of file iozone.c.

#define FREADER_TEST   7

Definition at line 909 of file iozone.c.

#define FWRITER_MASK   (1 << FWRITER_TEST)

Definition at line 927 of file iozone.c.

#define FWRITER_TEST   6

Definition at line 908 of file iozone.c.

#define HOST_ASEND_PORT   (HOST_ESEND_PORT+MAXSTREAMS)

Definition at line 1409 of file iozone.c.

#define HOST_ESEND_PORT   (HOST_LIST_PORT+MAXSTREAMS)

Definition at line 1408 of file iozone.c.

#define HOST_LIST_PORT   20000

Definition at line 1407 of file iozone.c.

#define I_CREAT ( x,
y   )     creat(x,(int)(y))

Definition at line 1184 of file iozone.c.

#define I_FOPEN ( x,
y   )     fopen(x,y)

Definition at line 1185 of file iozone.c.

#define I_LSEEK ( x,
y,
 )     lseek(x,(off_t)(y),z)

Definition at line 1182 of file iozone.c.

#define I_MMAP ( a,
b,
c,
d,
e,
 )     mmap((void *)(a),(size_t)(b),(int)(c),(int)(d),(int)(e),(off_t)(f))

Definition at line 1191 of file iozone.c.

#define I_OPEN ( x,
y,
 )     open(x,(int)(y),(int)(z))

Definition at line 1183 of file iozone.c.

#define I_STAT ( x,
y   )     stat(x,y)

Definition at line 1186 of file iozone.c.

#define IBUFSIZE   100

Definition at line 775 of file iozone.c.

#define INVALID_DESC   -1

Definition at line 24039 of file iozone.c.

#define KILOBYTES   512

Definition at line 789 of file iozone.c.

#define KILOBYTES_END   (1024*512)

Definition at line 891 of file iozone.c.

#define KILOBYTES_START   64

Definition at line 889 of file iozone.c.

#define LARGE_REC   65536

Definition at line 786 of file iozone.c.

#define LM   0x7FFFFFFFULL

Definition at line 23878 of file iozone.c.

#define MAP_FAILED   -1

Definition at line 336 of file iozone.c.

#define MATRIX_A   0xB5026F5AA96619E9ULL

Definition at line 23876 of file iozone.c.

#define MAX_X   100

Definition at line 825 of file iozone.c.

#define MAX_Y   512

Definition at line 827 of file iozone.c.

#define MAXBFRSIZE   256

Definition at line 24040 of file iozone.c.

#define MAXBUFFERSIZE   (16*1024*1024)

Definition at line 809 of file iozone.c.

#define MAXNAMESIZE   1000

Definition at line 833 of file iozone.c.

#define MAXSTREAMS   256

Definition at line 813 of file iozone.c.

#define MAXTESTS   12

Definition at line 820 of file iozone.c.

#define MEG   (1024 * 1024)

Definition at line 754 of file iozone.c.

#define MERSENNE

Definition at line 950 of file iozone.c.

#define MINBUFFERSIZE   128

Definition at line 816 of file iozone.c.

#define MM   156

Definition at line 23875 of file iozone.c.

#define MODE   "\tCompiled for 32 bit mode."

Definition at line 88 of file iozone.c.

#define MULTIPLIER   2

Definition at line 897 of file iozone.c.

#define NN   312

Definition at line 23874 of file iozone.c.

#define NUMRECS   FILESIZE/RECLEN

Definition at line 798 of file iozone.c.

#define PATTERN   get_pattern();

Definition at line 822 of file iozone.c.

#define PATTERN1   0xBB

Definition at line 823 of file iozone.c.

#define R_CHILD_JOIN   1

Definition at line 731 of file iozone.c.

#define R_DEATH   7

Definition at line 744 of file iozone.c.

#define R_FLAG_DATA   3

Definition at line 733 of file iozone.c.

#define R_JOIN_ACK   4

Definition at line 741 of file iozone.c.

#define R_STAT_DATA   2

Definition at line 732 of file iozone.c.

#define R_STOP_FLAG   5

Definition at line 742 of file iozone.c.

#define R_TERMINATE   6

Definition at line 743 of file iozone.c.

#define RANDOM_MIX_MASK   (1 << RANDOM_MIX_TEST)

Definition at line 923 of file iozone.c.

#define RANDOM_MIX_TEST   8

Definition at line 910 of file iozone.c.

#define RANDOM_RW_MASK   (1 << RANDOM_RW_TEST)

Definition at line 922 of file iozone.c.

#define RANDOM_RW_TEST   2

Definition at line 904 of file iozone.c.

#define READER_MASK   (1 << READER_TEST)

Definition at line 921 of file iozone.c.

#define READER_TEST   1

Definition at line 903 of file iozone.c.

#define RECLEN   1024

Definition at line 792 of file iozone.c.

#define RECLEN_END   (MAXBUFFERSIZE)

Definition at line 895 of file iozone.c.

#define RECLEN_START   4096

Definition at line 893 of file iozone.c.

#define REVERSE_MASK   (1 << REVERSE_TEST)

Definition at line 924 of file iozone.c.

#define REVERSE_TEST   3

Definition at line 905 of file iozone.c.

#define REWRITE_REC_MASK   (1 << REWRITE_REC_TEST)

Definition at line 925 of file iozone.c.

#define REWRITE_REC_TEST   4

Definition at line 906 of file iozone.c.

#define SHMSIZE   ((( sizeof(struct child_stats) * MAXSTREAMS) )+4096 )

Definition at line 1263 of file iozone.c.

#define SP_CHILD_ESEND_PORT   (SP_CHILD_LISTEN_PORT+10)

Definition at line 1423 of file iozone.c.

#define SP_CHILD_LISTEN_PORT   31000

Definition at line 1422 of file iozone.c.

#define SP_MASTER_ESEND_PORT   (SP_MASTER_LISTEN_PORT+10)

Definition at line 1425 of file iozone.c.

#define SP_MASTER_LISTEN_PORT   (SP_CHILD_ESEND_PORT+10)

Definition at line 1424 of file iozone.c.

#define SP_MASTER_RESULTS_PORT   (SP_MASTER_ESEND_PORT+10)

Definition at line 1426 of file iozone.c.

#define STRIDE   17

Definition at line 760 of file iozone.c.

#define STRIDE_READ_MASK   (1 << STRIDE_READ_TEST)

Definition at line 926 of file iozone.c.

#define STRIDE_READ_TEST   5

Definition at line 907 of file iozone.c.

#define THISVERSION   " Version $Revision$"

Definition at line 63 of file iozone.c.

#define THREAD_CLEANUP_TEST   14

Definition at line 1442 of file iozone.c.

#define THREAD_FREAD_TEST   13

Definition at line 1441 of file iozone.c.

#define THREAD_FWRITE_TEST   12

Definition at line 1440 of file iozone.c.

#define THREAD_PREAD_TEST   11

Definition at line 1439 of file iozone.c.

#define THREAD_PWRITE_TEST   10

Definition at line 1438 of file iozone.c.

#define THREAD_RANDOM_MIX_TEST   9

Definition at line 1437 of file iozone.c.

#define THREAD_RANDOM_READ_TEST   6

Definition at line 1434 of file iozone.c.

#define THREAD_RANDOM_WRITE_TEST   7

Definition at line 1435 of file iozone.c.

#define THREAD_READ_TEST   3

Definition at line 1431 of file iozone.c.

#define THREAD_REREAD_TEST   4

Definition at line 1432 of file iozone.c.

#define THREAD_REVERSE_READ_TEST   8

Definition at line 1436 of file iozone.c.

#define THREAD_REWRITE_TEST   2

Definition at line 1430 of file iozone.c.

#define THREAD_STRIDE_TEST   5

Definition at line 1433 of file iozone.c.

#define THREAD_WRITE_TEST   1

Definition at line 1429 of file iozone.c.

#define TOOFAST   10

Definition at line 818 of file iozone.c.

#define UM   0xFFFFFFFF80000000ULL

Definition at line 23877 of file iozone.c.

#define USAGE   "\tUsage: For usage information type iozone -h \n\n"

Definition at line 829 of file iozone.c.

#define VOLATILE

Definition at line 395 of file iozone.c.

#define WRITER_MASK   (1 << WRITER_TEST)

Definition at line 920 of file iozone.c.

#define WRITER_TEST   0

Definition at line 902 of file iozone.c.


Typedef Documentation

typedef long long off64_t

Definition at line 357 of file iozone.c.

typedef struct sockaddr_in6 sockaddr_in6_t

Definition at line 24052 of file iozone.c.

typedef struct sockaddr_in sockaddr_in_t

Definition at line 24051 of file iozone.c.


Enumeration Type Documentation

enum boolean
Enumerator:
false 
true 

Definition at line 24049 of file iozone.c.

24049 { false = 0, true } boolean;


Function Documentation

void add_file_size ( off64_t  size  ) 

Definition at line 20032 of file iozone.c.

20035 {
20036     struct size_entry *size_listp;
20037     struct size_entry *nsize_list;
20038     
20039     size_listp=size_list;
20040     
20041     if(size_list)
20042     {
20043         if(size_listp->next)
20044             while(size_listp->next!=0)
20045                 size_listp=size_listp->next;
20046     }
20047     nsize_list=(struct size_entry *)malloc(sizeof(struct size_entry));
20048     if(nsize_list==0)
20049     {
20050         printf("Malloc failed in add_file_size\n");
20051         exit(180);
20052     }   
20053     nsize_list->next=0;
20054     nsize_list->size=size;
20055     if(size_list == 0)
20056         size_list=nsize_list;
20057     else
20058         size_listp->next=nsize_list;
20059     size_listp=size_list;
20060 }

Here is the call graph for this function:

void add_file_size (  ) 

Here is the caller graph for this function:

void add_record_size ( off64_t  size  ) 

Definition at line 20155 of file iozone.c.

20158 {
20159     struct size_entry *size_listp;
20160     struct size_entry *nsize_list;
20161     
20162     size_listp=rec_size_list;
20163     
20164     if(rec_size_list)
20165     {
20166         if(size_listp->next)
20167             while(size_listp->next!=0)
20168                 size_listp=size_listp->next;
20169     }
20170     nsize_list=(struct size_entry *)malloc(sizeof(struct size_entry));
20171     if(nsize_list==0)
20172     {
20173         printf("Malloc failed in add_file_size\n");
20174         exit(180);
20175     }   
20176     nsize_list->next=0;
20177     nsize_list->size=size;
20178     if(rec_size_list == 0)
20179         rec_size_list=nsize_list;
20180     else
20181         size_listp->next=nsize_list;
20182     size_listp=rec_size_list;
20183 }

Here is the call graph for this function:

void add_record_size (  ) 

Here is the caller graph for this function:

char* alloc_mem ( long long  size,
int  shared_flag 
)

Definition at line 12022 of file iozone.c.

12026 {
12027     long long size1;
12028     char *addr,*dumb;
12029     int shmid;
12030     int tfd;
12031     long long tmp;
12032 #if defined(solaris) 
12033         char mmapFileName[]="mmap_tmp_XXXXXX";
12034 #endif
12035 
12036     tmp = 0;
12037     dumb = (char *)0;
12038     tfd=0;
12039     size1=l_max(size,page_size);
12040     if(!distributed)
12041     {
12042         if(!trflag)
12043         {
12044             addr=(char *)malloc((size_t)size1);
12045             return(addr);
12046         }
12047         if(use_thread)
12048         {
12049             addr=(char *)malloc((size_t)size1);
12050             return(addr);
12051         }
12052     }
12053     if(!shared_flag)
12054     {
12055         addr=(char *)malloc((size_t)size1);
12056         return(addr);
12057     }
12058 #ifdef SHARED_MEM
12059     size1=l_max(size,page_size);
12060     size1=(size1 +page_size) & ~(page_size-1);
12061     shmid=(int)shmget((key_t)(IPC_PRIVATE), (size_t)size1 , (int)(IPC_CREAT|0666));
12062         if(shmid < (int)0)
12063         {
12064                 printf("\nUnable to get shared memory segment(shmget)\n");
12065 #ifdef NO_PRINT_LLD
12066                 printf("shmid = %d, size = %ld, size1 = %lu, Error %d\n",shmid,size,(size_t)size1,errno);
12067 #else
12068                 printf("shmid = %d, size = %lld, size1 = %lu, Error %d\n",shmid,size,(unsigned long)size1,errno);
12069 #endif
12070                 exit(119);
12071         }
12072         /*addr = (char *)shmat(shmid, 0, SHM_W);*/
12073     /* Some systems will not take the above but
12074      * will default to read/write if no flags
12075      * are provided. (AIX)
12076      * The POSIX standard states that if SHM_RDONLY
12077      * is not specified then it will be read/write.
12078      */
12079         addr = (char *)shmat((int)shmid, 0, 0);
12080 #ifdef _64BIT_ARCH_
12081         if((long long)addr == (long long)-1)
12082 #else
12083         if((long)addr == (long)-1)
12084 #endif
12085         {
12086                 printf("\nUnable to get shared memory segment\n");
12087                 printf("..Error %d\n",errno);
12088                 exit(120);
12089         }
12090     shmctl(shmid, IPC_RMID, 0);
12091     return(addr);
12092 #else
12093 
12094     size1=l_max(size,page_size);
12095     size1=(size1 +page_size) & ~(page_size-1);
12096 #if defined(bsd4_2) && !defined(macosx)
12097     if((tfd = creat("mmap.tmp", 0666))<0)
12098     {
12099         printf("Unable to create tmp file\n");
12100         exit(121);
12101     }
12102     addr=(char *)mmap(0,&size1,PROT_WRITE|PROT_READ,
12103         MAP_ANON|MAP_SHARED, tfd, 0);
12104     unlink("mmap.tmp");
12105 #else
12106 
12107 
12108 #if defined(solaris) 
12109     tfd=mkstemp(mmapFileName);
12110         if(tfd < 0)
12111     {
12112         printf("Unable to create tmp file\n");
12113         exit(121);
12114     }
12115     dumb=(char *)malloc((size_t)size1);
12116     bzero(dumb,size1);
12117     write(tfd,dumb,size1);
12118     free(dumb);
12119     addr=(char *)mmap(0,(size_t)size1,PROT_WRITE|PROT_READ,
12120         MAP_SHARED, tfd, 0);
12121     unlink(mmapFileName);
12122 #else
12123 #if defined(SCO) || defined(SCO_Unixware_gcc) || defined(Windows)
12124         char mmapFileName[]="mmap_tmp_XXXXXX";
12125     tfd=mkstemp(mmapFileName);
12126         if(tfd < 0)
12127         {
12128                 printf("Unable to create tmp file\n");
12129                 exit(121);
12130         }
12131         dumb=(char *)malloc((size_t)size1);
12132     bzero(dumb,size1);
12133         write(tfd,dumb,size1);
12134         free(dumb);
12135         addr=(char *)mmap(0,(size_t)size1,PROT_WRITE|PROT_READ,
12136                 MAP_SHARED, tfd, 0);
12137     unlink(mmapFileName);
12138 #else
12139     addr=(char *)mmap(0,(size_t)size1,PROT_WRITE|PROT_READ,
12140         MAP_ANONYMOUS|MAP_SHARED, -1, 0);
12141 #endif
12142 #endif
12143 #endif
12144     if((char *)addr == (char *)-1)
12145     {
12146         printf("\nUnable to get memory segment\n");
12147         printf("Error %d\n",errno);
12148         exit(122);
12149     }
12150     if(debug1)
12151         printf("Got shared memory for size %d\n",size1);
12152 
12153     return(addr);
12154 #endif
12155 }

Here is the call graph for this function:

char* alloc_mem (  ) 

Here is the caller graph for this function:

alloc_pbuf ( void   ) 

Definition at line 23620 of file iozone.c.

23622 {
23623     pbuffer = (char *) alloc_mem((long long)(3 * cache_size),(int)0);
23624     if(pbuffer == 0) {
23625                 perror("Memory allocation failed:");
23626                 exit(9);
23627     }
23628 #ifdef _64BIT_ARCH_
23629     pbuffer = (char *) 
23630         (((unsigned long long)pbuffer + cache_size ) 
23631         & ~(cache_size-1));
23632 #else
23633     pbuffer = (char *) 
23634         (((long)pbuffer + (long)cache_size ) 
23635         & ~((long)cache_size-1));
23636 #endif
23637 }

Here is the call graph for this function:

Here is the caller graph for this function:

void async_init (  ) 

Definition at line 19044 of file iozone.c.

19045 {
19046     printf("Your system does not support async I/O\n");
19047     exit(172);
19048 }

Here is the call graph for this function:

Here is the caller graph for this function:

int async_read (  ) 

Definition at line 19026 of file iozone.c.

19027 {
19028     printf("Your system does not support async I/O\n");
19029     exit(169);
19030 }

Here is the call graph for this function:

Here is the caller graph for this function:

int async_read_no_copy (  ) 

Definition at line 19050 of file iozone.c.

19051 {
19052     printf("Your system does not support async I/O\n");
19053     exit(172);
19054 }

Here is the call graph for this function:

Here is the caller graph for this function:

void async_release (  ) 

Definition at line 19056 of file iozone.c.

19057 {
19058     printf("Your system does not support async I/O\n");
19059     exit(173);
19060 }

Here is the call graph for this function:

Here is the caller graph for this function:

size_t async_write (  ) 

Definition at line 19038 of file iozone.c.

19039 {
19040     printf("Your system does not support async I/O\n");
19041     exit(171);
19042 }

Here is the call graph for this function:

Here is the caller graph for this function:

size_t async_write_no_copy (  ) 

Definition at line 19032 of file iozone.c.

19033 {
19034     printf("Your system does not support async I/O\n");
19035     exit(170);
19036 }

Here is the call graph for this function:

Here is the caller graph for this function:

int atoi (  ) 

Here is the caller graph for this function:

void auto_test (  ) 

Definition at line 3404 of file iozone.c.

03406 {
03407         off64_t kilosi;
03408     long long recszi,count1;
03409     long long mult;
03410     long long xx;
03411 
03412     /****************************************************************/
03413     /* Start with file size of 1 megabyte and repeat the test   */
03414     /* KILOBYTES_ITER_LIMIT                     */
03415     /* times.  Each time we run, the file size is doubled       */
03416     /****************************************************************/
03417 /*
03418         if(sflag) {
03419           min_file_size = kilobytes64;
03420           max_file_size = kilobytes64;
03421         }
03422         if(rflag) {
03423           min_rec_size = reclen;
03424           max_rec_size = reclen;
03425         }
03426 */
03427     if(gflag)
03428         max_file_size = maximum_file_size;
03429     if(nflag)
03430         min_file_size = minimum_file_size;
03431 
03432         if (min_rec_size > (long long)(min_file_size*1024)) {
03433 #ifdef NO_PRINT_LLD
03434             printf("Error: record length %ld is greater than filesize %ld KB\n ",
03435                                 min_rec_size,min_file_size);
03436 #else
03437             printf("Error: record length %lld is greater than filesize %lld KB\n ",
03438                                 min_rec_size,min_file_size);
03439 #endif
03440                 exit(23);
03441         }
03442 
03443     if(NOCROSSflag) xover = max_file_size;
03444 
03445     init_file_sizes(min_file_size, max_file_size);
03446     del_record_sizes();
03447     orig_min_rec_size=min_rec_size;
03448     orig_max_rec_size=max_rec_size;
03449     init_record_sizes(min_rec_size, max_rec_size);
03450 
03451         for(kilosi=get_next_file_size((off64_t)0); kilosi>0; kilosi=get_next_file_size(kilosi))
03452         {
03453     /****************************************************************/
03454     /* Start with record size of min_rec_size bytes and repeat the  */
03455     /* test, multiplying the record size by MULTIPLIER each time,   */
03456     /* until we reach max_rec_size.  At the CROSSOVER we stop doing */
03457     /* small buffers as it takes forever and becomes very       */
03458     /* un-interesting.                      */
03459     /****************************************************************/
03460              if(!rflag && !sflag && !yflag && !qflag)
03461                 if(kilosi > xover){
03462                     min_rec_size = LARGE_REC;
03463             mult = orig_min_rec_size/1024;
03464             del_record_sizes();
03465             init_record_sizes(min_rec_size, max_rec_size);
03466                 /************************************/
03467             /* Generate dummy entries in the    */
03468             /* Excel buffer for skipped         */
03469             /* record sizes          */
03470             /************************************/
03471             for(count1=min_rec_size;
03472                     (count1 != orig_min_rec_size) && (
03473                         mult <= (kilosi*1024)) ;
03474                         count1=(count1>>1))
03475             {
03476                     current_x=0;
03477                     store_value((off64_t)kilosi);
03478                     store_value((off64_t)mult);
03479                     for(xx=0;xx<20;xx++)
03480                         store_value((off64_t)0);
03481                     mult=mult*2;
03482                     current_y++;
03483                     if(current_y>max_y)
03484                         max_y=current_y;
03485                     current_x=0;
03486             }
03487          }
03488 
03489              for (recszi=get_next_record_size((off64_t)0);recszi!=0;recszi=get_next_record_size(recszi))
03490              {
03491                      if(recszi > (kilosi*1024)) 
03492             break;
03493                      begin(kilosi, recszi );
03494              current_x=0;
03495              current_y++;
03496              }
03497     }
03498 }

Here is the call graph for this function:

Here is the caller graph for this function:

void become_client (  ) 

Definition at line 21555 of file iozone.c.

21557 {
21558     int x,testnum;
21559     struct master_command mc;
21560     struct client_command cc;
21561     struct client_neutral_command *cnc;
21562     char client_name[100];
21563     char *workdir;
21564 
21565     bzero(&mc,sizeof(struct master_command));
21566     x=fork(); /* Become a daemon so that remote shell will return. */
21567     if(x != 0)
21568         exit(0);
21569     /*
21570      * I am the child 
21571      */
21572     (void)gethostname(client_name,100);
21573 
21574     fflush(stdout);
21575     fflush(stderr);
21576     if(cdebug)
21577     {
21578         newstdin=freopen("/tmp/don_in","r+",stdin);
21579         newstdout=freopen("/tmp/don_out","a+",stdout);
21580         newstderr=freopen("/tmp/don_err","a+",stderr);
21581     }
21582     else
21583     {
21584         fclose(stdin);
21585         fclose(stdout);
21586         fclose(stderr);
21587     }
21588     if(cdebug>=1)
21589     {
21590         fprintf(newstdout,"My name = %s, Controller's name = %s\n",client_name, controlling_host_name);
21591         fflush(newstdout);
21592     }
21593 
21594     /* 1. Start client receive channel              */
21595 
21596     l_sock = start_child_listen(sizeof(struct client_neutral_command));
21597     l_async_sock = start_child_listen_async(sizeof(struct client_neutral_command));
21598 
21599     /* 2. Send message to controller saying I'm joining.        */
21600 
21601     strcpy(mc.m_host_name,controlling_host_name);
21602     strcpy(mc.m_client_name,client_name);
21603     mc.m_child_port = child_port;
21604     mc.m_child_async_port = child_async_port;
21605     mc.m_command = R_CHILD_JOIN;
21606     mc.m_version = proto_version;
21607     
21608     if(cdebug)
21609     {
21610         fprintf(newstdout,"Child %s sends JOIN to master %s Host Port %d\n",
21611             client_name,controlling_host_name,controlling_host_port);
21612         fflush(newstdout);
21613     }
21614     child_send(controlling_host_name,(struct master_command *)&mc, sizeof(struct master_command));
21615 
21616     l_sock=child_attach(l_sock,0);
21617     l_async_sock=child_attach(l_async_sock,1);
21618     
21619     /* 4. Go into a loop and get all instructions from      */
21620         /*    the controlling process.                  */
21621 
21622     if(cdebug>=1)
21623     {
21624         fprintf(newstdout,"Child %s waiting for who am I\n",client_name);
21625         fflush(newstdout);
21626     }
21627     child_listen(l_sock,sizeof(struct client_neutral_command));
21628     cnc = (struct client_neutral_command *)&child_rcv_buf;
21629     bzero(&cc, sizeof(struct client_command));
21630     
21631     /* Convert from string format to arch format */
21632     sscanf(cnc->c_command,"%d",&cc.c_command);
21633     sscanf(cnc->c_client_name,"%s",cc.c_client_name);
21634     sscanf(cnc->c_client_number,"%d",&cc.c_client_number);
21635     sscanf(cnc->c_host_name,"%s",cc.c_host_name);
21636     sscanf(cnc->c_pit_hostname,"%s",cc.c_pit_hostname);
21637 
21638     if(cc.c_command == R_TERMINATE || cc.c_command==R_DEATH)
21639     {
21640         if(cdebug)
21641         {
21642             fprintf(newstdout,"Child %d received terminate on sync channel !!\n",(int)chid);
21643             fflush(newstdout);
21644         }
21645         exit(1);
21646     }
21647     
21648     if(cdebug)
21649     {
21650          fprintf(newstdout,"Child sees: \n Client name %s \n Client_num # %d \n Host_name %s\n"
21651             ,cc.c_client_name,cc.c_client_number,cc.c_host_name);
21652      fflush(newstdout);
21653     }
21654 
21655     /*
21656      * Now import all of the values of the flags that the child on this 
21657      * machine needs to be able to run the test requested.
21658      */
21659 
21660     /* 5. Get state information from the master */
21661 
21662 #ifdef NO_PRINT_LLD
21663     sscanf(cnc->c_numrecs64,"%ld",&cc.c_numrecs64);
21664     sscanf(cnc->c_reclen,"%ld",&cc.c_reclen);
21665     sscanf(cnc->c_fetchon,"%ld",&cc.c_fetchon);
21666     sscanf(cnc->c_purge,"%ld",&cc.c_purge);
21667     sscanf(cnc->c_delay,"%ld",&cc.c_delay);
21668     sscanf(cnc->c_stride,"%ld",&cc.c_stride);
21669     sscanf(cnc->c_rest_val,"%ld",&cc.c_rest_val);
21670     sscanf(cnc->c_delay_start,"%ld",&cc.c_delay_start);
21671     sscanf(cnc->c_depth,"%ld",&cc.c_depth);
21672 #else
21673     sscanf(cnc->c_numrecs64,"%lld",&cc.c_numrecs64);
21674     sscanf(cnc->c_reclen,"%lld",&cc.c_reclen);
21675     sscanf(cnc->c_fetchon,"%lld",&cc.c_fetchon);
21676     sscanf(cnc->c_purge,"%lld",&cc.c_purge);
21677     sscanf(cnc->c_delay,"%lld",&cc.c_delay);
21678     sscanf(cnc->c_stride,"%lld",&cc.c_stride);
21679     sscanf(cnc->c_rest_val,"%lld",&cc.c_rest_val);
21680     sscanf(cnc->c_delay_start,"%lld",&cc.c_delay_start);
21681     sscanf(cnc->c_depth,"%lld",&cc.c_depth);
21682 #endif
21683     sscanf(cnc->c_pit_hostname,"%s",cc.c_pit_hostname);
21684     sscanf(cnc->c_pit_service,"%s",cc.c_pit_service);
21685     sscanf(cnc->c_testnum,"%d",&cc.c_testnum);
21686     sscanf(cnc->c_client_number,"%d",&cc.c_client_number);
21687     sscanf(cnc->c_working_dir,"%s",cc.c_working_dir);
21688     sscanf(cnc->c_file_name,"%s",cc.c_file_name);
21689     sscanf(cnc->c_write_traj_filename,"%s",cc.c_write_traj_filename);
21690     sscanf(cnc->c_read_traj_filename,"%s",cc.c_read_traj_filename);
21691     sscanf(cnc->c_noretest,"%d",&cc.c_noretest);
21692     sscanf(cnc->c_notruncate,"%d",&cc.c_notruncate);
21693     sscanf(cnc->c_read_sync,"%d",&cc.c_read_sync);
21694     sscanf(cnc->c_jflag,"%d",&cc.c_jflag);
21695     sscanf(cnc->c_direct_flag,"%d",&cc.c_direct_flag);
21696     sscanf(cnc->c_cpuutilflag,"%d",&cc.c_cpuutilflag);
21697     sscanf(cnc->c_seq_mix,"%d",&cc.c_seq_mix);
21698     sscanf(cnc->c_async_flag,"%d",&cc.c_async_flag);
21699     sscanf(cnc->c_k_flag,"%d",&cc.c_k_flag);
21700     sscanf(cnc->c_h_flag,"%d",&cc.c_h_flag);
21701     sscanf(cnc->c_mflag,"%d",&cc.c_mflag);
21702     sscanf(cnc->c_pflag,"%d",&cc.c_pflag);
21703     sscanf(cnc->c_stride_flag,"%d",&cc.c_stride_flag);
21704     sscanf(cnc->c_verify,"%d",&cc.c_verify);
21705     sscanf(cnc->c_sverify,"%d",&cc.c_sverify);
21706     sscanf(cnc->c_odsync,"%d",&cc.c_odsync);
21707     sscanf(cnc->c_diag_v,"%d",&cc.c_diag_v);
21708     sscanf(cnc->c_dedup,"%d",&cc.c_dedup);
21709     sscanf(cnc->c_dedup_interior,"%d",&cc.c_dedup_interior);
21710     sscanf(cnc->c_dedup_compress,"%d",&cc.c_dedup_compress);
21711     sscanf(cnc->c_dedup_mseed,"%d",&cc.c_dedup_mseed);
21712     sscanf(cnc->c_hist_summary,"%d",&cc.c_hist_summary);
21713     sscanf(cnc->c_op_rate,"%d",&cc.c_op_rate);
21714     sscanf(cnc->c_op_rate_flag,"%d",&cc.c_op_rate_flag);
21715     sscanf(cnc->c_file_lock,"%d",&cc.c_file_lock);
21716     sscanf(cnc->c_rec_lock,"%d",&cc.c_rec_lock);
21717     sscanf(cnc->c_Kplus_readers,"%d",&cc.c_Kplus_readers);
21718     sscanf(cnc->c_multiplier,"%d",&cc.c_multiplier);
21719     sscanf(cnc->c_share_file,"%d",&cc.c_share_file);
21720     sscanf(cnc->c_pattern,"%d",&cc.c_pattern);
21721     sscanf(cnc->c_version,"%d",&cc.c_version);
21722     sscanf(cnc->c_base_time,"%d",&cc.c_base_time);
21723     sscanf(cnc->c_num_child,"%d",&cc.c_num_child);
21724     sscanf(cnc->c_pct_read,"%d",&cc.c_pct_read);
21725     sscanf(cnc->c_advise_op,"%d",&cc.c_advise_op);
21726     sscanf(cnc->c_advise_flag,"%d",&cc.c_advise_flag);
21727     sscanf(cnc->c_restf,"%d",&cc.c_restf);
21728     sscanf(cnc->c_mygen,"%d",&cc.c_mygen);
21729     sscanf(cnc->c_oflag,"%d",&cc.c_oflag);
21730     sscanf(cnc->c_mfflag,"%d",&cc.c_mfflag);
21731     sscanf(cnc->c_unbuffered,"%d",&cc.c_unbuffered);
21732     sscanf(cnc->c_Q_flag,"%d",&cc.c_Q_flag);
21733     sscanf(cnc->c_L_flag,"%d",&cc.c_L_flag);
21734     sscanf(cnc->c_xflag,"%d",&cc.c_xflag);
21735     sscanf(cnc->c_include_flush,"%d",&cc.c_include_flush);
21736     sscanf(cnc->c_OPS_flag,"%d",&cc.c_OPS_flag);
21737     sscanf(cnc->c_mmapflag,"%d",&cc.c_mmapflag);
21738     sscanf(cnc->c_mmapasflag,"%d",&cc.c_mmapasflag);
21739     sscanf(cnc->c_mmapnsflag,"%d",&cc.c_mmapnsflag);
21740     sscanf(cnc->c_mmapssflag,"%d",&cc.c_mmapssflag);
21741     sscanf(cnc->c_no_copy_flag,"%d",&cc.c_no_copy_flag);
21742     sscanf(cnc->c_w_traj_flag,"%d",&cc.c_w_traj_flag);
21743     sscanf(cnc->c_r_traj_flag,"%d",&cc.c_r_traj_flag);
21744     sscanf(cnc->c_no_unlink,"%d",&cc.c_no_unlink);
21745     sscanf(cnc->c_no_write,"%d",&cc.c_no_write);
21746     sscanf(cnc->c_include_close,"%d",&cc.c_include_close);
21747     sscanf(cnc->c_disrupt_flag,"%d",&cc.c_disrupt_flag);
21748     sscanf(cnc->c_compute_flag,"%d",&cc.c_compute_flag);
21749     sscanf(cnc->c_MS_flag,"%d",&cc.c_MS_flag);
21750     sscanf(cnc->c_mmap_mix,"%d",&cc.c_mmap_mix);
21751     sscanf(cnc->c_Kplus_flag,"%d",&cc.c_Kplus_flag);
21752     sscanf(cnc->c_compute_time,"%f",&cc.c_compute_time);
21753 
21754     strcpy(write_traj_filename,cc.c_write_traj_filename);
21755     strcpy(read_traj_filename,cc.c_read_traj_filename);
21756     numrecs64 = cc.c_numrecs64;
21757     strcpy(pit_hostname,cc.c_pit_hostname);
21758     strcpy(pit_service,cc.c_pit_service);
21759     reclen = cc.c_reclen;
21760     testnum = cc.c_testnum;
21761     chid = cc.c_client_number;
21762     workdir=cc.c_working_dir;
21763     oflag = cc.c_oflag;
21764     /* Child's absolute filename to use is provided */
21765     mfflag = cc.c_mfflag;
21766     if(mfflag)
21767         strcpy(filearray[chid],cc.c_file_name);
21768     if(cdebug)
21769     {
21770         fprintf(newstdout,"File name given %s\n",cc.c_file_name);
21771         fflush(newstdout);
21772     }
21773     unbuffered = cc.c_unbuffered;
21774     noretest = cc.c_noretest;
21775     notruncate = cc.c_notruncate;
21776     read_sync = cc.c_read_sync;
21777     jflag = cc.c_jflag;
21778     direct_flag = cc.c_direct_flag;
21779     cpuutilflag = cc.c_cpuutilflag;
21780     seq_mix = cc.c_seq_mix;
21781     async_flag = cc.c_async_flag;
21782     k_flag = cc.c_k_flag;
21783     h_flag = cc.c_h_flag;
21784     mflag = cc.c_mflag;
21785     pflag = cc.c_pflag;
21786     stride_flag = cc.c_stride_flag;
21787     fetchon = cc.c_fetchon;
21788     verify = cc.c_verify;
21789     diag_v = cc.c_diag_v;
21790     dedup = cc.c_dedup;
21791     dedup_interior = cc.c_dedup_interior;
21792     dedup_compress = cc.c_dedup_compress;
21793     dedup_mseed = cc.c_dedup_mseed;
21794     hist_summary = cc.c_hist_summary;
21795     op_rate = cc.c_op_rate;
21796     op_rate_flag = cc.c_op_rate_flag;
21797     if(diag_v)
21798         sverify = 0;
21799     else
21800         sverify = cc.c_sverify;
21801     file_lock = cc.c_file_lock;
21802     rlocking = cc.c_rec_lock;
21803     Kplus_readers = cc.c_Kplus_readers;
21804     multiplier = cc.c_multiplier;
21805     share_file = cc.c_share_file;
21806     pattern = cc.c_pattern;
21807     /* proto_version = cc.c_version; Don't copy it back. */
21808     base_time=cc.c_base_time;
21809     num_child=(long long)cc.c_num_child;
21810     pct_read=cc.c_pct_read;
21811     advise_op=cc.c_advise_op;
21812     advise_flag=cc.c_advise_flag;
21813     restf=cc.c_restf;
21814     mygen=cc.c_mygen;
21815     Q_flag = cc.c_Q_flag;
21816     L_flag = cc.c_L_flag;
21817     xflag = cc.c_xflag;
21818     w_traj_flag = cc.c_w_traj_flag;
21819     r_traj_flag = cc.c_r_traj_flag;
21820     include_flush = cc.c_include_flush;
21821     OPS_flag = cc.c_OPS_flag;
21822     purge = cc.c_purge;
21823     mmapflag = cc.c_mmapflag;
21824     mmapasflag = cc.c_mmapasflag;
21825     mmapnsflag = cc.c_mmapnsflag;
21826     mmapssflag = cc.c_mmapssflag; 
21827     no_copy_flag = cc.c_no_copy_flag;
21828     no_unlink = cc.c_no_unlink;
21829     no_write = cc.c_no_write;
21830     include_close = cc.c_include_close;
21831     disrupt_flag = cc.c_disrupt_flag;
21832     compute_flag = cc.c_compute_flag;
21833     MS_flag = cc.c_MS_flag;
21834     mmap_mix = cc.c_mmap_mix;
21835     Kplus_flag = cc.c_Kplus_flag;
21836     delay = cc.c_delay;
21837     stride = cc.c_stride;
21838     rest_val = cc.c_rest_val;
21839     depth = cc.c_depth;
21840     delay_start = cc.c_delay_start;
21841     compute_time = cc.c_compute_time;
21842     if(cdebug)
21843     {
21844         fprintf(newstdout,"Child %d change directory to %s\n",(int)chid,workdir);
21845         fflush(newstdout);
21846     }
21847     if(purge)
21848         alloc_pbuf();
21849 
21850     /* 6. Change to the working directory */
21851 
21852     if(chdir(workdir)<0)
21853         client_error=errno;
21854     start_child_listen_loop(); /* The async channel listener */
21855 
21856     /* Need to start this after getting into the correct directory */
21857     if(w_traj_flag)
21858         w_traj_size();
21859     if(r_traj_flag)
21860         r_traj_size();
21861 
21862     get_resolution();       /* Get my clock resolution */
21863     if(hist_summary)
21864     {
21865         printf("Child got HISTORY flag\n");
21866     }
21867 
21868     /* 7. Run the test */
21869     switch(testnum) {
21870 
21871     case THREAD_WRITE_TEST : 
21872         if(cdebug>=1)
21873         {
21874             fprintf(newstdout,"Child %d running thread_write_test\n",(int)chid);
21875             fflush(newstdout);
21876         }
21877         thread_write_test((long)0);
21878         break;
21879 #ifdef HAVE_PREAD
21880     case THREAD_PWRITE_TEST : 
21881         if(cdebug>=1)
21882         {
21883             fprintf(newstdout,"Child %d running thread_pwrite_test\n",(int)chid);
21884             fflush(newstdout);
21885         }
21886         thread_pwrite_test((long)0);
21887         break;
21888 #endif
21889     case THREAD_REWRITE_TEST : 
21890         if(cdebug>=1)
21891         {
21892             fprintf(newstdout,"Child %d running thread_rewrite_test\n",(int)chid);
21893             fflush(newstdout);
21894         }
21895         thread_rwrite_test((long)0);
21896         break;
21897     case THREAD_READ_TEST : 
21898         if(cdebug>=1)
21899         {
21900             fprintf(newstdout,"Child %d running thread_read_test\n",(int)chid);
21901             fflush(newstdout);
21902         }
21903         thread_read_test((long)0);
21904         break;
21905 #ifdef HAVE_PREAD
21906     case THREAD_PREAD_TEST : 
21907         if(cdebug>=1)
21908         {
21909             fprintf(newstdout,"Child %d running thread_read_test\n",(int)chid);
21910             fflush(newstdout);
21911         }
21912         thread_pread_test((long)0);
21913         break;
21914 #endif
21915     case THREAD_REREAD_TEST : 
21916         if(cdebug>=1)
21917         {
21918             fprintf(newstdout,"Child %d running thread_reread_test\n",(int)chid);
21919             fflush(newstdout);
21920         }
21921         thread_rread_test((long)0);
21922         break;
21923     case THREAD_STRIDE_TEST : 
21924         if(cdebug>=1)
21925         {
21926             fprintf(newstdout,"Child %d running thread_stride_read_test\n",(int)chid);
21927             fflush(newstdout);
21928         }
21929         thread_stride_read_test((long)0);
21930         break;
21931     case THREAD_RANDOM_READ_TEST : 
21932         if(cdebug>=1)
21933         {
21934             fprintf(newstdout,"Child %d running random read test\n",(int)chid);
21935             fflush(newstdout);
21936         }
21937         thread_ranread_test((long)0);
21938         break;
21939     case THREAD_RANDOM_WRITE_TEST : 
21940         if(cdebug>=1)
21941         {
21942             fprintf(newstdout,"Child %d running random write test\n",(int)chid);
21943             fflush(newstdout);
21944         }
21945         thread_ranwrite_test((long)0);
21946         break;
21947     case THREAD_REVERSE_READ_TEST : 
21948         if(cdebug>=1)
21949         {
21950             fprintf(newstdout,"Child %d running reverse read test\n",(int)chid);
21951             fflush(newstdout);
21952         }
21953         thread_reverse_read_test((long)0);
21954         break;
21955     case THREAD_RANDOM_MIX_TEST : 
21956         if(cdebug>=1)
21957         {
21958             fprintf(newstdout,"Child %d running mixed workload test\n",(int)chid);
21959             fflush(newstdout);
21960         }
21961         thread_mix_test((long)0);
21962         break;
21963     case THREAD_FWRITE_TEST : 
21964         if(cdebug>=1)
21965         {
21966             fprintf(newstdout,"Child %d running thread_fwrite_test\n",(int)chid);
21967             fflush(newstdout);
21968         }
21969         thread_fwrite_test((long)0);
21970         break;
21971     case THREAD_FREAD_TEST : 
21972         if(cdebug>=1)
21973         {
21974             fprintf(newstdout,"Child %d running thread_fread_test\n",(int)chid);
21975             fflush(newstdout);
21976         }
21977         thread_fread_test((long)0);
21978         break;
21979     case THREAD_CLEANUP_TEST : 
21980         if(cdebug>=1)
21981         {
21982             fprintf(newstdout,"Child %d running cleanup\n",(int)chid);
21983             fflush(newstdout);
21984         }
21985         thread_cleanup_test((long)0);
21986         break;
21987     };
21988     if(cdebug>=1)
21989     {
21990         fprintf(newstdout,"Child %d finished running test.\n",(int)chid);
21991         fflush(newstdout);
21992     }
21993     
21994     /* 8. Release the listen and send sockets to the master */
21995     stop_child_listen(l_sock);
21996 
21997     exit(0);
21998 }

Here is the call graph for this function:

Here is the caller graph for this function:

void begin ( off64_t  kilos64,
long long  reclength 
)

Definition at line 3179 of file iozone.c.

03183 {
03184     long long num_tests,test_num,i,j;
03185     long long data1[MAXTESTS], data2[MAXTESTS];
03186     num_tests = sizeof(func)/sizeof(char *);
03187 #if defined(HAVE_PREAD) 
03188     if(!Eflag)
03189     {
03190 #if defined(HAVE_PREAD) && defined(HAVE_PREADV)
03191         num_tests -= 4;
03192 #else
03193         num_tests -= 2;
03194 #endif
03195         if(mmapflag || async_flag)
03196         {
03197             num_tests -= 2;
03198         }
03199     }
03200     else
03201     {
03202         if(mmapflag || async_flag)
03203 #if defined(HAVE_PREAD) && defined(HAVE_PREADV)
03204             num_tests -= 6;
03205 #else
03206             num_tests -= 4;
03207 #endif
03208     }
03209 #else
03210     if(mmapflag || async_flag)
03211     {
03212         num_tests -= 2;
03213     }
03214 #endif
03215 
03216     if(RWONLYflag) num_tests = 2;       /* kcollins 8-21-96*/
03217     sync();         /* just in case there were some dirty */
03218     sync();
03219     kilobytes64=kilos64;
03220     reclen=reclength;
03221     numrecs64 = (kilobytes64*1024)/reclen;
03222     store_value(kilobytes64);
03223     if(r_traj_flag || w_traj_flag)
03224         store_value((off64_t)0);
03225     else    
03226         store_value((off64_t)(reclen/1024));
03227 
03228 #ifdef NO_PRINT_LLD
03229     if(!silent) printf("%16ld",kilobytes64);
03230     if(r_traj_flag || w_traj_flag)
03231     {
03232         if(!silent) printf("%8ld",0);
03233     }
03234     else
03235     {
03236         if(!silent) printf("%8ld",reclen/1024);
03237     }
03238 #else
03239     if(!silent) printf("%16lld",kilobytes64);
03240     if(r_traj_flag || w_traj_flag)
03241     {
03242         if(!silent) printf("%8lld",(long long )0);
03243     }
03244     else
03245     {
03246         if(!silent) printf("%8lld",reclen/1024);
03247     }
03248 #endif
03249     if(include_tflag)
03250     {
03251         for(i=0;i<num_tests;i++)
03252         {
03253             if(include_mask & (long long)(1<<i))
03254                func[i](kilobytes64,reclen,&data1[i],&data2[i]);
03255             else
03256             {
03257                     if(!silent) printf("%s",test_output[i]); 
03258                 fflush(stdout);
03259                 for(j=0;j<test_soutput[i];j++)
03260                     store_value((off64_t)0);
03261             }
03262         }
03263     }
03264     else
03265     {
03266         for(test_num=0;test_num < num_tests;test_num++)
03267         {
03268             func[test_num](kilobytes64,reclen,&data1[test_num],&data2[test_num]);
03269         };
03270     }
03271     if(!silent) printf("\n");
03272     if(!OPS_flag && !include_tflag){            /* Report in ops/sec ? */
03273        if(data1[1]!=0 && data2[1] != 0)
03274        {   
03275         totaltime = data1[1] + data1[0];
03276         if (totaltime < TOOFAST) 
03277         {
03278             goodkilos = (TOOFAST/totaltime)*2*kilobytes64;
03279                 printf("\nThe test completed too quickly to give a good result\n");
03280                 printf("You will get a more precise measure of this machine's\n");
03281                 printf("performance by re-running iozone using the command:\n");
03282 #ifdef NO_PRINT_LLD
03283                 printf("\n\tiozone %ld ", goodkilos);
03284                 printf("\t(i.e., file size = %ld kilobytes64)\n", goodkilos);
03285 #else
03286                 printf("\n\tiozone %lld ", goodkilos);
03287                 printf("\t(i.e., file size = %lld kilobytes64)\n", goodkilos);
03288 #endif
03289         }
03290        } else {
03291             goodrecl = reclen/2;
03292             printf("\nI/O error during read.  Try again with the command:\n");
03293 #ifdef NO_PRINT_LLD
03294             printf("\n\tiozone %ld %ld ", kilobytes64,  goodrecl);
03295             printf("\t(i.e. record size = %ld bytes)\n",  goodrecl);
03296 #else
03297             printf("\n\tiozone %lld %lld ", kilobytes64,  goodrecl);
03298             printf("\t(i.e. record size = %lld bytes)\n",  goodrecl);
03299 #endif
03300        }
03301     }
03302     if (!no_unlink)
03303     {
03304         if(check_filename(filename))
03305               unlink(filename); /* delete the file */
03306     }
03307                     /*stop timer*/
03308     return ;
03309 }

Here is the call graph for this function:

void begin (  ) 

Here is the caller graph for this function:

check_filename ( char *  name  ) 

Definition at line 23647 of file iozone.c.

23650 {
23651 #ifdef _LARGEFILE64_SOURCE
23652     struct stat64 mystat;
23653 #else
23654     struct stat mystat;
23655 #endif
23656     int x;
23657     if(strlen(name)==0)
23658         return(0);
23659     /* Lets try stat first.. may get an error if file is too big */
23660     x=I_STAT(name,&mystat);
23661     if(x<0)
23662     {
23663         return(0);
23664         /* printf("Stat failed %d\n",x); */
23665     }
23666     if(mystat.st_mode & S_IFREG)
23667     {
23668         /*printf("Is a regular file\n");*/
23669         return(1);
23670     }
23671     return(0);
23672 }

int check_filename (  ) 

Here is the caller graph for this function:

int child_attach ( int  s,
int  flag 
)

Definition at line 20831 of file iozone.c.

20834 {
20835     unsigned int me;
20836     int ns;
20837     struct sockaddr_in *addr;
20838     if(flag)
20839     {
20840         addr=&child_async_sock;
20841         if(cdebug)
20842         {
20843             fprintf(newstdout,"Child %d attach async\n",(int)chid);
20844             fflush(newstdout);
20845         }
20846     }
20847     else
20848     {
20849         addr=&child_sync_sock;
20850         if(cdebug)
20851         {
20852             fprintf(newstdout,"Child %d attach sync\n",(int)chid);
20853             fflush(newstdout);
20854         }
20855     }
20856     me=sizeof(struct sockaddr_in);
20857     if(cdebug)
20858     {
20859         printf("Child %d enters listen\n",(int)chid);
20860         fflush(stdout);
20861     }
20862     listen(s,10);
20863     if(cdebug)
20864     {
20865         fprintf(newstdout,"Child %d enters accept\n",(int)chid);
20866         fflush(newstdout);
20867     }
20868     ns=accept(s,(void *)addr,&me);
20869     if(cdebug)
20870     {
20871         fprintf(newstdout,"Child %d attached for receive. Sock %d  %d\n",
20872             (int)chid, ns,errno);
20873         fflush(newstdout);
20874     }
20875     return(ns);
20876 }

Here is the caller graph for this function:

void child_listen ( int  sock,
int  size_of_message 
)

Definition at line 20888 of file iozone.c.

20891 {
20892     int tsize;
20893     int rcvd;
20894     int s;
20895     int rc;
20896     char *cnc;
20897 
20898     cnc = (char *)&child_rcv_buf[0];
20899     bzero(cnc, sizeof(child_rcv_buf));
20900     s = sock;
20901     tsize=size_of_message; /* Number of messages to receive */
20902     rcvd = 0;
20903     while(rcvd < tsize)
20904     {
20905         if(cdebug ==1)
20906         {
20907             fprintf(newstdout,"Child %d In recieve \n",(int)chid);
20908             fflush(newstdout);
20909         }
20910         rc=read(s,cnc,size_of_message);
20911         if(rc < 0)
20912         {
20913             fprintf(newstdout,"Read failed. Errno %d \n",errno);
20914             fflush(newstdout);
20915             exit(21);
20916         }
20917         if(cdebug >= 1)
20918         {
20919             fprintf(newstdout,"Child %d: Got %d bytes\n",(int)chid, rc);
20920             fflush(newstdout);
20921         }
20922         rcvd+=rc;
20923         cnc+=rc;
20924     }
20925     if(cdebug >= 1)
20926     {
20927         fprintf(newstdout,"Child %d: return from listen\n",(int)chid);
20928         fflush(newstdout);
20929     }
20930 }

Here is the call graph for this function:

void child_listen (  ) 

Here is the caller graph for this function:

void child_listen_async ( int  sock,
int  size_of_message 
)

Definition at line 21010 of file iozone.c.

21013 {
21014     int tsize;
21015     int rcvd;
21016     int s;
21017     int rc;
21018     char *cnc;
21019 
21020     cnc = &child_async_rcv_buf[0];
21021     s = sock;
21022     tsize=size_of_message; /* Number of messages to receive */
21023     rcvd = 0;
21024     while(rcvd < tsize)
21025     {
21026         if(cdebug ==1)
21027         {
21028             fprintf(newstdout,"Child %d In async recieve \n",(int)chid);
21029             fflush(newstdout);
21030         }
21031         rc=read(s,cnc,size_of_message);
21032         if(rc < 0)
21033         {
21034             fprintf(newstdout,"Read failed. Errno %d \n",errno);
21035             fflush(newstdout);
21036             exit(21);
21037         }
21038         /* Special case. If master gets final results, it can 
21039                    exit, and close the connection to the async child
21040                    too quickly. When this happens the child gets a 
21041            read() that returns 0. It just needs to exit here.
21042         */
21043         if(rc==0)
21044             exit(0);
21045         if(cdebug >= 1)
21046         {
21047             fprintf(newstdout,"Child %d: Got %d bytes (async) \n",(int)chid,rc);
21048             fflush(newstdout);
21049         }
21050         rcvd+=rc;
21051         cnc+=rc;
21052     }
21053     if(cdebug >= 1)
21054     {
21055         fprintf(newstdout,"Child %d: return from async listen\n",(int)chid);
21056         fflush(newstdout);
21057     }
21058 }

Here is the call graph for this function:

void child_listen_async (  ) 

Here is the caller graph for this function:

void child_remove_files ( int  i  ) 

Definition at line 22504 of file iozone.c.

22507 {
22508 
22509     char *dummyfile[MAXSTREAMS];           /* name of dummy file     */
22510     dummyfile[i]=(char *)malloc((size_t)MAXNAMESIZE);
22511     if(mfflag)
22512     {
22513         sprintf(dummyfile[i],"%s",filearray[i]);
22514     }
22515     else
22516     {
22517         sprintf(dummyfile[i],"%s.DUMMY.%d",filearray[i],i);
22518     }
22519     if(cdebug)
22520     {
22521         fprintf(newstdout,"Child %d remove: %s \n",(int)chid, dummyfile[i]);
22522         fflush(newstdout);
22523     }
22524     if(check_filename(dummyfile[i]))
22525         unlink(dummyfile[i]);
22526 }

Here is the call graph for this function:

void child_remove_files (  ) 

Here is the caller graph for this function:

void child_send ( char *  controlling_host_name,
struct master_command send_buffer,
int  send_size 
)

Definition at line 20406 of file iozone.c.

20411 {
20412 
20413         int rc,child_socket_val;
20414         struct hostent *he;
20415         int tmp_port;
20416         struct in_addr *ip;
20417         struct sockaddr_in cs_addr,cs_raddr;
20418     struct master_neutral_command outbuf;
20419     struct timespec req,rem;
20420 
20421     req.tv_sec = 0;
20422     req.tv_nsec = 10000000;
20423     rem.tv_sec = 0;
20424     rem.tv_nsec = 10000000;
20425 
20426         if(cdebug)
20427     {
20428            fprintf(newstdout,"Start_child_send: %s  Size %d\n",controlling_host_name,send_size);
20429        fflush(newstdout);
20430     }
20431         he = gethostbyname(controlling_host_name);
20432         if (he == NULL)
20433         {
20434                 exit(22);
20435         }
20436         ip = (struct in_addr *)he->h_addr_list[0];
20437 
20438 over:
20439         cs_raddr.sin_family = AF_INET;
20440         cs_raddr.sin_port = htons(controlling_host_port);
20441         cs_raddr.sin_addr.s_addr = ip->s_addr;
20442         child_socket_val = socket(AF_INET, SOCK_STREAM, 0);
20443         if (child_socket_val < 0)
20444         {
20445                 perror("Child: socket failed:");
20446                 exit(23);
20447         }
20448         bzero(&cs_addr, sizeof(struct sockaddr_in));
20449         tmp_port= CHILD_ESEND_PORT;
20450         cs_addr.sin_port = htons(tmp_port);
20451         cs_addr.sin_family = AF_INET;
20452         cs_addr.sin_addr.s_addr = INADDR_ANY;
20453         rc = -1;
20454         while (rc < 0)
20455         {
20456                 rc = bind(child_socket_val, (struct sockaddr *)&cs_addr,
20457                                                 sizeof(struct sockaddr_in));
20458                 if(rc < 0)
20459                 {
20460                         tmp_port++;
20461                         cs_addr.sin_port=htons(tmp_port);
20462                         continue;
20463                 }
20464         }
20465         if (rc < 0)
20466         {
20467                 perror("Child: bind failed\n");
20468                 exit(24);
20469         }
20470         if(cdebug)
20471     {
20472           fprintf(newstdout,"Child sender bound to port %d Master port %d \n",tmp_port,HOST_LIST_PORT);
20473       fflush(newstdout);
20474     }
20475 again:
20476     nanosleep(&req,&rem);
20477         rc = connect(child_socket_val, (struct sockaddr *)&cs_raddr,
20478                         sizeof(struct sockaddr_in));
20479         if (rc < 0)
20480         {
20481                 if((ecount++ < 200) && (errno != EISCONN))
20482                 {
20483             nanosleep(&req,&rem);
20484                         /*sleep(1);*/
20485                         goto again;
20486                 }
20487                 if(cdebug)
20488                 {
20489                fprintf(newstdout,"Child: connect failed. Errno %d \n",errno);
20490            fflush(newstdout);
20491                 }
20492                 close(child_socket_val);
20493         nanosleep(&req,&rem);
20494                 /*sleep(1);*/
20495                 ecount=0;
20496                 goto over;
20497         }
20498         ecount=0;
20499         if(cdebug)
20500     {
20501           fprintf(newstdout,"Child connected\n");
20502       fflush(newstdout);
20503     }
20504 
20505     /* NOW send */
20506 
20507     bzero(&outbuf, sizeof(struct master_neutral_command));
20508     if(cdebug>=1)
20509     {
20510         fprintf(newstdout,"Child %d sending message to %s \n",(int)chid, controlling_host_name);
20511         fflush(newstdout);
20512     }
20513     /* 
20514      * Convert internal commands to string format to neutral format for portability
20515      */
20516     strcpy(outbuf.m_host_name,send_buffer->m_host_name);
20517     strcpy(outbuf.m_client_name,send_buffer->m_client_name);
20518     sprintf(outbuf.m_client_number,"%d",send_buffer->m_client_number);
20519     sprintf(outbuf.m_client_error,"%d",send_buffer->m_client_error);
20520     sprintf(outbuf.m_child_port,"%d",send_buffer->m_child_port);
20521     sprintf(outbuf.m_child_async_port,"%d",send_buffer->m_child_async_port);
20522     sprintf(outbuf.m_command,"%d",send_buffer->m_command);
20523     sprintf(outbuf.m_testnum,"%d",send_buffer->m_testnum);
20524     sprintf(outbuf.m_version,"%d",send_buffer->m_version);
20525     sprintf(outbuf.m_mygen,"%d",send_buffer->m_mygen);
20526     sprintf(outbuf.m_throughput,"%f",send_buffer->m_throughput);
20527     sprintf(outbuf.m_cputime,"%f", send_buffer->m_cputime);
20528     sprintf(outbuf.m_walltime,"%f",send_buffer->m_walltime);
20529     sprintf(outbuf.m_stop_flag,"%d",send_buffer->m_stop_flag);
20530     sprintf(outbuf.m_actual,"%f",send_buffer->m_actual);
20531 #ifdef NO_PRINT_LLD
20532     sprintf(outbuf.m_child_flag,"%ld",send_buffer->m_child_flag);
20533 #else
20534     sprintf(outbuf.m_child_flag,"%lld",send_buffer->m_child_flag);
20535 #endif
20536     rc=write(child_socket_val,&outbuf,sizeof(struct master_neutral_command));
20537         if (rc < 0) {
20538                 perror("write failed\n");
20539                 exit(26);
20540         }
20541     close(child_socket_val);
20542 }

Here is the call graph for this function:

void child_send (  ) 

Here is the caller graph for this function:

void cleanup_children (  ) 

Definition at line 22647 of file iozone.c.

22649 {
22650     int i;
22651     struct client_command cc;
22652     bzero(&cc,sizeof(struct client_command));
22653     cc.c_command = R_DEATH;
22654     for(i=0;i<num_child;i++)
22655     {
22656         cc.c_client_number = (int)i; 
22657         /* Child not started yet */
22658         if(child_idents[i].state == C_STATE_ZERO)
22659             ;
22660         /* Child is waiting for who info */
22661         if(child_idents[i].state == C_STATE_WAIT_WHO)
22662         {
22663             if(mdebug)
22664                 printf("Master sending signaled death to child !!\n");
22665             master_send(master_send_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
22666         }
22667         /* Child is waiting at the barrier */
22668         if(child_idents[i].state == C_STATE_WAIT_BARRIER)
22669         {
22670             if(mdebug)
22671                 printf("Master sending signaled death to child !!\n");
22672             master_send(master_send_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
22673             if(mdebug)
22674                 printf("Master sending signaled death to child async !!\n");
22675             master_send(master_send_async_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
22676         }
22677             
22678     }
22679 }

Here is the call graph for this function:

Here is the caller graph for this function:

void cleanup_comm (  ) 

Definition at line 22690 of file iozone.c.

22692 {
22693     int i;
22694     for(i=0;i<num_child;i++)
22695     {
22696             close(master_send_sockets[i]);
22697             close(master_send_async_sockets[i]);
22698     }
22699 }

Here is the call graph for this function:

Here is the caller graph for this function:

int close (  ) 
void close_xls (  ) 

Here is the caller graph for this function:

static double cpu_util ( double  cputime,
double  walltime 
) [static]

Definition at line 19347 of file iozone.c.

19350 {
19351     double cpu;
19352 
19353     if (walltime <= (double)0.0)
19354     {
19355         cpu = (double)0.0;
19356         return cpu;
19357     }
19358     if (cputime <= (double)0.0)
19359         cputime = 0.0;
19360     if (walltime <= (double)0.0)
19361         cpu = (double)100.0;
19362     else {
19363         cpu = (((double)100.0 * cputime) / walltime);
19364         /*
19365         if (cpu > (double)100.0)
19366             cpu = (double)99.99;
19367         */
19368     }
19369     return cpu;
19370 }

static double cpu_util (  )  [static]

Here is the caller graph for this function:

void create_list (  ) 
void create_temp (  ) 
int create_xls (  ) 

Here is the caller graph for this function:

void del_record_sizes (  ) 

Definition at line 20128 of file iozone.c.

20130 {
20131         struct size_entry *size_listp;
20132         struct size_entry *save_item;
20133 
20134         size_listp=rec_size_list;
20135         if(rec_size_list)
20136         {
20137                 while(size_listp!=0)
20138                 {
20139                         save_item=size_listp->next;
20140                         free(size_listp);
20141                         size_listp=save_item;
20142                 }
20143         }
20144         rec_size_list=0;
20145 }

Here is the caller graph for this function:

void disrupt ( int  fd  ) 

Definition at line 19502 of file iozone.c.

19505 {
19506     char *nbuff,*free_addr;
19507     off64_t current;
19508 
19509     free_addr=nbuff=(char *)malloc((size_t)page_size+page_size);
19510     nbuff=(char *)(((long)nbuff+(long)page_size) & (long)~(page_size-1));
19511 
19512     /* Save current position */
19513     current = I_LSEEK(fd,0,SEEK_CUR);
19514 
19515     /* Move to beginning of file */
19516     I_LSEEK(fd,0,SEEK_SET);
19517 
19518     /* Read a little of the file */
19519     if(direct_flag)
19520         junk=read(fd,nbuff,page_size);
19521     else
19522         junk=read(fd,nbuff,1);
19523 
19524     /* Skip into the file */
19525     I_LSEEK(fd,page_size,SEEK_SET);
19526 
19527     /* Read a little of the file */
19528     if(direct_flag)
19529         junk=read(fd,nbuff,page_size);
19530     else
19531         junk=read(fd,nbuff,1);
19532 
19533     /* Restore current position in file, before disruption */
19534     I_LSEEK(fd,current,SEEK_SET);
19535     free(free_addr);
19536     
19537 }

Here is the call graph for this function:

void disrupt (  ) 

Here is the caller graph for this function:

void distribute_stop (  ) 

Definition at line 22564 of file iozone.c.

22566 {
22567     int i;
22568     struct client_command cc;
22569 
22570     /*
22571      * Only send one stop to the clients. Each client will
22572      * send stop to the master, but the master only needs
22573      * to distribute the first stop. Without this, the 
22574      * master may distribute too many stops and overflow
22575      * the socket buffer on the client.
22576      */
22577     if(sent_stop)
22578     {
22579         if(mdebug)
22580         {
22581           s_count++;
22582           printf("Master not send stop %d\n",s_count);
22583         }
22584         return;
22585     }
22586     bzero(&cc,sizeof(struct client_command));
22587     cc.c_command = R_STOP_FLAG;
22588     cc.c_stop_flag = 1;
22589     for(i=0;i<num_child;i++)
22590     {
22591         cc.c_client_number = (int)i; 
22592         if(mdebug)
22593             printf("Master distributing stop flag to child %d\n",i);
22594         master_send(master_send_async_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
22595     }
22596     sent_stop=1;
22597 }

Here is the call graph for this function:

Here is the caller graph for this function:

float do_compute ( float  comp_delay  ) 

Definition at line 19474 of file iozone.c.

19477 {
19478     double starttime,tmptime;
19479     if(comp_delay == (float)0.0)
19480         return(0.0);
19481     starttime=time_so_far();
19482     while(1)
19483     {   
19484         tmptime=time_so_far()-starttime;
19485         if(tmptime >= (double)comp_delay)
19486             return(tmptime);
19487     }
19488     return(0.0);
19489 }

Here is the call graph for this function:

float do_compute (  ) 

Here is the caller graph for this function:

void do_float (  ) 

Here is the caller graph for this function:

void do_label (  ) 

Here is the caller graph for this function:

void do_speed_check ( int  client_flag  ) 

Definition at line 23531 of file iozone.c.

23534 {
23535     int i;
23536     if(client_flag)
23537     {
23538         speed_main(" "," ",reclen,kilobytes64,client_flag);
23539     }
23540     else
23541     {
23542         printf("Checking %d clients\n",clients_found);
23543         for(i=0;i<clients_found;i++)
23544         {
23545             speed_main(child_idents[i].child_name,
23546                 child_idents[i].execute_path,
23547                 reclen, kilobytes64,client_flag);
23548         }
23549     }
23550 }

Here is the call graph for this function:

void do_speed_check (  ) 

Here is the caller graph for this function:

void dump_cputimes ( void   ) 

Definition at line 11880 of file iozone.c.

11882 {
11883     bif_row++;
11884     bif_column = 0;
11885 
11886     if ((!include_tflag) || (include_mask & (long long)WRITER_MASK)) {
11887     if(bif_flag)
11888         do_label(bif_fd, "Writer CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11889     if(!silent) printf("\n%cWriter CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11890     dump_times(2); 
11891     if(bif_flag)
11892         do_label(bif_fd, "Re-writer CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11893     if(!silent) printf("\n%cRe-writer CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11894     dump_times(3); 
11895     }
11896 
11897     if ((!include_tflag) || (include_mask & (long long)READER_MASK)) {
11898     if(bif_flag)
11899         do_label(bif_fd, "Reader CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11900     if(!silent) printf("\n%cReader CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11901     dump_times(4); 
11902     if(bif_flag)
11903         do_label(bif_fd, "Re-reader CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11904     if(!silent) printf("\n%cRe-Reader CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11905     dump_times(5); 
11906     }
11907 
11908     if ((!include_tflag) || (include_mask & (long long)RANDOM_RW_MASK)) {
11909         if(bif_flag)
11910             do_label(bif_fd, "Random Read CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11911         if(!silent) printf("\n%cRandom read CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11912         dump_times(6); 
11913         if(bif_flag)
11914             do_label(bif_fd, "Random Write CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11915         if(!silent) printf("\n%cRandom write CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11916         dump_times(7); 
11917     }
11918 
11919     if ((!include_tflag) || (include_mask & (long long)REVERSE_MASK)) {
11920         if(bif_flag)
11921             do_label(bif_fd, "Backward Read CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11922         if(!silent) printf("\n%cBackward read CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11923         dump_times(8); 
11924     }
11925 
11926     if ((!include_tflag) || (include_mask & (long long)REWRITE_REC_MASK)) {
11927         if(bif_flag)
11928             do_label(bif_fd, "Record Rewrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11929         if(!silent) printf("\n%cRecord rewrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11930         dump_times(9); 
11931     }
11932 
11933     if ((!include_tflag) || (include_mask & (long long)STRIDE_READ_MASK)) {
11934         if(bif_flag)
11935             do_label(bif_fd, "Stride Read CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11936         if(!silent) printf("\n%cStride read CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11937         dump_times(10); 
11938     }
11939 
11940     if ((!include_tflag) || (include_mask & (long long)FWRITER_MASK)) {
11941         if(bif_flag)
11942             do_label(bif_fd, "Fwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11943         if(!silent) printf("\n%cFwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11944         dump_times(11); 
11945         if(bif_flag)
11946             do_label(bif_fd, "Re-fwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11947         if(!silent) printf("\n%cRe-Fwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11948         dump_times(12); 
11949     }
11950 
11951     if ((!include_tflag) || (include_mask & (long long)FREADER_MASK)) {
11952         if(bif_flag)
11953             do_label(bif_fd, "Fread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11954         if(!silent) printf("\n%cFread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11955         dump_times(13); 
11956         if(bif_flag)
11957             do_label(bif_fd, "Re-fread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11958         if(!silent) printf("\n%cRe-Fread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11959         dump_times(14); 
11960     }
11961 
11962 #ifdef HAVE_PREAD
11963     if(Eflag)
11964     {
11965         if ((!include_tflag) || (include_mask & (long long)PWRITER_MASK)) {
11966             if(bif_flag)
11967                 do_label(bif_fd, "Pwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11968             if(!silent) printf("\n%cPwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11969             dump_times(15); 
11970             if(bif_flag)
11971                 do_label(bif_fd, "Re-pwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11972             if(!silent) printf("\n%cRe-Pwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11973             dump_times(16); 
11974         }
11975 
11976         if ((!include_tflag) || (include_mask & (long long)PREADER_MASK)) {
11977             if(bif_flag)
11978                 do_label(bif_fd, "Pread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11979             if(!silent) printf("\n%cPread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11980             dump_times(17); 
11981             if(bif_flag)
11982                 do_label(bif_fd, "Re-pread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11983             if(!silent) printf("\n%cRe-Pread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11984             dump_times(18); 
11985         }
11986 
11987 #ifdef HAVE_PREADV
11988         if ((!include_tflag) || (include_mask & (long long)PWRITEV_MASK)) {
11989             if(bif_flag)
11990                 do_label(bif_fd, "Pwritev CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11991             if(!silent) printf("\n%cPwritev CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11992             dump_times(19); 
11993             if(bif_flag)
11994                 do_label(bif_fd, "Re-pwritev CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
11995             if(!silent) printf("\n%cRe-Pwritev CPU utilization report (Zero values should be ignored)%c\n",'"','"');
11996             dump_times(20); 
11997         }
11998 
11999         if ((!include_tflag) || (include_mask & (long long)PREADV_MASK)) {
12000             if(bif_flag)
12001                 do_label(bif_fd, "Preadv CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
12002             if(!silent) printf("\n%cPreadv CPU utilization report (Zero values should be ignored)%c\n",'"','"');
12003             dump_times(21); 
12004             if(bif_flag)
12005                 do_label(bif_fd, "Re-preadv CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
12006             if(!silent) printf("\n%cRe-Preadv CPU utilization report (Zero values should be ignored)%c\n",'"','"');
12007             dump_times(22); 
12008         }
12009 #endif
12010     }
12011 #endif
12012 }

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_excel (  ) 

Definition at line 11653 of file iozone.c.

11655 {
11656     if(bif_flag)
11657     {
11658         bif_fd=create_xls(bif_filename);
11659         do_label(bif_fd,command_line,bif_row++,bif_column);
11660         do_label(bif_fd," ",bif_row++,bif_column);
11661                 do_label(bif_fd,"The top row is records sizes, the left column is file sizes",bif_row++,bif_column);
11662     }
11663     if(!silent) printf("Excel output is below:\n");
11664 
11665     if ((!include_tflag) || (include_mask & (long long)WRITER_MASK)) {
11666     if(bif_flag)
11667         do_label(bif_fd,"Writer Report",bif_row++,bif_column);
11668     if(!silent) printf("\n%cWriter report%c\n",'"','"');
11669     dump_report(2); 
11670     if(bif_flag)
11671         do_label(bif_fd,"Re-writer Report",bif_row++,bif_column);
11672     if(!silent) printf("\n%cRe-writer report%c\n",'"','"');
11673     dump_report(3); 
11674     }
11675 
11676     if ((!include_tflag) || (include_mask & (long long)READER_MASK)) {
11677     if(bif_flag)
11678         do_label(bif_fd,"Reader Report",bif_row++,bif_column);
11679     if(!silent) printf("\n%cReader report%c\n",'"','"');
11680     dump_report(4); 
11681     if(bif_flag)
11682         do_label(bif_fd,"Re-reader Report",bif_row++,bif_column);
11683     if(!silent) printf("\n%cRe-Reader report%c\n",'"','"');
11684     dump_report(5); 
11685     }
11686 
11687     if ((!include_tflag) || (include_mask & (long long)RANDOM_RW_MASK)) {
11688         if(bif_flag)
11689             do_label(bif_fd,"Random Read Report",bif_row++,bif_column);
11690         if(!silent) printf("\n%cRandom read report%c\n",'"','"');
11691         dump_report(6); 
11692         if(bif_flag)
11693             do_label(bif_fd,"Random Write Report",bif_row++,bif_column);
11694         if(!silent) printf("\n%cRandom write report%c\n",'"','"');
11695         dump_report(7); 
11696     }
11697 
11698     if ((!include_tflag) || (include_mask & (long long)REVERSE_MASK)) {
11699         if(bif_flag)
11700             do_label(bif_fd,"Backward Read Report",bif_row++,bif_column);
11701         if(!silent) printf("\n%cBackward read report%c\n",'"','"');
11702         dump_report(8); 
11703     }
11704 
11705     if ((!include_tflag) || (include_mask & (long long)REWRITE_REC_MASK)) {
11706         if(bif_flag)
11707             do_label(bif_fd,"Record Rewrite Report",bif_row++,bif_column);
11708         if(!silent) printf("\n%cRecord rewrite report%c\n",'"','"');
11709         dump_report(9); 
11710     }
11711 
11712     if ((!include_tflag) || (include_mask & (long long)STRIDE_READ_MASK)) {
11713         if(bif_flag)
11714             do_label(bif_fd,"Stride Read Report",bif_row++,bif_column);
11715         if(!silent) printf("\n%cStride read report%c\n",'"','"');
11716         dump_report(10); 
11717     }
11718 
11719     if ((!include_tflag) || (include_mask & (long long)FWRITER_MASK)) {
11720         if(bif_flag)
11721             do_label(bif_fd,"Fwrite Report",bif_row++,bif_column);
11722         if(!silent) printf("\n%cFwrite report%c\n",'"','"');
11723         dump_report(11); 
11724         if(bif_flag)
11725             do_label(bif_fd,"Re-fwrite Report",bif_row++,bif_column);
11726         if(!silent) printf("\n%cRe-Fwrite report%c\n",'"','"');
11727         dump_report(12); 
11728     }
11729 
11730     if ((!include_tflag) || (include_mask & (long long)FREADER_MASK)) {
11731         if(bif_flag)
11732             do_label(bif_fd,"Fread Report",bif_row++,bif_column);
11733         if(!silent) printf("\n%cFread report%c\n",'"','"');
11734         dump_report(13); 
11735         if(bif_flag)
11736             do_label(bif_fd,"Re-fread Report",bif_row++,bif_column);
11737         if(!silent) printf("\n%cRe-Fread report%c\n",'"','"');
11738         dump_report(14); 
11739     }
11740 
11741 #ifdef HAVE_PREAD
11742     if(Eflag)
11743     {
11744         if ((!include_tflag) || (include_mask & (long long)PWRITER_MASK)) {
11745             if(bif_flag)
11746                 do_label(bif_fd,"Pwrite Report",bif_row++,bif_column);
11747             if(!silent) printf("\n%cPwrite report%c\n",'"','"');
11748             dump_report(15); 
11749             if(bif_flag)
11750                 do_label(bif_fd,"Re-pwrite Report",bif_row++,bif_column);
11751             if(!silent) printf("\n%cRe-Pwrite report%c\n",'"','"');
11752             dump_report(16); 
11753         }
11754 
11755         if ((!include_tflag) || (include_mask & (long long)PREADER_MASK)) {
11756             if(bif_flag)
11757                 do_label(bif_fd,"Pread Report",bif_row++,bif_column);
11758             if(!silent) printf("\n%cPread report%c\n",'"','"');
11759             dump_report(17); 
11760             if(bif_flag)
11761                 do_label(bif_fd,"Re-pread Report",bif_row++,bif_column);
11762             if(!silent) printf("\n%cRe-Pread report%c\n",'"','"');
11763             dump_report(18); 
11764         }
11765 
11766 #ifdef HAVE_PREADV
11767         if ((!include_tflag) || (include_mask & (long long)PWRITEV_MASK)) {
11768             if(bif_flag)
11769                 do_label(bif_fd,"Pwritev Report",bif_row++,bif_column);
11770             if(!silent) printf("\n%cPwritev report%c\n",'"','"');
11771             dump_report(19); 
11772             if(bif_flag)
11773                 do_label(bif_fd,"Re-pwritev Report",bif_row++,bif_column);
11774             if(!silent) printf("\n%cRe-Pwritev report%c\n",'"','"');
11775             dump_report(20); 
11776         }
11777 
11778         if ((!include_tflag) || (include_mask & (long long)PREADV_MASK)) {
11779             if(bif_flag)
11780                 do_label(bif_fd,"Preadv Report",bif_row++,bif_column);
11781             if(!silent) printf("\n%cPreadv report%c\n",'"','"');
11782             dump_report(21); 
11783             if(bif_flag)
11784                 do_label(bif_fd,"Re-preadv Report",bif_row++,bif_column);
11785             if(!silent) printf("\n%cRe-Preadv report%c\n",'"','"');
11786             dump_report(22); 
11787         }
11788 #endif
11789     }
11790 #endif
11791     if (cpuutilflag)
11792         dump_cputimes();
11793     if(bif_flag)
11794         close_xls(bif_fd);
11795 }

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_hist ( char *  what,
int  id 
)

Definition at line 24284 of file iozone.c.

24285 {
24286    FILE *fp;
24287 
24288    char name[256];
24289  
24290    sprintf(name,"%s_child_%d.txt","Iozone_histogram",id);
24291 
24292    fp = fopen(name,"a");
24293 
24294 #ifndef NO_PRINT_LLD
24295    fprintf(fp,"Child: %d Op: %s\n",id,what);
24296    fprintf(fp,"Band 1:   ");
24297    fprintf(fp," 20us:%-7.1lld ",buckets[0]);
24298    fprintf(fp," 40us:%-7.1lld ",buckets[1]);
24299    fprintf(fp," 60us:%-7.1lld ",buckets[2]);
24300    fprintf(fp," 80us:%-7.1lld ",buckets[3]);
24301    fprintf(fp,"100us:%-7.1lld \n",buckets[4]);
24302 
24303    fprintf(fp,"Band 2:   ");
24304    fprintf(fp,"200us:%-7.1lld ",buckets[5]);
24305    fprintf(fp,"400us:%-7.1lld ",buckets[6]);
24306    fprintf(fp,"600us:%-7.1lld ",buckets[7]);
24307    fprintf(fp,"800us:%-7.1lld ",buckets[8]);
24308    fprintf(fp,"  1ms:%-7.1lld \n",buckets[9]);
24309 
24310    fprintf(fp,"Band 3:   ");
24311    fprintf(fp,"  2ms:%-7.1lld ",buckets[10]);
24312    fprintf(fp,"  4ms:%-7.1lld ",buckets[11]);
24313    fprintf(fp,"  6ms:%-7.1lld ",buckets[12]);
24314    fprintf(fp,"  8ms:%-7.1lld ",buckets[13]);
24315    fprintf(fp," 10ms:%-7.1lld \n",buckets[14]);
24316 
24317    fprintf(fp,"Band 4:   ");
24318    fprintf(fp," 12ms:%-7.1lld ",buckets[15]);
24319    fprintf(fp," 14ms:%-7.1lld ",buckets[16]);
24320    fprintf(fp," 16ms:%-7.1lld ",buckets[17]);
24321    fprintf(fp," 18ms:%-7.1lld ",buckets[18]);
24322    fprintf(fp," 20ms:%-7.1lld \n",buckets[19]);
24323 
24324    fprintf(fp,"Band 5:   ");
24325    fprintf(fp," 40ms:%-7.1lld ",buckets[20]);
24326    fprintf(fp," 60ms:%-7.1lld ",buckets[21]);
24327    fprintf(fp," 80ms:%-7.1lld ",buckets[22]);
24328    fprintf(fp,"100ms:%-7.1lld \n",buckets[23]);
24329 
24330    fprintf(fp,"Band 6:   ");
24331    fprintf(fp,"200ms:%-7.1lld ",buckets[24]);
24332    fprintf(fp,"400ms:%-7.1lld ",buckets[25]);
24333    fprintf(fp,"600ms:%-7.1lld ",buckets[26]);
24334    fprintf(fp,"800ms:%-7.1lld ",buckets[27]);
24335    fprintf(fp,"   1s:%-7.1lld \n",buckets[28]);
24336 
24337    fprintf(fp,"Band 7:   ");
24338    fprintf(fp,"   2s:%-7.1lld ",buckets[29]);
24339    fprintf(fp,"   4s:%-7.1lld ",buckets[30]);
24340    fprintf(fp,"   6s:%-7.1lld ",buckets[31]);
24341    fprintf(fp,"   8s:%-7.1lld ",buckets[32]);
24342    fprintf(fp,"  10s:%-7.1lld \n",buckets[33]);
24343 
24344    fprintf(fp,"Band 8:   ");
24345    fprintf(fp,"  20s:%-7.1lld ",buckets[34]);
24346    fprintf(fp,"  40s:%-7.1lld ",buckets[35]);
24347    fprintf(fp,"  60s:%-7.1lld ",buckets[36]);
24348    fprintf(fp,"  80s:%-7.1lld ",buckets[37]);
24349    fprintf(fp," 120s:%-7.1lld \n",buckets[38]);
24350 
24351    fprintf(fp,"Band 9:   ");
24352    fprintf(fp,"120+s:%-7.1lld \n\n",buckets[39]);
24353 #else
24354    fprintf(fp,"Child: %d Op: %s\n",id,what);
24355    fprintf(fp,"Band 1:   ");
24356    fprintf(fp," 20us:%-7.1ld ",buckets[0]);
24357    fprintf(fp," 40us:%-7.1ld ",buckets[1]);
24358    fprintf(fp," 60us:%-7.1ld ",buckets[2]);
24359    fprintf(fp," 80us:%-7.1ld ",buckets[3]);
24360    fprintf(fp,"100us:%-7.1ld \n",buckets[4]);
24361 
24362    fprintf(fp,"Band 2:   ");
24363    fprintf(fp,"200us:%-7.1ld ",buckets[5]);
24364    fprintf(fp,"400us:%-7.1ld ",buckets[6]);
24365    fprintf(fp,"600us:%-7.1ld ",buckets[7]);
24366    fprintf(fp,"800us:%-7.1ld ",buckets[8]);
24367    fprintf(fp,"  1ms:%-7.1ld \n",buckets[9]);
24368 
24369    fprintf(fp,"Band 3:   ");
24370    fprintf(fp,"  2ms:%-7.1ld ",buckets[10]);
24371    fprintf(fp,"  4ms:%-7.1ld ",buckets[11]);
24372    fprintf(fp,"  6ms:%-7.1ld ",buckets[12]);
24373    fprintf(fp,"  8ms:%-7.1ld ",buckets[13]);
24374    fprintf(fp," 10ms:%-7.1ld \n",buckets[14]);
24375 
24376    fprintf(fp,"Band 4:   ");
24377    fprintf(fp," 12ms:%-7.1ld ",buckets[15]);
24378    fprintf(fp," 14ms:%-7.1ld ",buckets[16]);
24379    fprintf(fp," 16ms:%-7.1ld ",buckets[17]);
24380    fprintf(fp," 18ms:%-7.1ld ",buckets[18]);
24381    fprintf(fp," 20ms:%-7.1ld \n",buckets[19]);
24382 
24383    fprintf(fp,"Band 5:   ");
24384    fprintf(fp," 40ms:%-7.1ld ",buckets[20]);
24385    fprintf(fp," 60ms:%-7.1ld ",buckets[21]);
24386    fprintf(fp," 80ms:%-7.1ld ",buckets[22]);
24387    fprintf(fp,"100ms:%-7.1ld \n",buckets[23]);
24388 
24389    fprintf(fp,"Band 6:   ");
24390    fprintf(fp,"200ms:%-7.1ld ",buckets[24]);
24391    fprintf(fp,"400ms:%-7.1ld ",buckets[25]);
24392    fprintf(fp,"600ms:%-7.1ld ",buckets[26]);
24393    fprintf(fp,"800ms:%-7.1ld ",buckets[27]);
24394    fprintf(fp,"   1s:%-7.1ld \n",buckets[28]);
24395 
24396    fprintf(fp,"Band 7:   ");
24397    fprintf(fp,"   2s:%-7.1ld ",buckets[29]);
24398    fprintf(fp,"   4s:%-7.1ld ",buckets[30]);
24399    fprintf(fp,"   6s:%-7.1ld ",buckets[31]);
24400    fprintf(fp,"   8s:%-7.1ld ",buckets[32]);
24401    fprintf(fp,"  10s:%-7.1ld \n",buckets[33]);
24402 
24403    fprintf(fp,"Band 8:   ");
24404    fprintf(fp,"  20s:%-7.1ld ",buckets[34]);
24405    fprintf(fp,"  40s:%-7.1ld ",buckets[35]);
24406    fprintf(fp,"  60s:%-7.1ld ",buckets[36]);
24407    fprintf(fp,"  80s:%-7.1ld ",buckets[37]);
24408    fprintf(fp," 120s:%-7.1ld \n",buckets[38]);
24409 
24410    fprintf(fp,"Band 9:   ");
24411    fprintf(fp,"120+s:%-7.1ld \n\n",buckets[39]);
24412 #endif
24413    fclose(fp);
24414 }

void dump_hist (  ) 

Here is the caller graph for this function:

dump_report ( long long  who  ) 

Definition at line 11567 of file iozone.c.

11570 {
11571     long long i;
11572     off64_t current_file_size;
11573     off64_t rec_size;
11574 
11575     if(bif_flag)
11576         bif_column++;
11577     if(!silent) printf("      ");
11578 
11579     /* 
11580      * Need to reconstruct the record size list
11581      * as the crossover in -a changed the list.
11582     */
11583     del_record_sizes();
11584     init_record_sizes(orig_min_rec_size, orig_max_rec_size);
11585 
11586     for(rec_size=get_next_record_size(0); rec_size <= orig_max_rec_size;
11587         rec_size=get_next_record_size(rec_size))
11588     {
11589         if (rec_size == 0) break;
11590         if(bif_flag)
11591             do_float(bif_fd,(double)(rec_size/1024),bif_row,bif_column++);
11592 #ifdef NO_PRINT_LLD
11593         if(!silent) printf("  %c%ld%c",'"',rec_size/1024,'"');
11594 #else
11595         if(!silent) printf("  %c%lld%c",'"',rec_size/1024,'"');
11596 #endif
11597     }
11598     if(!silent) printf("\n");
11599     if(bif_flag)
11600     {
11601         bif_column=0;
11602         bif_row++;
11603     }
11604 
11605     current_file_size = report_array[0][0];
11606     if(bif_flag)
11607     {
11608         do_float(bif_fd,(double)(current_file_size),bif_row,bif_column++);
11609     }
11610 #ifdef NO_PRINT_LLD
11611     if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
11612 #else
11613     if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
11614 #endif
11615     for(i=0;i<=max_y;i++){
11616         if(report_array[0][i] != current_file_size){
11617             if(!silent) printf("\n");
11618             current_file_size = report_array[0][i];
11619             if(bif_flag)
11620             {
11621                 bif_row++;
11622                 bif_column=0;
11623                 do_float(bif_fd,(double)(current_file_size),bif_row,bif_column++);
11624             }
11625 #ifdef NO_PRINT_LLD
11626             if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
11627 #else
11628             if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
11629 #endif
11630         }
11631         if(bif_flag)
11632             do_float(bif_fd,(double)(report_array[who][i]),bif_row,bif_column++);
11633 #ifdef NO_PRINT_LLD
11634         if(!silent) printf(" %ld ",report_array[who][i]);
11635 #else
11636         if(!silent) printf(" %lld ",report_array[who][i]);
11637 #endif
11638     }
11639     if(bif_flag)
11640     {
11641         bif_row++;
11642         bif_column=0;
11643     }
11644     if(!silent) printf("\n");
11645 }

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_throughput (  ) 

Definition at line 18694 of file iozone.c.

18696 {
18697     long long x,y,i,j;
18698     char *port;
18699     char *label;
18700     char print_str[300];
18701     x=max_x;
18702     y=max_y;
18703 
18704     if(use_thread)
18705         port="threads";
18706     else
18707         port="processes";
18708     if(!silent) printf("\n\"Throughput report Y-axis is type of test X-axis is number of %s\"\n",port);
18709     if(bif_flag)
18710     {
18711         bif_fd=create_xls(bif_filename);
18712         do_label(bif_fd,command_line,bif_row++,bif_column);
18713         sprintf(print_str,"Throughput report Y-axis is type of test X-axis is number of %s",port);
18714         do_label(bif_fd,print_str,bif_row++,bif_column);
18715     }
18716     if(OPS_flag)
18717         label="ops/sec";
18718     else
18719     if(MS_flag)
18720         label="microseconds/op";
18721     else
18722         label="Kbytes/sec";
18723 #ifdef NO_PRINT_LLD
18724     if(!silent) printf("\"Record size = %ld Kbytes \"\n",reclen/1024);
18725 #else
18726     if(!silent) printf("\"Record size = %lld Kbytes \"\n",reclen/1024);
18727 #endif
18728     if(!silent) printf("\"Output is in %s\"\n\n",label);
18729     if(bif_flag)
18730     {
18731 #ifdef NO_PRINT_LLD
18732         sprintf(print_str,"Record size = %ld Kbytes",reclen/1024);
18733 #else
18734         sprintf(print_str,"Record size = %lld Kbytes",reclen/1024);
18735 #endif
18736         do_label(bif_fd,print_str,bif_row++,bif_column);
18737         sprintf(print_str,"Output is in %s",label);
18738         do_label(bif_fd,print_str,bif_row++,bif_column);
18739     }
18740     for(i=0;i<=toutputindex;i++)
18741     {
18742            if(!silent) printf("\"%15s \"",toutput[i]);
18743            if(bif_flag)
18744            {
18745                sprintf(print_str,"%15s ",toutput[i]);
18746                do_label(bif_fd,print_str,bif_row,bif_column++);
18747                bif_column++;
18748            }
18749            for(j=0;j<=y;j++)
18750            {
18751                if(bif_flag)
18752                {
18753                    do_float(bif_fd,(double)report_darray[i][j],bif_row,bif_column++);
18754                }
18755                if(!silent) printf(" %10.2f ",report_darray[i][j]);
18756            }
18757            if(!silent) printf("\n\n");
18758            if(bif_flag)
18759            {
18760                bif_column=0;
18761                bif_row++;
18762            }
18763     }
18764     if (cpuutilflag)
18765         dump_throughput_cpu();
18766     if(bif_flag)
18767         close_xls(bif_fd);
18768 }

Here is the call graph for this function:

Here is the caller graph for this function:

void dump_throughput_cpu (  ) 

Definition at line 18625 of file iozone.c.

18627 {
18628     long long x,y,i,j;
18629     char *port;
18630     char *label;
18631     char print_str[300];
18632     x=max_x;
18633     y=max_y;
18634 
18635     port = use_thread ? "threads" : "processes";
18636     printf("\n\"CPU utilization report Y-axis is type of test X-axis is number of %s\"\n",port);
18637     if (bif_flag)
18638     {
18639         sprintf(print_str, "CPU utilization report Y-axis is type of test X-axis is number of %s", port);
18640         do_label(bif_fd, print_str, bif_row++, bif_column);
18641     }
18642     label = OPS_flag ?  "ops/sec" :
18643         MS_flag ? "microseconds/op" : "Kbytes/sec";
18644 #ifdef NO_PRINT_LLD
18645     if(!silent) printf("\"Record size = %ld Kbytes \"\n", reclen/1024);
18646 #else
18647     if(!silent) printf("\"Record size = %lld Kbytes \"\n", reclen/1024);
18648 #endif
18649     if(!silent) printf("\"Output is in CPU%%\"\n\n");
18650     if (bif_flag)
18651     {
18652 #ifdef NO_PRINT_LLD
18653         sprintf(print_str, "Record size = %ld Kbytes", reclen/1024);
18654 #else
18655         sprintf(print_str, "Record size = %lld Kbytes", reclen/1024);
18656 #endif
18657         do_label(bif_fd, print_str, bif_row++, bif_column);
18658         sprintf(print_str, "Output is in CPU%%");
18659         do_label(bif_fd, print_str, bif_row++, bif_column);
18660     }
18661     for (i = 0; i < x; i++)
18662     {
18663         if(!silent) printf("\"%15s \"", throughput_tests[i]);
18664         if (bif_flag)
18665         {
18666             sprintf(print_str, "%15s ", throughput_tests[i]);
18667             do_label(bif_fd, print_str, bif_row, bif_column++);
18668             bif_column++;
18669         }
18670         for (j = 0; j <= y; j++)
18671         {
18672             if (bif_flag)
18673                 do_float(bif_fd, runtimes[i][j].cpuutil, bif_row, bif_column++);
18674             if(!silent) printf(" %10.2f ", runtimes[i][j].cpuutil);
18675         }
18676         if(!silent) printf("\n\n");
18677         if (bif_flag)
18678         {
18679             bif_column=0;
18680             bif_row++;
18681         }
18682     }
18683 }

Here is the call graph for this function:

Here is the caller graph for this function:

dump_times ( long long  who  ) 

Definition at line 11804 of file iozone.c.

11807 {
11808     long long i;
11809     off64_t current_file_size;
11810     off64_t rec_size;
11811 
11812     if (bif_flag)
11813         bif_column++;
11814     if(!silent) printf("      ");
11815 
11816     for (rec_size = get_next_record_size(0); rec_size <= orig_max_rec_size;
11817         rec_size = get_next_record_size(rec_size))
11818     {
11819         if (rec_size == 0) break;
11820         if (bif_flag)
11821             do_float(bif_fd, (double)(rec_size/1024), bif_row, bif_column++);
11822 #ifdef NO_PRINT_LLD
11823         if(!silent) printf("  %c%ld%c",'"',rec_size/1024,'"');
11824 #else
11825         if(!silent) printf("  %c%lld%c",'"',rec_size/1024,'"');
11826 #endif
11827     }
11828     if(!silent) printf("\n");
11829     if (bif_flag)
11830     {
11831         bif_column=0;
11832         bif_row++;
11833     }
11834 
11835     current_file_size = report_array[0][0];
11836     if (bif_flag)
11837     {
11838         do_float(bif_fd, (double)(current_file_size), bif_row, bif_column++);
11839     }
11840 #ifdef NO_PRINT_LLD
11841     if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
11842 #else
11843     if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
11844 #endif
11845     for (i = 0; i <= max_y; i++) {
11846         if (report_array[0][i] != current_file_size) {
11847             if(!silent) printf("\n");
11848             current_file_size = report_array[0][i];
11849             if (bif_flag)
11850             {
11851                 bif_row++;
11852                 bif_column=0;
11853                 do_float(bif_fd, (double)(current_file_size), bif_row, bif_column++);
11854             }
11855 #ifdef NO_PRINT_LLD
11856             if(!silent) printf("%c%ld%c  ",'"',current_file_size,'"');
11857 #else
11858             if(!silent) printf("%c%lld%c  ",'"',current_file_size,'"');
11859 #endif
11860         }
11861         if (bif_flag)
11862             do_float(bif_fd, (double)(runtimes [who][i].cpuutil), bif_row, bif_column++);
11863         if(!silent) printf(" %6.2f", runtimes [who][i].cpuutil);
11864     }
11865     if(!silent) printf("\n");
11866     if (bif_flag)
11867     {
11868         bif_row++;
11869         bif_column=0;
11870     }
11871 }

Here is the call graph for this function:

Here is the caller graph for this function:

void exit (  ) 
void fetchit ( char *  buffer,
long long  length 
)

Definition at line 6909 of file iozone.c.

06913 {
06914     char *where;
06915     volatile long long x[4];
06916     long long i;
06917     where=(char *)buffer;
06918     for(i=0;i<(length/cache_line_size);i++)
06919     {
06920         x[(i & 3)]=*(where);
06921         where+=cache_line_size;
06922         
06923     }
06924 }

void fetchit (  ) 

Here is the caller graph for this function:

fill_area ( long long *  src_buffer,
long long *  dest_buffer,
long long  length 
)

Definition at line 19014 of file iozone.c.

19019 {
19020     /*printf("Fill area %d\n",(size_t)length);*/
19021     bcopy((void *)src_buffer,(void *)dest_buffer,(size_t)length);
19022 }

Here is the caller graph for this function:

void fill_buffer ( char *  buffer,
long long  length,
long long  pattern,
char  sverify,
long long  recnum 
)

Definition at line 7115 of file iozone.c.

07122 {
07123     unsigned long long *where;
07124     long long i,j,xx2;
07125     long long mpattern;
07126     unsigned int seed;
07127     unsigned long x;
07128     unsigned long long value,value1;
07129     unsigned long long a = 0x01020304;
07130     unsigned long long b = 0x05060708;
07131     unsigned long long c = 0x01010101;
07132     unsigned long long d = 0x01010101;
07133 
07134     value = (a << 32) | b;
07135     value1 = (c << 32) | d;
07136 
07137     xx2=chid;
07138     if(share_file)
07139         xx2=(long long)0;
07140     x=0;
07141     mpattern=pattern;
07142     /* printf("Fill: Sverify %d verify %d diag_v %d\n",sverify,verify,diag_v);*/
07143     if(dedup)
07144     {
07145         gen_new_buf((char *)dedup_ibuf,(char *)buffer, (long)recnum, (int)length,(int)dedup, (int) dedup_interior, dedup_compress, 1);
07146         return;
07147     }
07148     if(diag_v)
07149     {
07150         /*if(client_iozone)
07151             base_time=0;
07152         */
07153         if(no_unlink)
07154             base_time=0;
07155         seed= (unsigned int)(base_time+xx2+recnum);
07156             srand(seed);
07157         mpattern=(long long)rand();
07158         mpattern=(mpattern<<48) | (mpattern<<32) | (mpattern<<16) | mpattern;
07159         mpattern=mpattern+value;
07160     }
07161     where=(unsigned long long *)buffer;
07162     if(sverify == 1)
07163     {
07164         for(i=0;i<(length);i+=page_size)
07165         {
07166             *where = (long long)((pattern<<32) | pattern);
07167             where+=(page_size/sizeof(long long)); 
07168             /* printf("Filling page %lld \n",i/page_size);*/
07169         }   
07170     }
07171     else
07172     {
07173         for(i=0;i<(length/cache_line_size);i++)
07174         {
07175             for(j=0;j<(cache_line_size/sizeof(long long));j++)
07176             {
07177                 if(diag_v)
07178                 {
07179                     *where = (long long)(mpattern);
07180                     mpattern=mpattern+value1;
07181                 }
07182                 else
07183                     *where = (long long)((pattern<<32) | pattern);
07184                 where++;
07185             }   
07186         }
07187     }
07188 }

Here is the call graph for this function:

void fill_buffer (  ) 

Here is the caller graph for this function:

void find_external_mon ( char *  imon_start,
char*  imon_stop 
)

Definition at line 22729 of file iozone.c.

22732 {
22733     char *start,*stop,*sync;
22734     imon_start[0]=(char)0;
22735     imon_stop[0]=(char)0;
22736     start=(char *)getenv("IMON_START");
22737     if(start)
22738     {
22739         strcpy(imon_start,start);
22740     }
22741     stop=(char *)getenv("IMON_STOP");
22742     if(stop)
22743     {
22744         strcpy(imon_stop,stop);
22745     }
22746     sync=(char *)getenv("IMON_SYNC");
22747     if(sync)
22748     {
22749         imon_sync=1;
22750     }
22751 
22752     return;
22753 }   

Here is the call graph for this function:

Here is the caller graph for this function:

void find_remote_shell ( char *  shell  ) 

Definition at line 22706 of file iozone.c.

22709 {
22710     char *value;
22711     value=(char *)getenv("RSH");
22712     if(value)
22713     {
22714         strcpy(shell,value);
22715         return;
22716     }
22717 #ifdef _HPUX_SOURCE
22718     strcpy(shell,"remsh");
22719 #else
22720     strcpy(shell,"rsh");
22721 #endif
22722     return;
22723 }   

Here is the call graph for this function:

void find_remote_shell (  ) 

Here is the caller graph for this function:

void fread_perf_test ( off64_t  kilo64,
long long  reclen,
long long *  data1,
long long*  data2 
)

Definition at line 8083 of file iozone.c.

08088 {
08089     double starttime2;
08090     double readtime[2];
08091     double walltime[2], cputime[2];
08092     double compute_val = (double)0;
08093     long long j;
08094     off64_t i,numrecs64;
08095     long long Index = 0;
08096     unsigned long long readrate[2];
08097     off64_t filebytes64;
08098     FILE *stream = 0;
08099     char *stdio_buf;
08100     int fd,ltest;
08101 
08102     if(mmapflag || async_flag)
08103         return;
08104     numrecs64 = (kilo64*1024)/reclen;
08105     filebytes64 = numrecs64*reclen;
08106     stdio_buf=(char *)malloc((size_t)reclen);
08107 
08108     if(noretest)
08109         ltest=1;
08110     else
08111         ltest=2;
08112 
08113     for( j=0; j<ltest; j++ )
08114     {
08115         if(cpuutilflag)
08116         {
08117             walltime[j] = time_so_far();
08118             cputime[j]  = cputime_so_far();
08119         }
08120 
08121         if(Uflag) /* Unmount and re-mount the mountpoint */
08122         {
08123             purge_buffer_cache();
08124         }
08125 #ifdef IRIX64
08126         if((stream=(FILE *)fopen(filename,"r")) == 0)
08127         {
08128             printf("\nCan not fdopen temp file: %s\n", 
08129                 filename);
08130             perror("fdopen");
08131             exit(51);
08132         }
08133 #else
08134         if((stream=(FILE *)I_FOPEN(filename,"r")) == 0)
08135         {
08136             printf("\nCan not fdopen temp file: %s\n", 
08137                 filename);
08138             perror("fdopen");
08139             exit(52);
08140         }
08141 #endif
08142         fd=I_OPEN(filename,O_RDONLY,0);
08143         fsync(fd);
08144         close(fd);
08145         setvbuf(stream,stdio_buf,_IOFBF,reclen);
08146         buffer=mainbuffer;
08147         if(fetchon)
08148             fetchit(buffer,reclen);
08149         compute_val=(double)0;
08150         starttime2 = time_so_far();
08151         for(i=0; i<numrecs64; i++) 
08152         {
08153             if(compute_flag)
08154                 compute_val+=do_compute(compute_time);
08155                         if(multi_buffer)
08156                         {
08157                                 Index +=reclen;
08158                                 if(Index > (MAXBUFFERSIZE-reclen))
08159                                         Index=0;
08160                                 buffer = mbuffer + Index;
08161                         }
08162             if(purge)
08163                 purgeit(buffer,reclen);
08164             if(fread(buffer, (size_t) reclen,1, stream) != 1)
08165             {
08166 #ifdef _64BIT_ARCH_
08167 #ifdef NO_PRINT_LLD
08168                 printf("\nError freading block %lu %lx\n", i,
08169                     (unsigned long long)buffer);
08170 #else
08171                 printf("\nError freading block %llu %llx\n", i,
08172                     (unsigned long long)buffer);
08173 #endif
08174 #else
08175 #ifdef NO_PRINT_LLD
08176                 printf("\nError freading block %lu %lx\n", i,
08177                     (long)buffer);
08178 #else
08179                 printf("\nError freading block %llu %lx\n", i,
08180                     (long)buffer);
08181 #endif
08182 #endif
08183                 perror("read");
08184                 exit(54);
08185             }
08186             if(verify){
08187                 if(verify_buffer(buffer,reclen,(off64_t)i,reclen,(long long)pattern,sverify)){
08188                     exit(55);
08189                 }
08190             }
08191         }
08192         if(include_flush)
08193             fflush(stream);
08194         if(include_close)
08195         {
08196             fclose(stream);
08197         }
08198         readtime[j] = ((time_so_far() - starttime2)-time_res)
08199             -compute_val;
08200         if(readtime[j] < (double).000001) 
08201         {
08202             readtime[j]= time_res;
08203             if(rec_prob < reclen)
08204                 rec_prob = reclen;
08205             res_prob=1;
08206         }
08207         if(!include_close)
08208         {
08209             fflush(stream);
08210             fclose(stream);
08211         }
08212         stream = NULL;
08213         if(cpuutilflag)
08214         {
08215             cputime[j]  = cputime_so_far() - cputime[j];
08216             if (cputime[j] < cputime_res)
08217                 cputime[j] = 0.0;
08218             walltime[j] = time_so_far() - walltime[j];
08219             if (walltime[j] < cputime[j])
08220                walltime[j] = cputime[j];
08221         }
08222         if(restf)
08223             sleep((int)rest_val);
08224         }
08225     free(stdio_buf);
08226     if(OPS_flag || MS_flag){
08227        filebytes64=filebytes64/reclen;
08228     }
08229         for(j=0;j<ltest;j++)
08230         {
08231         if(MS_flag)
08232         {
08233             readrate[j]=1000000.0*(readtime[j] / (double)filebytes64);
08234             continue;
08235         }
08236             else
08237             {
08238                   readrate[j] = 
08239                   (unsigned long long) ((double) filebytes64 / readtime[j]);
08240             }
08241         if(!(OPS_flag || MS_flag))
08242             readrate[j] >>= 10;
08243     }
08244     data1[0]=readrate[0];
08245     data2[0]=1;
08246     if(noretest)
08247     {
08248         readrate[1]=(long long)0;
08249         if(cpuutilflag)
08250         {
08251             walltime[1]=0.0;
08252             cputime[1]=0.0;
08253         }
08254     }
08255     /* Must save walltime & cputime before calling store_value() for each/any cell.*/
08256     if(cpuutilflag)
08257         store_times(walltime[0], cputime[0]);
08258     store_value((off64_t)readrate[0]);
08259     if(cpuutilflag)
08260         store_times(walltime[1], cputime[1]);
08261     store_value((off64_t)readrate[1]);
08262 #ifdef NO_PRINT_LLD
08263     if(!silent) printf("%8ld",readrate[0]);
08264     if(!silent) printf("%9ld",readrate[1]);
08265     if(!silent) fflush(stdout);
08266 #else
08267     if(!silent) printf("%8lld",readrate[0]);
08268     if(!silent) printf("%9lld",readrate[1]);
08269     if(!silent) fflush(stdout);
08270 #endif
08271 }

Here is the call graph for this function:

void fread_perf_test (  ) 
int fsync (  ) 

Here is the caller graph for this function:

void fwrite_perf_test ( off64_t  kilo64,
long long  reclen,
long long *  data1,
long long *  data2 
)

Definition at line 7859 of file iozone.c.

07865 {
07866     double starttime1;
07867     double writetime[2];
07868     double walltime[2], cputime[2];
07869     double compute_val = (double)0;
07870     long long i,j;
07871     off64_t numrecs64;
07872     long long Index = 0;
07873     unsigned long long writerate[2];
07874     off64_t filebytes64;
07875     FILE *stream = NULL;
07876     int fd;
07877     int wval;
07878     int ltest;
07879     char *how;
07880     char *stdio_buf;
07881 
07882     if(mmapflag || async_flag)
07883         return;
07884     numrecs64 = (kilo64*1024)/reclen;
07885     filebytes64 = numrecs64*reclen;
07886     stdio_buf=(char *)malloc((size_t)reclen);
07887     if(noretest)
07888         ltest=1;
07889     else
07890         ltest=2;
07891 
07892     for( j=0; j<ltest; j++)
07893     {
07894         if(cpuutilflag)
07895         {
07896             walltime[j] = time_so_far();
07897             cputime[j]  = cputime_so_far();
07898         }
07899         if(Uflag) /* Unmount and re-mount the mountpoint */
07900         {
07901             purge_buffer_cache();
07902         }
07903         if(j==0)
07904         {
07905             if(check_filename(filename))
07906                 how="r+"; /* file exists, don't create and zero a new one. */
07907             else
07908                 how="w+"; /* file doesn't exist. create it. */
07909         }
07910         else
07911             how="r+"; /* re-tests should error out if file does not exist. */
07912 #ifdef IRIX64
07913         if((stream=(FILE *)fopen(filename,how)) == 0)
07914         {
07915             printf("\nCan not fdopen temp file: %s %lld\n", 
07916                 filename,errno);
07917             perror("fdopen");
07918             exit(48);
07919         }
07920 #else
07921         if((stream=(FILE *)I_FOPEN(filename,how)) == 0)
07922         {
07923 #ifdef NO_PRINT_LLD
07924             printf("\nCan not fdopen temp file: %s %d\n", 
07925                 filename,errno);
07926 #else
07927             printf("\nCan not fdopen temp file: %s %d\n", 
07928                 filename,errno);
07929 #endif
07930             perror("fdopen");
07931             exit(49);
07932         }
07933 #endif
07934         fd=fileno(stream);
07935         fsync(fd);
07936         setvbuf(stream,stdio_buf,_IOFBF,reclen);
07937         buffer=mainbuffer;
07938         if(fetchon)
07939             fetchit(buffer,reclen);
07940         if(verify || dedup || dedup_interior)
07941             fill_buffer(buffer,reclen,(long long)pattern,sverify,(long long)0);
07942         starttime1 = time_so_far();
07943         compute_val=(double)0;
07944         for(i=0; i<numrecs64; i++){
07945             if(compute_flag)
07946                 compute_val+=do_compute(compute_time);
07947             if(multi_buffer)
07948             {
07949                 Index +=reclen;
07950                 if(Index > (MAXBUFFERSIZE-reclen))
07951                     Index=0;
07952                 buffer = mbuffer + Index;   
07953             }
07954             if((verify & diag_v) || dedup || dedup_interior)
07955                 fill_buffer(buffer,reclen,(long long)pattern,sverify,i);
07956             if(purge)
07957                 purgeit(buffer,reclen);
07958             if(fwrite(buffer, (size_t) reclen, 1, stream) != 1)
07959             {
07960 #ifdef NO_PRINT_LLD
07961                     printf("\nError fwriting block %ld, fd= %d\n", i,
07962                      fd);
07963 #else
07964                     printf("\nError fwriting block %lld, fd= %d\n", i,
07965                      fd);
07966 #endif
07967                 perror("fwrite");
07968                 signal_handler();
07969             }
07970         }
07971 
07972         if(include_flush)
07973         {
07974             fflush(stream);
07975             wval=fsync(fd);
07976             if(wval==-1){
07977                 perror("fsync");
07978                 signal_handler();
07979             }
07980         }
07981         if(include_close)
07982         {
07983             wval=fclose(stream);
07984             if(wval==-1){
07985                 perror("fclose");
07986                 signal_handler();
07987             }
07988         }
07989         writetime[j] = ((time_so_far() - starttime1)-time_res)
07990             -compute_val;
07991         if(writetime[j] < (double).000001) 
07992         {
07993             writetime[j]= time_res;
07994             if(rec_prob < reclen)
07995                 rec_prob = reclen;
07996             res_prob=1;
07997         }
07998         if(!include_close)
07999         {
08000             wval=fflush(stream);
08001             if(wval==-1){
08002                 perror("fflush");
08003                 signal_handler();
08004             }
08005             wval=fsync(fd);
08006             if(wval==-1){
08007                 perror("fsync");
08008                 signal_handler();
08009             }
08010             wval=fclose(stream);
08011             if(wval==-1){
08012                 perror("fclose");
08013                 signal_handler();
08014             }
08015         }
08016 
08017         if(cpuutilflag)
08018         {
08019             cputime[j]  = cputime_so_far() - cputime[j];
08020             if (cputime[j] < cputime_res)
08021                 cputime[j] = 0.0;
08022             walltime[j] = time_so_far() - walltime[j];
08023             if (walltime[j] < cputime[j])
08024                walltime[j] = cputime[j];
08025         }
08026         if(restf)
08027             sleep((int)(int)rest_val);
08028     }
08029     free(stdio_buf);
08030     if(OPS_flag || MS_flag){
08031        filebytes64=filebytes64/reclen;
08032     }
08033         for(j=0;j<ltest;j++)
08034         {
08035         if(MS_flag)
08036         {
08037             writerate[j]=1000000.0*(writetime[j] / (double)filebytes64);
08038             continue;
08039         }
08040             else
08041             {
08042                   writerate[j] = 
08043               (unsigned long long) ((double) filebytes64 / writetime[j]);
08044             }
08045         if(!(OPS_flag || MS_flag))
08046             writerate[j] >>= 10;
08047     }
08048     /* Must save walltime & cputime before calling store_value() for each/any cell.*/
08049     if(noretest)
08050     {
08051         writerate[1]=(long long)0;
08052         if(cpuutilflag)
08053         {
08054             walltime[1]=0.0;
08055             cputime[1]=0.0;
08056         }
08057     }
08058     if(cpuutilflag)
08059         store_times(walltime[0], cputime[0]);
08060     store_value((off64_t)writerate[0]);
08061     if(cpuutilflag)
08062         store_times(walltime[1], cputime[1]);
08063     store_value((off64_t)writerate[1]);
08064     data1[0]=writerate[0];
08065 #ifdef NO_PRINT_LLD
08066     if(!silent) printf("%9ld",writerate[0]);
08067     if(!silent) printf("%9ld",writerate[1]);
08068     if(!silent) fflush(stdout);
08069 #else
08070     if(!silent) printf("%9lld",writerate[0]);
08071     if(!silent) printf("%9lld",writerate[1]);
08072     if(!silent) fflush(stdout);
08073 #endif
08074 }

Here is the call graph for this function:

void fwrite_perf_test (  ) 
int gen_new_buf ( char *  ibuf,
char *  obuf,
long  seed,
int  size,
int  percent,
int  percent_interior,
int  percent_compress,
int  all 
)

Definition at line 23731 of file iozone.c.

23733 {
23734     register long *ip, *op; /* Register for speed   */
23735     register long iseed;    /* Register for speed   */
23736     register long isize;    /* Register for speed   */
23737     register long cseed;    /* seed for dedupable for within & ! across */
23738     register int x,w;   /* Register for speed   */
23739     register int value;     /* Register for speed   */
23740     register int interior_size;     /* size of interior dedup region */
23741     register int compress_size;     /* size of compression dedup region */
23742     if(ibuf == NULL)    /* no input buf     */
23743         return(-1);
23744     if(obuf == NULL)    /* no output buf    */
23745         return(-1);
23746     if((percent > 100) || (percent < 0)) /* percent check */
23747         return(-1);
23748     if(size == 0)       /* size check       */
23749         return(-1);
23750     srand(seed+1+(((int)numrecs64)*dedup_mseed)); /* set random seed */
23751     iseed = rand();     /* generate random value */
23752     isize = (size * percent)/100; /* percent that is dedupable */
23753     interior_size = ((isize * percent_interior)/100);/* /sizeof(long) */
23754     compress_size =((interior_size * percent_compress)/100);
23755     ip = (long *)ibuf;  /* pointer to input buf */
23756     op = (long *)obuf;  /* pointer to output buf */
23757     if(all == 0)        /* Special case for verify only */
23758         isize = sizeof(long);
23759     /* interior_size = dedup_within + dedup_across */
23760     for(w=0;w<interior_size;w+=sizeof(long))    
23761     {
23762         *op=0xdeadbeef+dedup_mseed;
23763         *ip=0xdeadbeef+dedup_mseed;
23764         op++;
23765         ip++;
23766     }   
23767     /* Prepare for dedup within but not across */
23768     w=interior_size - compress_size;
23769     op=(long *)&obuf[w];
23770     ip=(long *)&ibuf[w];
23771     srand(chid+1+dedup_mseed);            /* set randdom seed   */
23772     cseed = rand();     /* generate random value */
23773     for(w=(interior_size-compress_size);w<interior_size;w+=sizeof(long))    
23774     {
23775         *op=*ip ^ cseed; /* do the xor op */
23776         op++;
23777         ip++;
23778     }   
23779     /* isize = dedup across only */
23780     for(x=interior_size;x<isize;x+=sizeof(long))    /* tight loop for transformation */
23781     {
23782         *op=*ip ^ iseed; /* do the xor op */
23783         op++;
23784         ip++;
23785     }   
23786     if(all == 0)        /* Special case for verify only */
23787         return(0);
23788     /* make the rest of the buffer non-dedupable */
23789     if(100-percent > 0)
23790     {
23791         srand(1+seed+((chid+1)*(int)numrecs64)*dedup_mseed);
23792         value=rand();
23793 /* printf("Non-dedup value %x seed %x\n",value,seed);*/
23794         for( ; x<size;x+=sizeof(long))
23795             *op++=(*ip++)^value; /* randomize the remainder */
23796     }
23797     return(0);
23798 }

Here is the call graph for this function:

int gen_new_buf (  ) 

Here is the caller graph for this function:

long long genrand64_int63 ( void   ) 

Definition at line 23960 of file iozone.c.

23961 {
23962     return (long long)(genrand64_int64() >> 1);
23963 }

Here is the call graph for this function:

unsigned long long genrand64_int64 ( void   ) 

Definition at line 23922 of file iozone.c.

23923 {
23924     int i;
23925     unsigned long long x;
23926     static unsigned long long mag01[2]={0ULL, MATRIX_A};
23927 
23928     if (mti >= NN) { /* generate NN words at one time */
23929 
23930         /* if init_genrand64() has not been called, */
23931         /* a default initial seed is used     */
23932         if (mti == NN+1) 
23933             init_genrand64(5489ULL); 
23934 
23935         for (i=0;i<NN-MM;i++) {
23936             x = (mt[i]&UM)|(mt[i+1]&LM);
23937             mt[i] = mt[i+MM] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
23938         }
23939         for (;i<NN-1;i++) {
23940             x = (mt[i]&UM)|(mt[i+1]&LM);
23941             mt[i] = mt[i+(MM-NN)] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
23942         }
23943         x = (mt[NN-1]&UM)|(mt[0]&LM);
23944         mt[NN-1] = mt[MM-1] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
23945 
23946         mti = 0;
23947     }
23948   
23949     x = mt[mti++];
23950 
23951     x ^= (x >> 29) & 0x5555555555555555ULL;
23952     x ^= (x << 17) & 0x71D67FFFEDA60000ULL;
23953     x ^= (x << 37) & 0xFFF7EEE000000000ULL;
23954     x ^= (x >> 43);
23955 
23956     return x;
23957 }

Here is the call graph for this function:

Here is the caller graph for this function:

double genrand64_real1 ( void   ) 

Definition at line 23966 of file iozone.c.

23967 {
23968     return (genrand64_int64() >> 11) * (1.0/9007199254740991.0);
23969 }

Here is the call graph for this function:

double genrand64_real2 ( void   ) 

Definition at line 23972 of file iozone.c.

23973 {
23974     return (genrand64_int64() >> 11) * (1.0/9007199254740992.0);
23975 }

Here is the call graph for this function:

double genrand64_real3 ( void   ) 

Definition at line 23978 of file iozone.c.

23979 {
23980     return ((genrand64_int64() >> 12) + 0.5) * (1.0/4503599627370496.0);
23981 }

Here is the call graph for this function:

int get_client_info (  ) 

Definition at line 22417 of file iozone.c.

22419 {
22420     FILE *fd;
22421     char *ret1;
22422     int count;
22423     char buffer[200];
22424     count=0;
22425     fd=fopen(client_filename,"r");
22426     if(fd == (FILE *)NULL)
22427     {
22428         printf("Unable to open client file \"%s\"\n",
22429             client_filename);
22430         exit(176);
22431     }
22432     while(1)
22433     {
22434             if (count > MAXSTREAMS) {                                                                           
22435                   printf("Too many lines in client file - max of %d supported\n",
22436             MAXSTREAMS);
22437                   exit(7);
22438             }
22439         ret1=fgets(buffer,200,fd);
22440         if(ret1== (char *)NULL)
22441             break;
22442         count+=parse_client_line(buffer,count);
22443     }
22444     fclose(fd);
22445     return(count);
22446 }

Here is the call graph for this function:

Here is the caller graph for this function:

get_date ( char *  where  ) 

Definition at line 23556 of file iozone.c.

23559 {
23560     time_t t;
23561     char *value;
23562     t=time(0);
23563     value=(char *)ctime(&t);
23564     strcpy(where,value);
23565 }

void get_date (  ) 

Here is the caller graph for this function:

off64_t get_next_file_size ( off64_t  size  ) 

Definition at line 20070 of file iozone.c.

20073 {
20074     struct size_entry *size_listp;
20075     
20076     size_listp=size_list;
20077     
20078     for( ; size_listp ; size_listp=size_listp->next )
20079     {
20080         if(size_listp->size > size)
20081             return(size_listp->size);
20082     }
20083     return((off64_t)0);
20084 }

off64_t get_next_file_size (  ) 

Here is the caller graph for this function:

off64_t get_next_record_size ( off64_t  size  ) 

Definition at line 20193 of file iozone.c.

20196 {
20197     struct size_entry *size_listp;
20198     
20199     size_listp=rec_size_list;
20200     
20201     for( ; size_listp ; size_listp=size_listp->next )
20202     {
20203         if(size_listp->size > size)
20204             return(size_listp->size);
20205     }
20206     return((off64_t)0);
20207 }

off64_t get_next_record_size (  ) 

Here is the caller graph for this function:

get_pattern ( void   ) 

Definition at line 23584 of file iozone.c.

23586 {
23587         int i,x,y;
23588         char cp[100],*ptr;
23589         int pat;
23590     unsigned char inp_pat;
23591     unsigned int temp;
23592 
23593         y=0;
23594         ptr=&cp[0];
23595         strcpy(cp,THISVERSION);
23596         x=strlen(THISVERSION);
23597         for(i=0;i<x;i++)
23598                 y+=*ptr++;
23599         srand(y);
23600         pat=(rand()& 0xff);
23601     /* For compatibility with old 0xa5 data sets. */
23602     if(Z_flag)
23603         pat=0xa5;
23604     /* Lock pattern to 0xBB, for filesystem short circuit debug */
23605     if(X_flag)
23606         pat=PATTERN1;
23607     /* Set global pattern */
23608     inp_pat = pat;
23609     temp =((inp_pat << 24) | (inp_pat << 16) | (inp_pat << 8) | inp_pat);
23610         return(pat);
23611 }

Here is the call graph for this function:

void get_resolution (  ) 

Definition at line 19131 of file iozone.c.

19133 {
19134         double starttime, finishtime, besttime = 0;
19135         long  j,delay;
19136     int k;
19137 
19138         finishtime=time_so_far1(); /* Warm up the instruction cache */
19139         starttime=time_so_far1();  /* Warm up the instruction cache */
19140         delay=j=0;                 /* Warm up the data cache */
19141     for(k=0;k<10;k++)
19142     {
19143             while(1)
19144             {
19145                     starttime=time_so_far1();
19146                     for(j=0;j< delay;j++)
19147                         ;
19148                     finishtime=time_so_far1();
19149                     if(starttime==finishtime)
19150                             delay++;
19151                     else
19152             {
19153                 if(k==0)
19154                     besttime=(finishtime-starttime);
19155                 if((finishtime-starttime) < besttime)
19156                     besttime=(finishtime-starttime);
19157                             break;
19158             }
19159         }
19160         }
19161     time_res=besttime/1000000.0;    
19162 }

Here is the call graph for this function:

Here is the caller graph for this function:

void get_rusage_resolution (  ) 

Definition at line 19174 of file iozone.c.

19176 {
19177     double starttime, finishtime;
19178     long  j;
19179 
19180     finishtime=cputime_so_far(); /* Warm up the instruction cache */
19181     starttime=cputime_so_far();  /* Warm up the instruction cache */
19182     delay=j=0;         /* Warm up the data cache */
19183     while(1)
19184     {
19185         starttime=cputime_so_far();
19186         for(j=0;j< delay;j++)
19187             ;
19188         finishtime=cputime_so_far();
19189         if(starttime==finishtime)
19190             
19191             delay++;
19192         else
19193             break;
19194     }
19195     cputime_res = (finishtime-starttime);    /* in seconds */
19196 }

Here is the caller graph for this function:

long long get_traj ( FILE *  traj_fd,
long long *  traj_size,
float *  delay,
long  which 
)

Definition at line 19596 of file iozone.c.

19602 {
19603     long long traj_offset = 0;
19604     long long tmp2 = 0;
19605     int tmp = 0;
19606     int tokens;
19607     int ret=0;
19608     char *ret1,*where;
19609     char buf[200];
19610     char sbuf[200];
19611     int got_line;
19612     
19613     got_line=0;
19614 
19615     while(got_line==0)
19616     {
19617         tokens=0;
19618         ret1=fgets(buf,200,traj_fd);
19619         if(ret1==(char *)0)
19620         {
19621             printf("\n\n\tEarly end of telemetry file. Results not accurate.\n");
19622             signal_handler();
19623         }
19624         where=(char *)&buf[0];
19625         strcpy(sbuf,buf);
19626         if((*where=='#') || (*where=='\n'))
19627             continue;
19628         tokens++;
19629         strtok(where," ");
19630         while( (char *)(strtok( (char *)0," ")) != (char *)0)
19631         {
19632             tokens++;
19633         }
19634         got_line=1;
19635     }
19636     if(tokens == 3)
19637     {
19638 #ifdef NO_PRINT_LLD
19639         ret=sscanf(sbuf,"%ld %ld %d\n",&traj_offset,&tmp2,&tmp);
19640 #else
19641         ret=sscanf(sbuf,"%lld %lld %d\n",&traj_offset,&tmp2,&tmp);
19642 #endif
19643     /*printf("\nReading %s trajectory with %d items\n",which?"write":"read",tokens);*/
19644         *traj_size=tmp2;
19645         *delay= ((float)tmp/1000);
19646     }
19647     if(tokens == 2)
19648     { 
19649 #ifdef NO_PRINT_LLD
19650         ret=sscanf(sbuf,"%ld %ld\n",&traj_offset,traj_size);
19651 #else
19652         ret=sscanf(sbuf,"%lld %lld\n",&traj_offset,traj_size);
19653 #endif
19654         *delay=compute_time;
19655     /*printf("\nReading %s trajectory with %d items\n",which?"write":"read",tokens);*/
19656     }
19657     if((tokens != 2) && (tokens !=3))
19658     {
19659         printf("\n\tInvalid entry in telemetry file. > %s <\n",sbuf);
19660         exit(178);
19661     }
19662     if(ret==EOF)
19663     {
19664         printf("\n\n\tEarly end of telemetry file. Results not accurate.\n");
19665         signal_handler();
19666     }
19667 #ifdef DEBUG
19668 #ifdef NO_PRINT_LLD
19669     if(!silent) printf("\nOffset %lld  Size %ld Compute delay %f\n",traj_offset, *traj_size,*delay);
19670 #else
19671     if(!silent) printf("\nOffset %lld  Size %lld Compute delay %f\n",traj_offset, *traj_size,*delay);
19672 #endif
19673 #endif
19674     return(traj_offset);
19675 }

Here is the call graph for this function:

long long get_traj (  ) 

Here is the caller graph for this function:

char* getenv (  ) 

Here is the caller graph for this function:

void hist_insert ( double  my_value  ) 

Definition at line 24255 of file iozone.c.

24256 {
24257     int k;
24258     long long value;
24259     
24260     /* Convert to micro-seconds */
24261     value = (long long)(my_value * 1000000);
24262     for(k=0;k<BUCKETS;k++)
24263     {
24264        if(k < (BUCKETS-1)) 
24265        {
24266          if(value <= bucket_val[k])
24267          {
24268         buckets[k]++;
24269         break;
24270          }
24271        }
24272        else
24273        {
24274          if(value > bucket_val[k])
24275          {
24276         buckets[k]++;
24277         break;
24278          }
24279        }
24280     }
24281 }

void hist_insert (  ) 

Here is the caller graph for this function:

char* inet_ntoa (  ) 

Here is the caller graph for this function:

void init_by_array64 ( unsigned long long  init_key[],
unsigned long long  key_length 
)

Definition at line 23897 of file iozone.c.

23899 {
23900     unsigned long long i, j, k;
23901     init_genrand64(19650218ULL);
23902     i=1; j=0;
23903     k = (NN>key_length ? NN : key_length);
23904     for (; k; k--) {
23905         mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 62)) * 3935559000370003845ULL))
23906           + init_key[j] + j; /* non linear */
23907         i++; j++;
23908         if (i>=NN) { mt[0] = mt[NN-1]; i=1; }
23909         if (j>=key_length) j=0;
23910     }
23911     for (k=NN-1; k; k--) {
23912         mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 62)) * 2862933555777941757ULL))
23913           - i; /* non linear */
23914         i++;
23915         if (i>=NN) { mt[0] = mt[NN-1]; i=1; }
23916     }
23917 
23918     mt[0] = 1ULL << 63; /* MSB is 1; assuring non-zero initial array */ 
23919 }

Here is the call graph for this function:

void init_by_array64 ( unsigned long long *  ,
unsigned long  long 
)

Here is the caller graph for this function:

void init_file_sizes ( off64_t  min_f_size,
off64_t  max_f_size 
)

Definition at line 20000 of file iozone.c.

20004 {
20005         off64_t kilosi;
20006     int x;
20007     if(s_count > 1)
20008     {
20009             for(x=0; x < s_count; x++)
20010         {
20011             kilosi=s_range[x];
20012             add_file_size((off64_t)kilosi);
20013         }
20014     }
20015     else
20016     {
20017             for(kilosi=min_f_size;kilosi<=max_f_size;kilosi*=multiplier)
20018         {
20019             add_file_size((off64_t)kilosi);
20020         }
20021     }
20022 }

Here is the call graph for this function:

void init_file_sizes (  ) 

Here is the caller graph for this function:

void init_genrand64 ( unsigned long long  seed  ) 

Definition at line 23887 of file iozone.c.

23888 {
23889     mt[0] = seed;
23890     for (mti=1; mti<NN; mti++) 
23891         mt[mti] =  (6364136223846793005ULL * (mt[mti-1] ^ (mt[mti-1] >> 62)) + mti);
23892 }

Here is the caller graph for this function:

void init_record_sizes ( off64_t  min_r_size,
off64_t  max_r_size 
)

Definition at line 20099 of file iozone.c.

20103 {
20104     int x;
20105         off64_t size;
20106     if(r_count > 1)
20107     {
20108             for(x=0; x < r_count; x++)
20109         {
20110             size=r_range[x];
20111             add_record_size((off64_t)size);
20112         }
20113     }
20114     else
20115     {
20116             for(size=min_r_size;size<=max_r_size;size*=multiplier)
20117         {
20118             add_record_size((off64_t)size);
20119         }
20120     }
20121 }

Here is the call graph for this function:

void init_record_sizes (  ) 

Here is the caller graph for this function:

char* initfile ( int  fd,
off64_t  filebytes,
int  flag,
int  prot 
)

Definition at line 18810 of file iozone.c.

18815 {
18816      char *pa;
18817      int mflags=0;
18818      long long x;
18819      char *tmp,*stmp;
18820      int file_flags;
18821      long long recs;
18822      long long i;
18823      int dflag = 0;
18824 
18825      if(flag)
18826      {
18827 
18828 #ifdef _HPUX_SOURCE
18829         /* 
18830          * Save time, just have the operating system prealloc 
18831          * the file 
18832          */
18833         prealloc(fd,filebytes);
18834 #else
18835         /* 
18836           * Allocate a temporary buffer to meet any alignment 
18837           * contraints of any method.
18838           */
18839          tmp=(char *)malloc((size_t)reclen * 2);
18840          stmp=tmp;
18841          /* 
18842           * Align to a reclen boundary.
18843           */
18844          tmp = (char *)((((long)tmp + (long)reclen))& ~(((long)reclen-1)));
18845         /* 
18846          * Special case.. Open O_DIRECT, and going to be mmap() 
18847          * Under Linux, one can not create a sparse file using 
18848          * a file that is opened with O_DIRECT 
18849          */
18850         file_flags=fcntl(fd,F_GETFL);
18851 
18852 #if ! defined(DONT_HAVE_O_DIRECT)
18853 #if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
18854         dflag = O_DIRECT;
18855 #endif
18856 #if defined(TRU64)
18857     if(direct_flag)
18858         dflag = O_DIRECTIO;
18859 #endif
18860 #endif
18861         if((file_flags & dflag) !=0)
18862         {
18863             recs=filebytes/reclen;
18864             for (i =0; i<recs ;i++)
18865             {
18866                 x=write(fd,tmp,(size_t)reclen);
18867                 if(x < 1)
18868                 {
18869                     printf("Unable to write file\n");
18870                     exit(182);
18871                 }
18872             }
18873         }
18874         else
18875         {
18876             /* Save time, just seek out and touch at the end */
18877             I_LSEEK(fd,(filebytes-reclen),SEEK_SET);
18878             x=write(fd,tmp,(size_t)reclen);
18879             if(x < 1)
18880             {
18881                 printf("Unable to write file\n");
18882                 exit(181);
18883             }
18884         }
18885         free(stmp);
18886         I_LSEEK(fd,0,SEEK_SET);
18887 #endif
18888      }
18889 
18890 #ifdef IRIX64
18891     if((prot & PROT_WRITE)==PROT_WRITE)
18892         mflags=MAP_SHARED;
18893     else
18894         mflags=MAP_PRIVATE;
18895 #else
18896 #ifdef IRIX
18897     if((prot & PROT_WRITE)==PROT_WRITE)
18898         mflags=MAP_SHARED;
18899     else
18900         mflags=MAP_PRIVATE;
18901 #else
18902     if((prot & PROT_WRITE)==PROT_WRITE)
18903         mflags=MAP_FILE|MAP_SHARED;
18904     else
18905         mflags=MAP_FILE|MAP_PRIVATE;
18906 #endif
18907 #endif
18908 
18909 #if defined(bsd4_2) && !defined(macosx)
18910      pa = (char *)mmap( 0,&filebytes, (int)prot, 
18911             (int)mflags, (int)fd, 0);
18912 #else
18913      pa = (char *)I_MMAP( ((char *)0),filebytes, prot, 
18914             mflags, fd, 0);
18915 #endif
18916 #ifdef __convex_spp
18917     if(pa == (char *)-1)
18918     {
18919         printf("\nMmap failed, errno %d Flags %x\n",errno,(int)mflags);
18920         exit(165);
18921     }
18922 #else
18923 #ifdef linux
18924     if(pa == (char *)-1)
18925     {
18926         printf("Mapping failed, errno %d\n",errno);
18927         exit(166);
18928     }
18929 #else
18930 #ifdef bsd4_2
18931     if(pa == (char *)-1)
18932     {
18933         printf("Mapping failed, errno %d\n",errno);
18934         exit(167);
18935     }
18936 #else
18937     if(pa == (char *)MAP_FAILED)
18938     {
18939         printf("\nMapping failed, errno %d Flags = %x\n",errno,mflags);
18940         exit(168);
18941     }
18942 #endif
18943 #endif
18944 #endif
18945 #ifndef NO_MADVISE
18946     if(advise_flag)
18947     {
18948         switch(advise_op){
18949         case 0:
18950             madvise( (char *)pa, (size_t) filebytes, MADV_NORMAL);
18951             break;
18952         case 1: 
18953             madvise( (char *)pa, (size_t) filebytes, MADV_RANDOM);
18954             break;
18955         case 2: 
18956             madvise( (char *)pa, (size_t) filebytes, MADV_SEQUENTIAL);
18957             break;
18958         case 3: 
18959             madvise( (char *)pa, (size_t) filebytes, MADV_DONTNEED);
18960             break;
18961         case 4: 
18962             madvise( (char *)pa, (size_t) filebytes, MADV_WILLNEED);
18963             break;
18964         default: 
18965             break;
18966         };
18967     }
18968     
18969 #endif
18970     return(pa);
18971 
18972 }

Here is the call graph for this function:

char* initfile (  ) 

Here is the caller graph for this function:

void Kill ( long long  pid,
long long  sig 
)

Definition at line 12195 of file iozone.c.

12198 {
12199     if(!xflag)
12200     {
12201         /*printf("Killing %d\n",pid);*/
12202         kill((pid_t)pid,(int)sig);
12203     }
12204 }

void Kill (  ) 

Here is the caller graph for this function:

long long l_max ( long long  one,
long long  two 
)

Definition at line 12179 of file iozone.c.

12182 {
12183     if(one > two)
12184         return(one);
12185     else
12186         return(two);
12187 }

long long l_max (  ) 

Here is the caller graph for this function:

long long l_min ( long long  num1,
long long  num2 
)

Definition at line 12212 of file iozone.c.

12215 {
12216     if(num1 >= num2)
12217         return num2;
12218     else
12219         return num1;
12220 }

long long l_min (  ) 

Here is the caller graph for this function:

long lrand48 (  ) 

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 1608 of file iozone.c.

01611 {
01612 
01613     long long fileindx,i,tval;
01614     long long ind;
01615     int ret;
01616     FILE *pi;
01617     char reply[IBUFSIZE];
01618     unsigned char inp_pat;
01619     time_t time_run;
01620     char *port,*m,*subarg;
01621     int num_child1;
01622     int cret;
01623     int anwser,bind_cpu;
01624     char *evalue;
01625 
01626 
01627     anwser=bind_cpu=0;
01628     /* Used to make fread/fwrite do something better than their defaults */
01629     setvbuf( stdout, NULL, _IONBF, (size_t) NULL );
01630     setvbuf( stderr, NULL, _IONBF, (size_t) NULL );
01631     
01632     /* Save the master's name */
01633     gethostname(controlling_host_name,100);
01634 
01635     /* Let user activate mdebug or cdebug via environmental variables */
01636     evalue = (char *)NULL;
01637     evalue=(char *)getenv("CDEBUG");
01638     if(evalue)
01639         cdebug=atoi(evalue);
01640     evalue = (char *)NULL;
01641     evalue=(char *)getenv("MDEBUG");
01642     if(evalue)
01643         mdebug=atoi(evalue);
01644 
01645     srand(time(0));
01646     mygen=rand(); /* Pick a random generation number */
01647 
01648     /* Try to find the actual VM page size, if possible */
01649 #if defined (solaris) || defined (_HPUX_SOURCE) || defined (linux) || defined(IRIX) || defined (IRIX64)
01650 #ifndef __convex_spp
01651     page_size=getpagesize();
01652 #endif
01653 #endif
01654     /* Try to find the actual number of ticks per second */
01655 #ifdef unix
01656     sc_clk_tck = clk_tck();
01657 #endif
01658     for(ind=0;ind<MAXSTREAMS;ind++)
01659         filearray[ind]=(char *)tfile;
01660 
01661     /* base_time=(long)time_so_far(); */
01662     myid=(long long)getpid();   /* save the master's PID */
01663     /* get_resolution();         Get clock resolution */
01664     time_run = time(0);     /* Start a timer */
01665     (void)find_external_mon(imon_start, imon_stop);
01666 
01667     /*
01668      * Save the splash screen for later display. When in distributed network
01669      * mode this output does not get displayed on the clients.
01670      */
01671     sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n");
01672         sprintf(splash[splash_line++],"\t%s\n\t%s\n", THISVERSION,MODE);
01673         sprintf(splash[splash_line++],"\t\tBuild: %s \n\n",build_name);
01674         sprintf(splash[splash_line++],"\tContributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins\n");
01675     sprintf(splash[splash_line++],"\t             Al Slater, Scott Rhine, Mike Wisner, Ken Goss\n");
01676         sprintf(splash[splash_line++],"\t             Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,\n");
01677         sprintf(splash[splash_line++],"\t             Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,\n");
01678         sprintf(splash[splash_line++],"\t             Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,\n");
01679         sprintf(splash[splash_line++],"\t             Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,\n");
01680         sprintf(splash[splash_line++],"\t             Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer.\n");
01681         sprintf(splash[splash_line++],"\t             Ben England.\n\n");
01682     sprintf(splash[splash_line++],"\tRun began: %s\n",ctime(&time_run));
01683     argcsave=argc;
01684     argvsave=argv;
01685 
01686         signal(SIGINT, signal_handler);     /* handle user interrupt */
01687         signal(SIGTERM, signal_handler);    /* handle kill from shell */
01688 
01689         /********************************************************/
01690         /* Allocate and align buffer with beginning of the  */
01691         /* on chip data cache.                  */
01692         /********************************************************/
01693 
01694         buffer = (char *) alloc_mem((long long)(MAXBUFFERSIZE + (2 * cache_size)),(int)0);
01695     if(buffer == 0) {
01696             perror("Memory allocation failed:");
01697             exit(1);
01698         }
01699 
01700 #ifdef _64BIT_ARCH_
01701         buffer = (char *) ((long long )(buffer + cache_size ) & 
01702         ~(cache_size-1));
01703 #else
01704         buffer = (char *) ((long)(buffer + cache_size ) & 
01705         ~((long)cache_size-1));
01706 #endif
01707     mainbuffer = buffer;
01708 
01709     /* de-dup input buf */
01710         buffer1 = (char *) alloc_mem((long long)(MAXBUFFERSIZE + (2 * cache_size)),(int)0);
01711     if(buffer1 == 0) {
01712             perror("Memory allocation failed:");
01713             exit(1);
01714         }
01715 
01716 #ifdef _64BIT_ARCH_
01717         buffer1 = (char *) ((long long )(buffer1 + cache_size ) & 
01718         ~(cache_size-1));
01719 #else
01720         buffer1 = (char *) ((long)(buffer1 + cache_size ) & 
01721         ~((long)cache_size-1));
01722 #endif
01723     dedup_ibuf = buffer1;
01724     touch_dedup(buffer1, MAXBUFFERSIZE);
01725 
01726 #ifdef FOOB
01727     /* de-dup temp buf */
01728         buffer1 = (char *) alloc_mem((long long)(MAXBUFFERSIZE + (2 * cache_size)),(int)0);
01729     if(buffer1 == 0) {
01730             perror("Memory allocation failed:");
01731             exit(1);
01732         }
01733 
01734 #ifdef _64BIT_ARCH_
01735         buffer1 = (char *) ((long long )(buffer1 + cache_size ) & 
01736         ~(cache_size-1));
01737 #else
01738         buffer1 = (char *) ((long)(buffer1 + cache_size ) & 
01739         ~((long)cache_size-1));
01740 #endif
01741 #endif
01742     dedup_temp = mainbuffer;
01743 
01744     fetchon++;  /* By default, prefetch the CPU cache lines associated with the buffer */
01745     strcpy(filename,default_filename);  /* Init default filename */
01746     sprintf(dummyfile[0],"%s.DUMMY",default_filename);
01747     if(argc <=1){
01748         printf(USAGE);
01749         exit(255);
01750     }
01751     auto_mode = 0;      /* Default is to disable auto mode */
01752     inp_pat = PATTERN;  /* Init default pattern for verification */
01753     /* Fill the entire pattern variable with the same character */
01754     pattern = ((inp_pat << 24) | (inp_pat << 16) | (inp_pat << 8) | inp_pat);
01755 
01756     /*
01757      * Parse all of the options that the user specified.
01758      */
01759     while((cret = getopt(argc,argv,"ZQNIBDGCTOMREWovAxamwphcezKJ:j:k:V:r:t:s:f:F:d:l:u:U:S:L:H:+:P:i:b:X:Y:g:n:y:q: ")) != EOF){
01760         switch(cret){
01761         case 'k':   /* Async I/O with no bcopys */
01762             depth = (long long)(atoi(optarg));
01763             if(depth <0)
01764                 depth=0;
01765             /*
01766             if(depth > 60)
01767                 depth=60;
01768             */
01769 #ifdef NO_PRINT_LLD
01770             sprintf(splash[splash_line++],"\tPOSIX Async I/O (no bcopy). Depth %ld \n",depth);
01771 #else
01772             sprintf(splash[splash_line++],"\tPOSIX Async I/O (no bcopy). Depth %lld \n",depth);
01773 #endif
01774             no_copy_flag=1;
01775             async_flag++;
01776             k_flag++;
01777             break;
01778         case 'T':   /* Switch to POSIX thread based */
01779 #ifndef NO_THREADS
01780             use_thread++;
01781 #else
01782             printf("\tThreads not supported in this version\n");
01783             exit(2);
01784 #endif
01785             break;
01786         case 'H':   /* Use POSIX async_io */
01787             h_flag++;
01788             depth = (long long)(atoi(optarg));
01789             if(depth <0)
01790                 depth=0;
01791             /*
01792              * Hmmm. many systems fail is strange ways when the maximum
01793              * number of async I/Os per user or proc is exceeded.
01794              */
01795             /*
01796             if(depth > 60)
01797                 depth=60;
01798             */
01799 #ifdef NO_PRINT_LLD
01800             sprintf(splash[splash_line++],"\tPOSIX async I/O (with bcopy). Depth %ld\n",depth);
01801 #else
01802             sprintf(splash[splash_line++],"\tPOSIX async I/O (with bcopy). Depth %lld\n",depth);
01803 #endif
01804             async_flag++;
01805             break;
01806         case 'I':   /* Use VXFS direct advisory or O_DIRECT from Linux or AIX , or O_DIRECTIO for TRU64  or Solaris directio */
01807 #ifdef VXFS
01808             direct_flag++;
01809             sprintf(splash[splash_line++],"\tVxFS advanced feature SET_CACHE, VX_DIRECT enabled\n");
01810             break;
01811 #endif
01812 #if ! defined(DONT_HAVE_O_DIRECT)
01813 #if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined(__FreeBSD__) || defined(solaris)
01814             direct_flag++;
01815             sprintf(splash[splash_line++],"\tO_DIRECT feature enabled\n");
01816             break;
01817 #endif
01818 #if defined(TRU64)
01819             direct_flag++;
01820             sprintf(splash[splash_line++],"\tO_DIRECTIO feature enabled\n");
01821             break;
01822 #endif
01823 #else
01824             break;
01825 #endif
01826 #if defined(Windows)
01827             sprintf(splash[splash_line++],"\tO_DIRECTIO feature not available in Windows version.\n");
01828             break;
01829 #endif
01830         case 'B':   /* Use mmap file for test file */
01831             sprintf(splash[splash_line++],"\tUsing mmap files\n");
01832             mmapflag++;
01833             mmapnsflag++;
01834             break;
01835         case 'D':   /* Use async msync mmap file */
01836             sprintf(splash[splash_line++],"\tUsing msync(MS_ASYNC) on mmap files\n");
01837             mmapflag++;
01838             mmapasflag++;
01839             mmapnsflag=0;
01840             break;
01841         case 'G':   /* Use msync sync for mmap file */
01842             sprintf(splash[splash_line++],"\tUsing msync(MS_SYNC) on mmap files\n");
01843             mmapssflag++;
01844             mmapnsflag=0;
01845             break;
01846         case 'C':   /* show children xfer counts */
01847             Cflag++;
01848             break;
01849         case 'Q':   /* Enable output offset/latency files */
01850                 sprintf(splash[splash_line++],"\tOffset/latency files enabled.\n");
01851             Q_flag++;
01852             break;
01853         case 'x':   /* Disable stone_wall */
01854                 sprintf(splash[splash_line++],"\tStonewall disabled\n");
01855             xflag++;
01856             break;
01857 
01858         case 'a':   /* auto mode */
01859             fetchon=1;
01860             purge=0;
01861             multi_buffer=0;
01862                 auto_mode = 1;
01863             aflag++;
01864                 sprintf(splash[splash_line++],"\tAuto Mode\n");
01865             break;
01866         case 'c':   /* Include close in timing */
01867             include_close++;
01868                 sprintf(splash[splash_line++],"\tInclude close in write timing\n");
01869             break;
01870         case 'e':   /* Include fsync in timing */
01871             include_flush++;
01872                 sprintf(splash[splash_line++],"\tInclude fsync in write timing\n");
01873             break;
01874         case 'A':   /* auto2 mode. Soon to go away. Please use -az */
01875             fetchon=1;
01876             purge=0;
01877             multi_buffer=0;
01878                 auto_mode = 1;
01879             aflag++;
01880                 sprintf(splash[splash_line++],"\tAuto Mode 2. This option is obsolete. Use -az -i0 -i1 \n");
01881             RWONLYflag++;
01882             NOCROSSflag++;
01883             include_tflag++;    /* automatically set WRITER_TEST and READER_TEST */
01884             include_test[WRITER_TEST]++;
01885             include_test[READER_TEST]++;
01886             break;
01887         case 's':   /* Set file size */
01888 #ifdef NO_PRINT_LLD
01889             sscanf(optarg,"%ld",&kilobytes64);
01890 #else
01891             sscanf(optarg,"%lld",&kilobytes64);
01892 #endif
01893             if(optarg[strlen(optarg)-1]=='k' ||
01894                 optarg[strlen(optarg)-1]=='K'){
01895                 ;
01896             }
01897             if(optarg[strlen(optarg)-1]=='m' ||
01898                 optarg[strlen(optarg)-1]=='M'){
01899                 kilobytes64 = kilobytes64 * 1024;
01900             }
01901             if(optarg[strlen(optarg)-1]=='g' ||
01902                 optarg[strlen(optarg)-1]=='G'){
01903                 kilobytes64 = kilobytes64 *1024 * 1024;
01904             }
01905             if(kilobytes64 <= 0)
01906                 kilobytes64=512;
01907 
01908             s_range[s_count++]=kilobytes64;
01909             max_file_size = (off64_t)s_range[s_count-1];   /* Make visable globally */
01910             min_file_size = (off64_t)s_range[0];   /* Make visable globally */
01911 
01912 #ifdef NO_PRINT_LLD
01913                 sprintf(splash[splash_line++],"\tFile size set to %ld KB\n",kilobytes64);
01914 #else
01915                 sprintf(splash[splash_line++],"\tFile size set to %lld KB\n",kilobytes64);
01916 #endif
01917             sflag++;
01918             break;
01919         case 'l':   /* Set lower thread/proc limit  */
01920             mint = (long long)(atoi(optarg));
01921             if(mint <= 0)
01922             {
01923                 mint=1;
01924                 num_child=1;
01925             }else
01926                 num_child=mint;
01927             if(mint > (unsigned long long)MAXSTREAMS){
01928               printf("Invalid options: maximum streams for ");
01929               printf("throughput is MAXSTREAMS\n");
01930               exit(4);
01931             }
01932             lflag++;
01933             trflag++;
01934             if(Uflag)
01935             {
01936                 printf("Can not run throughput tests with unmount & remounts.\n");
01937                 exit(5);
01938             }
01939             break;
01940         case 'u':   /* Set upper thread/proc limit  */
01941             maxt = (long long)(atoi(optarg));
01942             if(maxt <= 0)
01943                 maxt=1;
01944             if(