|
PAPI
5.1.0.2
|

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 /* Most significant 33 bits */ |
| #define | LM 0x7FFFFFFFULL /* Least significant 31 bits */ |
| #define | DFLT_SERVICE "PIT" /* Default service name. */ |
| #define | INVALID_DESC -1 /* Invalid file (socket) descriptor. */ |
| #define | MAXBFRSIZE 256 /* Max bfr sz to read remote TOD. */ |
| #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_stats * | child_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_stats * | shmaddr |
| 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_entry * | size_list = 0 |
| struct size_entry * | rec_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 C_STATE_WAIT_BARRIER 3 |
| #define C_STATE_WAIT_WHO 2 |
| #define C_STATE_ZERO 1 |
| #define CACHE_LINE_SIZE 32 |
| #define CACHE_SIZE ( 1024 * 1024 ) |
| #define CHILD_ALIST_PORT (CHILD_LIST_PORT+MAXSTREAMS) |
| #define CHILD_ESEND_PORT (HOST_ASEND_PORT+MAXSTREAMS) |
| #define CHILD_LIST_PORT (CHILD_ESEND_PORT+MAXSTREAMS) |
| #define CHILD_STATE_BEGIN 2 |
| #define CHILD_STATE_DONE 3 |
| #define CHILD_STATE_HOLD 0 |
| #define CHILD_STATE_READY 1 |
| #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 cputime_so_far | ( | ) | time_so_far() |
| #define DFLT_SERVICE "PIT" /* Default service name. */ |
| #define FREADER_MASK (1 << FREADER_TEST) |
| #define FREADER_TEST 7 |
| #define FWRITER_MASK (1 << FWRITER_TEST) |
| #define FWRITER_TEST 6 |
| #define HOST_ASEND_PORT (HOST_ESEND_PORT+MAXSTREAMS) |
| #define HOST_ESEND_PORT (HOST_LIST_PORT+MAXSTREAMS) |
| #define HOST_LIST_PORT 20000 |
| #define INVALID_DESC -1 /* Invalid file (socket) descriptor. */ |
| #define KILOBYTES_END (1024*512) |
| #define KILOBYTES_START 64 |
| #define MAP_FAILED -1 |
| #define MAXBFRSIZE 256 /* Max bfr sz to read remote TOD. */ |
| #define MAXBUFFERSIZE (16*1024*1024) |
| #define MAXNAMESIZE 1000 |
| #define MAXSTREAMS 256 |
| #define MINBUFFERSIZE 128 |
| #define MULTIPLIER 2 |
| #define PATTERN get_pattern(); |
| #define R_CHILD_JOIN 1 |
| #define R_FLAG_DATA 3 |
| #define R_JOIN_ACK 4 |
| #define R_STAT_DATA 2 |
| #define R_STOP_FLAG 5 |
| #define R_TERMINATE 6 |
| #define RANDOM_MIX_MASK (1 << RANDOM_MIX_TEST) |
| #define RANDOM_MIX_TEST 8 |
| #define RANDOM_RW_MASK (1 << RANDOM_RW_TEST) |
| #define RANDOM_RW_TEST 2 |
| #define READER_MASK (1 << READER_TEST) |
| #define READER_TEST 1 |
| #define RECLEN_END (MAXBUFFERSIZE) |
| #define RECLEN_START 4096 |
| #define REVERSE_MASK (1 << REVERSE_TEST) |
| #define REVERSE_TEST 3 |
| #define REWRITE_REC_MASK (1 << REWRITE_REC_TEST) |
| #define REWRITE_REC_TEST 4 |
| #define SHMSIZE ((( sizeof(struct child_stats) * MAXSTREAMS) )+4096 ) |
| #define SP_CHILD_ESEND_PORT (SP_CHILD_LISTEN_PORT+10) |
| #define SP_CHILD_LISTEN_PORT 31000 |
| #define SP_MASTER_ESEND_PORT (SP_MASTER_LISTEN_PORT+10) |
| #define SP_MASTER_LISTEN_PORT (SP_CHILD_ESEND_PORT+10) |
| #define SP_MASTER_RESULTS_PORT (SP_MASTER_ESEND_PORT+10) |
| #define STRIDE_READ_MASK (1 << STRIDE_READ_TEST) |
| #define STRIDE_READ_TEST 5 |
| #define THISVERSION " Version $Revision$" |
| #define THREAD_CLEANUP_TEST 14 |
| #define THREAD_FREAD_TEST 13 |
| #define THREAD_FWRITE_TEST 12 |
| #define THREAD_PREAD_TEST 11 |
| #define THREAD_PWRITE_TEST 10 |
| #define THREAD_RANDOM_MIX_TEST 9 |
| #define THREAD_RANDOM_READ_TEST 6 |
| #define THREAD_RANDOM_WRITE_TEST 7 |
| #define THREAD_READ_TEST 3 |
| #define THREAD_REREAD_TEST 4 |
| #define THREAD_REVERSE_READ_TEST 8 |
| #define THREAD_REWRITE_TEST 2 |
| #define THREAD_STRIDE_TEST 5 |
| #define THREAD_WRITE_TEST 1 |
| #define UM 0xFFFFFFFF80000000ULL /* Most significant 33 bits */ |
| #define WRITER_MASK (1 << WRITER_TEST) |
| #define WRITER_TEST 0 |
| typedef struct sockaddr_in6 sockaddr_in6_t |
| typedef struct sockaddr_in sockaddr_in_t |
| enum boolean |
| void add_file_size | ( | ) |

| void add_file_size | ( | off64_t | size | ) |
Definition at line 20032 of file iozone.c.
{
struct size_entry *size_listp;
struct size_entry *nsize_list;
size_listp=size_list;
if(size_list)
{
if(size_listp->next)
while(size_listp->next!=0)
size_listp=size_listp->next;
}
nsize_list=(struct size_entry *)malloc(sizeof(struct size_entry));
if(nsize_list==0)
{
printf("Malloc failed in add_file_size\n");
exit(180);
}
nsize_list->next=0;
nsize_list->size=size;
if(size_list == 0)
size_list=nsize_list;
else
size_listp->next=nsize_list;
size_listp=size_list;
}

| void add_record_size | ( | ) |

| void add_record_size | ( | off64_t | size | ) |
Definition at line 20155 of file iozone.c.
{
struct size_entry *size_listp;
struct size_entry *nsize_list;
size_listp=rec_size_list;
if(rec_size_list)
{
if(size_listp->next)
while(size_listp->next!=0)
size_listp=size_listp->next;
}
nsize_list=(struct size_entry *)malloc(sizeof(struct size_entry));
if(nsize_list==0)
{
printf("Malloc failed in add_file_size\n");
exit(180);
}
nsize_list->next=0;
nsize_list->size=size;
if(rec_size_list == 0)
rec_size_list=nsize_list;
else
size_listp->next=nsize_list;
size_listp=rec_size_list;
}

| char* alloc_mem | ( | ) |

| char* alloc_mem | ( | long long | size, |
| int | shared_flag | ||
| ) |
Definition at line 12022 of file iozone.c.
{
long long size1;
char *addr,*dumb;
int shmid;
int tfd;
long long tmp;
#if defined(solaris)
char mmapFileName[]="mmap_tmp_XXXXXX";
#endif
tmp = 0;
dumb = (char *)0;
tfd=0;
size1=l_max(size,page_size);
if(!distributed)
{
if(!trflag)
{
addr=(char *)malloc((size_t)size1);
return(addr);
}
if(use_thread)
{
addr=(char *)malloc((size_t)size1);
return(addr);
}
}
if(!shared_flag)
{
addr=(char *)malloc((size_t)size1);
return(addr);
}
#ifdef SHARED_MEM
size1=l_max(size,page_size);
size1=(size1 +page_size) & ~(page_size-1);
shmid=(int)shmget((key_t)(IPC_PRIVATE), (size_t)size1 , (int)(IPC_CREAT|0666));
if(shmid < (int)0)
{
printf("\nUnable to get shared memory segment(shmget)\n");
#ifdef NO_PRINT_LLD
printf("shmid = %d, size = %ld, size1 = %lu, Error %d\n",shmid,size,(size_t)size1,errno);
#else
printf("shmid = %d, size = %lld, size1 = %lu, Error %d\n",shmid,size,(unsigned long)size1,errno);
#endif
exit(119);
}
/*addr = (char *)shmat(shmid, 0, SHM_W);*/
/* Some systems will not take the above but
* will default to read/write if no flags
* are provided. (AIX)
* The POSIX standard states that if SHM_RDONLY
* is not specified then it will be read/write.
*/
addr = (char *)shmat((int)shmid, 0, 0);
#ifdef _64BIT_ARCH_
if((long long)addr == (long long)-1)
#else
if((long)addr == (long)-1)
#endif
{
printf("\nUnable to get shared memory segment\n");
printf("..Error %d\n",errno);
exit(120);
}
shmctl(shmid, IPC_RMID, 0);
return(addr);
#else
size1=l_max(size,page_size);
size1=(size1 +page_size) & ~(page_size-1);
#if defined(bsd4_2) && !defined(macosx)
if((tfd = creat("mmap.tmp", 0666))<0)
{
printf("Unable to create tmp file\n");
exit(121);
}
addr=(char *)mmap(0,&size1,PROT_WRITE|PROT_READ,
MAP_ANON|MAP_SHARED, tfd, 0);
unlink("mmap.tmp");
#else
#if defined(solaris)
tfd=mkstemp(mmapFileName);
if(tfd < 0)
{
printf("Unable to create tmp file\n");
exit(121);
}
dumb=(char *)malloc((size_t)size1);
bzero(dumb,size1);
write(tfd,dumb,size1);
free(dumb);
addr=(char *)mmap(0,(size_t)size1,PROT_WRITE|PROT_READ,
MAP_SHARED, tfd, 0);
unlink(mmapFileName);
#else
#if defined(SCO) || defined(SCO_Unixware_gcc) || defined(Windows)
char mmapFileName[]="mmap_tmp_XXXXXX";
tfd=mkstemp(mmapFileName);
if(tfd < 0)
{
printf("Unable to create tmp file\n");
exit(121);
}
dumb=(char *)malloc((size_t)size1);
bzero(dumb,size1);
write(tfd,dumb,size1);
free(dumb);
addr=(char *)mmap(0,(size_t)size1,PROT_WRITE|PROT_READ,
MAP_SHARED, tfd, 0);
unlink(mmapFileName);
#else
addr=(char *)mmap(0,(size_t)size1,PROT_WRITE|PROT_READ,
MAP_ANONYMOUS|MAP_SHARED, -1, 0);
#endif
#endif
#endif
if((char *)addr == (char *)-1)
{
printf("\nUnable to get memory segment\n");
printf("Error %d\n",errno);
exit(122);
}
if(debug1)
printf("Got shared memory for size %d\n",size1);
return(addr);
#endif
}

| alloc_pbuf | ( | void | ) |
Definition at line 23620 of file iozone.c.
{
pbuffer = (char *) alloc_mem((long long)(3 * cache_size),(int)0);
if(pbuffer == 0) {
perror("Memory allocation failed:");
exit(9);
}
#ifdef _64BIT_ARCH_
pbuffer = (char *)
(((unsigned long long)pbuffer + cache_size )
& ~(cache_size-1));
#else
pbuffer = (char *)
(((long)pbuffer + (long)cache_size )
& ~((long)cache_size-1));
#endif
}


| void async_init | ( | ) |
| int async_read | ( | ) |
| int async_read_no_copy | ( | ) |
| void async_release | ( | ) |
| size_t async_write | ( | ) |
| size_t async_write_no_copy | ( | ) |
| int atoi | ( | ) |

| void auto_test | ( | ) |
Definition at line 3404 of file iozone.c.
{
off64_t kilosi;
long long recszi,count1;
long long mult;
long long xx;
/****************************************************************/
/* Start with file size of 1 megabyte and repeat the test */
/* KILOBYTES_ITER_LIMIT */
/* times. Each time we run, the file size is doubled */
/****************************************************************/
/*
if(sflag) {
min_file_size = kilobytes64;
max_file_size = kilobytes64;
}
if(rflag) {
min_rec_size = reclen;
max_rec_size = reclen;
}
*/
if(gflag)
max_file_size = maximum_file_size;
if(nflag)
min_file_size = minimum_file_size;
if (min_rec_size > (long long)(min_file_size*1024)) {
#ifdef NO_PRINT_LLD
printf("Error: record length %ld is greater than filesize %ld KB\n ",
min_rec_size,min_file_size);
#else
printf("Error: record length %lld is greater than filesize %lld KB\n ",
min_rec_size,min_file_size);
#endif
exit(23);
}
if(NOCROSSflag) xover = max_file_size;
init_file_sizes(min_file_size, max_file_size);
del_record_sizes();
orig_min_rec_size=min_rec_size;
orig_max_rec_size=max_rec_size;
init_record_sizes(min_rec_size, max_rec_size);
for(kilosi=get_next_file_size((off64_t)0); kilosi>0; kilosi=get_next_file_size(kilosi))
{
/****************************************************************/
/* Start with record size of min_rec_size bytes and repeat the */
/* test, multiplying the record size by MULTIPLIER each time, */
/* until we reach max_rec_size. At the CROSSOVER we stop doing */
/* small buffers as it takes forever and becomes very */
/* un-interesting. */
/****************************************************************/
if(!rflag && !sflag && !yflag && !qflag)
if(kilosi > xover){
min_rec_size = LARGE_REC;
mult = orig_min_rec_size/1024;
del_record_sizes();
init_record_sizes(min_rec_size, max_rec_size);
/************************************/
/* Generate dummy entries in the */
/* Excel buffer for skipped */
/* record sizes */
/************************************/
for(count1=min_rec_size;
(count1 != orig_min_rec_size) && (
mult <= (kilosi*1024)) ;
count1=(count1>>1))
{
current_x=0;
store_value((off64_t)kilosi);
store_value((off64_t)mult);
for(xx=0;xx<20;xx++)
store_value((off64_t)0);
mult=mult*2;
current_y++;
if(current_y>max_y)
max_y=current_y;
current_x=0;
}
}
for (recszi=get_next_record_size((off64_t)0);recszi!=0;recszi=get_next_record_size(recszi))
{
if(recszi > (kilosi*1024))
break;
begin(kilosi, recszi );
current_x=0;
current_y++;
}
}
}


| void become_client | ( | ) |
Definition at line 21555 of file iozone.c.
{
int x,testnum;
struct master_command mc;
struct client_command cc;
struct client_neutral_command *cnc;
char client_name[100];
char *workdir;
bzero(&mc,sizeof(struct master_command));
x=fork(); /* Become a daemon so that remote shell will return. */
if(x != 0)
exit(0);
/*
* I am the child
*/
(void)gethostname(client_name,100);
fflush(stdout);
fflush(stderr);
if(cdebug)
{
newstdin=freopen("/tmp/don_in","r+",stdin);
newstdout=freopen("/tmp/don_out","a+",stdout);
newstderr=freopen("/tmp/don_err","a+",stderr);
}
else
{
fclose(stdin);
fclose(stdout);
fclose(stderr);
}
if(cdebug>=1)
{
fprintf(newstdout,"My name = %s, Controller's name = %s\n",client_name, controlling_host_name);
fflush(newstdout);
}
/* 1. Start client receive channel */
l_sock = start_child_listen(sizeof(struct client_neutral_command));
l_async_sock = start_child_listen_async(sizeof(struct client_neutral_command));
/* 2. Send message to controller saying I'm joining. */
strcpy(mc.m_host_name,controlling_host_name);
strcpy(mc.m_client_name,client_name);
mc.m_child_port = child_port;
mc.m_child_async_port = child_async_port;
mc.m_command = R_CHILD_JOIN;
mc.m_version = proto_version;
if(cdebug)
{
fprintf(newstdout,"Child %s sends JOIN to master %s Host Port %d\n",
client_name,controlling_host_name,controlling_host_port);
fflush(newstdout);
}
child_send(controlling_host_name,(struct master_command *)&mc, sizeof(struct master_command));
l_sock=child_attach(l_sock,0);
l_async_sock=child_attach(l_async_sock,1);
/* 4. Go into a loop and get all instructions from */
/* the controlling process. */
if(cdebug>=1)
{
fprintf(newstdout,"Child %s waiting for who am I\n",client_name);
fflush(newstdout);
}
child_listen(l_sock,sizeof(struct client_neutral_command));
cnc = (struct client_neutral_command *)&child_rcv_buf;
bzero(&cc, sizeof(struct client_command));
/* Convert from string format to arch format */
sscanf(cnc->c_command,"%d",&cc.c_command);
sscanf(cnc->c_client_name,"%s",cc.c_client_name);
sscanf(cnc->c_client_number,"%d",&cc.c_client_number);
sscanf(cnc->c_host_name,"%s",cc.c_host_name);
sscanf(cnc->c_pit_hostname,"%s",cc.c_pit_hostname);
if(cc.c_command == R_TERMINATE || cc.c_command==R_DEATH)
{
if(cdebug)
{
fprintf(newstdout,"Child %d received terminate on sync channel !!\n",(int)chid);
fflush(newstdout);
}
exit(1);
}
if(cdebug)
{
fprintf(newstdout,"Child sees: \n Client name %s \n Client_num # %d \n Host_name %s\n"
,cc.c_client_name,cc.c_client_number,cc.c_host_name);
fflush(newstdout);
}
/*
* Now import all of the values of the flags that the child on this
* machine needs to be able to run the test requested.
*/
/* 5. Get state information from the master */
#ifdef NO_PRINT_LLD
sscanf(cnc->c_numrecs64,"%ld",&cc.c_numrecs64);
sscanf(cnc->c_reclen,"%ld",&cc.c_reclen);
sscanf(cnc->c_fetchon,"%ld",&cc.c_fetchon);
sscanf(cnc->c_purge,"%ld",&cc.c_purge);
sscanf(cnc->c_delay,"%ld",&cc.c_delay);
sscanf(cnc->c_stride,"%ld",&cc.c_stride);
sscanf(cnc->c_rest_val,"%ld",&cc.c_rest_val);
sscanf(cnc->c_delay_start,"%ld",&cc.c_delay_start);
sscanf(cnc->c_depth,"%ld",&cc.c_depth);
#else
sscanf(cnc->c_numrecs64,"%lld",&cc.c_numrecs64);
sscanf(cnc->c_reclen,"%lld",&cc.c_reclen);
sscanf(cnc->c_fetchon,"%lld",&cc.c_fetchon);
sscanf(cnc->c_purge,"%lld",&cc.c_purge);
sscanf(cnc->c_delay,"%lld",&cc.c_delay);
sscanf(cnc->c_stride,"%lld",&cc.c_stride);
sscanf(cnc->c_rest_val,"%lld",&cc.c_rest_val);
sscanf(cnc->c_delay_start,"%lld",&cc.c_delay_start);
sscanf(cnc->c_depth,"%lld",&cc.c_depth);
#endif
sscanf(cnc->c_pit_hostname,"%s",cc.c_pit_hostname);
sscanf(cnc->c_pit_service,"%s",cc.c_pit_service);
sscanf(cnc->c_testnum,"%d",&cc.c_testnum);
sscanf(cnc->c_client_number,"%d",&cc.c_client_number);
sscanf(cnc->c_working_dir,"%s",cc.c_working_dir);
sscanf(cnc->c_file_name,"%s",cc.c_file_name);
sscanf(cnc->c_write_traj_filename,"%s",cc.c_write_traj_filename);
sscanf(cnc->c_read_traj_filename,"%s",cc.c_read_traj_filename);
sscanf(cnc->c_noretest,"%d",&cc.c_noretest);
sscanf(cnc->c_notruncate,"%d",&cc.c_notruncate);
sscanf(cnc->c_read_sync,"%d",&cc.c_read_sync);
sscanf(cnc->c_jflag,"%d",&cc.c_jflag);
sscanf(cnc->c_direct_flag,"%d",&cc.c_direct_flag);
sscanf(cnc->c_cpuutilflag,"%d",&cc.c_cpuutilflag);
sscanf(cnc->c_seq_mix,"%d",&cc.c_seq_mix);
sscanf(cnc->c_async_flag,"%d",&cc.c_async_flag);
sscanf(cnc->c_k_flag,"%d",&cc.c_k_flag);
sscanf(cnc->c_h_flag,"%d",&cc.c_h_flag);
sscanf(cnc->c_mflag,"%d",&cc.c_mflag);
sscanf(cnc->c_pflag,"%d",&cc.c_pflag);
sscanf(cnc->c_stride_flag,"%d",&cc.c_stride_flag);
sscanf(cnc->c_verify,"%d",&cc.c_verify);
sscanf(cnc->c_sverify,"%d",&cc.c_sverify);
sscanf(cnc->c_odsync,"%d",&cc.c_odsync);
sscanf(cnc->c_diag_v,"%d",&cc.c_diag_v);
sscanf(cnc->c_dedup,"%d",&cc.c_dedup);
sscanf(cnc->c_dedup_interior,"%d",&cc.c_dedup_interior);
sscanf(cnc->c_dedup_compress,"%d",&cc.c_dedup_compress);
sscanf(cnc->c_dedup_mseed,"%d",&cc.c_dedup_mseed);
sscanf(cnc->c_hist_summary,"%d",&cc.c_hist_summary);
sscanf(cnc->c_op_rate,"%d",&cc.c_op_rate);
sscanf(cnc->c_op_rate_flag,"%d",&cc.c_op_rate_flag);
sscanf(cnc->c_file_lock,"%d",&cc.c_file_lock);
sscanf(cnc->c_rec_lock,"%d",&cc.c_rec_lock);
sscanf(cnc->c_Kplus_readers,"%d",&cc.c_Kplus_readers);
sscanf(cnc->c_multiplier,"%d",&cc.c_multiplier);
sscanf(cnc->c_share_file,"%d",&cc.c_share_file);
sscanf(cnc->c_pattern,"%d",&cc.c_pattern);
sscanf(cnc->c_version,"%d",&cc.c_version);
sscanf(cnc->c_base_time,"%d",&cc.c_base_time);
sscanf(cnc->c_num_child,"%d",&cc.c_num_child);
sscanf(cnc->c_pct_read,"%d",&cc.c_pct_read);
sscanf(cnc->c_advise_op,"%d",&cc.c_advise_op);
sscanf(cnc->c_advise_flag,"%d",&cc.c_advise_flag);
sscanf(cnc->c_restf,"%d",&cc.c_restf);
sscanf(cnc->c_mygen,"%d",&cc.c_mygen);
sscanf(cnc->c_oflag,"%d",&cc.c_oflag);
sscanf(cnc->c_mfflag,"%d",&cc.c_mfflag);
sscanf(cnc->c_unbuffered,"%d",&cc.c_unbuffered);
sscanf(cnc->c_Q_flag,"%d",&cc.c_Q_flag);
sscanf(cnc->c_L_flag,"%d",&cc.c_L_flag);
sscanf(cnc->c_xflag,"%d",&cc.c_xflag);
sscanf(cnc->c_include_flush,"%d",&cc.c_include_flush);
sscanf(cnc->c_OPS_flag,"%d",&cc.c_OPS_flag);
sscanf(cnc->c_mmapflag,"%d",&cc.c_mmapflag);
sscanf(cnc->c_mmapasflag,"%d",&cc.c_mmapasflag);
sscanf(cnc->c_mmapnsflag,"%d",&cc.c_mmapnsflag);
sscanf(cnc->c_mmapssflag,"%d",&cc.c_mmapssflag);
sscanf(cnc->c_no_copy_flag,"%d",&cc.c_no_copy_flag);
sscanf(cnc->c_w_traj_flag,"%d",&cc.c_w_traj_flag);
sscanf(cnc->c_r_traj_flag,"%d",&cc.c_r_traj_flag);
sscanf(cnc->c_no_unlink,"%d",&cc.c_no_unlink);
sscanf(cnc->c_no_write,"%d",&cc.c_no_write);
sscanf(cnc->c_include_close,"%d",&cc.c_include_close);
sscanf(cnc->c_disrupt_flag,"%d",&cc.c_disrupt_flag);
sscanf(cnc->c_compute_flag,"%d",&cc.c_compute_flag);
sscanf(cnc->c_MS_flag,"%d",&cc.c_MS_flag);
sscanf(cnc->c_mmap_mix,"%d",&cc.c_mmap_mix);
sscanf(cnc->c_Kplus_flag,"%d",&cc.c_Kplus_flag);
sscanf(cnc->c_compute_time,"%f",&cc.c_compute_time);
strcpy(write_traj_filename,cc.c_write_traj_filename);
strcpy(read_traj_filename,cc.c_read_traj_filename);
numrecs64 = cc.c_numrecs64;
strcpy(pit_hostname,cc.c_pit_hostname);
strcpy(pit_service,cc.c_pit_service);
reclen = cc.c_reclen;
testnum = cc.c_testnum;
chid = cc.c_client_number;
workdir=cc.c_working_dir;
oflag = cc.c_oflag;
/* Child's absolute filename to use is provided */
mfflag = cc.c_mfflag;
if(mfflag)
strcpy(filearray[chid],cc.c_file_name);
if(cdebug)
{
fprintf(newstdout,"File name given %s\n",cc.c_file_name);
fflush(newstdout);
}
unbuffered = cc.c_unbuffered;
noretest = cc.c_noretest;
notruncate = cc.c_notruncate;
read_sync = cc.c_read_sync;
jflag = cc.c_jflag;
direct_flag = cc.c_direct_flag;
cpuutilflag = cc.c_cpuutilflag;
seq_mix = cc.c_seq_mix;
async_flag = cc.c_async_flag;
k_flag = cc.c_k_flag;
h_flag = cc.c_h_flag;
mflag = cc.c_mflag;
pflag = cc.c_pflag;
stride_flag = cc.c_stride_flag;
fetchon = cc.c_fetchon;
verify = cc.c_verify;
diag_v = cc.c_diag_v;
dedup = cc.c_dedup;
dedup_interior = cc.c_dedup_interior;
dedup_compress = cc.c_dedup_compress;
dedup_mseed = cc.c_dedup_mseed;
hist_summary = cc.c_hist_summary;
op_rate = cc.c_op_rate;
op_rate_flag = cc.c_op_rate_flag;
if(diag_v)
sverify = 0;
else
sverify = cc.c_sverify;
file_lock = cc.c_file_lock;
rlocking = cc.c_rec_lock;
Kplus_readers = cc.c_Kplus_readers;
multiplier = cc.c_multiplier;
share_file = cc.c_share_file;
pattern = cc.c_pattern;
/* proto_version = cc.c_version; Don't copy it back. */
base_time=cc.c_base_time;
num_child=(long long)cc.c_num_child;
pct_read=cc.c_pct_read;
advise_op=cc.c_advise_op;
advise_flag=cc.c_advise_flag;
restf=cc.c_restf;
mygen=cc.c_mygen;
Q_flag = cc.c_Q_flag;
L_flag = cc.c_L_flag;
xflag = cc.c_xflag;
w_traj_flag = cc.c_w_traj_flag;
r_traj_flag = cc.c_r_traj_flag;
include_flush = cc.c_include_flush;
OPS_flag = cc.c_OPS_flag;
purge = cc.c_purge;
mmapflag = cc.c_mmapflag;
mmapasflag = cc.c_mmapasflag;
mmapnsflag = cc.c_mmapnsflag;
mmapssflag = cc.c_mmapssflag;
no_copy_flag = cc.c_no_copy_flag;
no_unlink = cc.c_no_unlink;
no_write = cc.c_no_write;
include_close = cc.c_include_close;
disrupt_flag = cc.c_disrupt_flag;
compute_flag = cc.c_compute_flag;
MS_flag = cc.c_MS_flag;
mmap_mix = cc.c_mmap_mix;
Kplus_flag = cc.c_Kplus_flag;
delay = cc.c_delay;
stride = cc.c_stride;
rest_val = cc.c_rest_val;
depth = cc.c_depth;
delay_start = cc.c_delay_start;
compute_time = cc.c_compute_time;
if(cdebug)
{
fprintf(newstdout,"Child %d change directory to %s\n",(int)chid,workdir);
fflush(newstdout);
}
if(purge)
alloc_pbuf();
/* 6. Change to the working directory */
if(chdir(workdir)<0)
client_error=errno;
start_child_listen_loop(); /* The async channel listener */
/* Need to start this after getting into the correct directory */
if(w_traj_flag)
w_traj_size();
if(r_traj_flag)
r_traj_size();
get_resolution(); /* Get my clock resolution */
if(hist_summary)
{
printf("Child got HISTORY flag\n");
}
/* 7. Run the test */
switch(testnum) {
case THREAD_WRITE_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_write_test\n",(int)chid);
fflush(newstdout);
}
thread_write_test((long)0);
break;
#ifdef HAVE_PREAD
case THREAD_PWRITE_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_pwrite_test\n",(int)chid);
fflush(newstdout);
}
thread_pwrite_test((long)0);
break;
#endif
case THREAD_REWRITE_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_rewrite_test\n",(int)chid);
fflush(newstdout);
}
thread_rwrite_test((long)0);
break;
case THREAD_READ_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_read_test\n",(int)chid);
fflush(newstdout);
}
thread_read_test((long)0);
break;
#ifdef HAVE_PREAD
case THREAD_PREAD_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_read_test\n",(int)chid);
fflush(newstdout);
}
thread_pread_test((long)0);
break;
#endif
case THREAD_REREAD_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_reread_test\n",(int)chid);
fflush(newstdout);
}
thread_rread_test((long)0);
break;
case THREAD_STRIDE_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_stride_read_test\n",(int)chid);
fflush(newstdout);
}
thread_stride_read_test((long)0);
break;
case THREAD_RANDOM_READ_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running random read test\n",(int)chid);
fflush(newstdout);
}
thread_ranread_test((long)0);
break;
case THREAD_RANDOM_WRITE_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running random write test\n",(int)chid);
fflush(newstdout);
}
thread_ranwrite_test((long)0);
break;
case THREAD_REVERSE_READ_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running reverse read test\n",(int)chid);
fflush(newstdout);
}
thread_reverse_read_test((long)0);
break;
case THREAD_RANDOM_MIX_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running mixed workload test\n",(int)chid);
fflush(newstdout);
}
thread_mix_test((long)0);
break;
case THREAD_FWRITE_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_fwrite_test\n",(int)chid);
fflush(newstdout);
}
thread_fwrite_test((long)0);
break;
case THREAD_FREAD_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running thread_fread_test\n",(int)chid);
fflush(newstdout);
}
thread_fread_test((long)0);
break;
case THREAD_CLEANUP_TEST :
if(cdebug>=1)
{
fprintf(newstdout,"Child %d running cleanup\n",(int)chid);
fflush(newstdout);
}
thread_cleanup_test((long)0);
break;
};
if(cdebug>=1)
{
fprintf(newstdout,"Child %d finished running test.\n",(int)chid);
fflush(newstdout);
}
/* 8. Release the listen and send sockets to the master */
stop_child_listen(l_sock);
exit(0);
}


| void begin | ( | ) |

Definition at line 3179 of file iozone.c.
{
long long num_tests,test_num,i,j;
long long data1[MAXTESTS], data2[MAXTESTS];
num_tests = sizeof(func)/sizeof(char *);
#if defined(HAVE_PREAD)
if(!Eflag)
{
#if defined(HAVE_PREAD) && defined(HAVE_PREADV)
num_tests -= 4;
#else
num_tests -= 2;
#endif
if(mmapflag || async_flag)
{
num_tests -= 2;
}
}
else
{
if(mmapflag || async_flag)
#if defined(HAVE_PREAD) && defined(HAVE_PREADV)
num_tests -= 6;
#else
num_tests -= 4;
#endif
}
#else
if(mmapflag || async_flag)
{
num_tests -= 2;
}
#endif
if(RWONLYflag) num_tests = 2; /* kcollins 8-21-96*/
sync(); /* just in case there were some dirty */
sync();
kilobytes64=kilos64;
reclen=reclength;
numrecs64 = (kilobytes64*1024)/reclen;
store_value(kilobytes64);
if(r_traj_flag || w_traj_flag)
store_value((off64_t)0);
else
store_value((off64_t)(reclen/1024));
#ifdef NO_PRINT_LLD
if(!silent) printf("%16ld",kilobytes64);
if(r_traj_flag || w_traj_flag)
{
if(!silent) printf("%8ld",0);
}
else
{
if(!silent) printf("%8ld",reclen/1024);
}
#else
if(!silent) printf("%16lld",kilobytes64);
if(r_traj_flag || w_traj_flag)
{
if(!silent) printf("%8lld",(long long )0);
}
else
{
if(!silent) printf("%8lld",reclen/1024);
}
#endif
if(include_tflag)
{
for(i=0;i<num_tests;i++)
{
if(include_mask & (long long)(1<<i))
func[i](kilobytes64,reclen,&data1[i],&data2[i]);
else
{
if(!silent) printf("%s",test_output[i]);
fflush(stdout);
for(j=0;j<test_soutput[i];j++)
store_value((off64_t)0);
}
}
}
else
{
for(test_num=0;test_num < num_tests;test_num++)
{
func[test_num](kilobytes64,reclen,&data1[test_num],&data2[test_num]);
};
}
if(!silent) printf("\n");
if(!OPS_flag && !include_tflag){ /* Report in ops/sec ? */
if(data1[1]!=0 && data2[1] != 0)
{
totaltime = data1[1] + data1[0];
if (totaltime < TOOFAST)
{
goodkilos = (TOOFAST/totaltime)*2*kilobytes64;
printf("\nThe test completed too quickly to give a good result\n");
printf("You will get a more precise measure of this machine's\n");
printf("performance by re-running iozone using the command:\n");
#ifdef NO_PRINT_LLD
printf("\n\tiozone %ld ", goodkilos);
printf("\t(i.e., file size = %ld kilobytes64)\n", goodkilos);
#else
printf("\n\tiozone %lld ", goodkilos);
printf("\t(i.e., file size = %lld kilobytes64)\n", goodkilos);
#endif
}
} else {
goodrecl = reclen/2;
printf("\nI/O error during read. Try again with the command:\n");
#ifdef NO_PRINT_LLD
printf("\n\tiozone %ld %ld ", kilobytes64, goodrecl);
printf("\t(i.e. record size = %ld bytes)\n", goodrecl);
#else
printf("\n\tiozone %lld %lld ", kilobytes64, goodrecl);
printf("\t(i.e. record size = %lld bytes)\n", goodrecl);
#endif
}
}
if (!no_unlink)
{
if(check_filename(filename))
unlink(filename); /* delete the file */
}
/*stop timer*/
return ;
}

| int check_filename | ( | ) |

| check_filename | ( | char * | name | ) |
Definition at line 23647 of file iozone.c.
{
#ifdef _LARGEFILE64_SOURCE
struct stat64 mystat;
#else
struct stat mystat;
#endif
int x;
if(strlen(name)==0)
return(0);
/* Lets try stat first.. may get an error if file is too big */
x=I_STAT(name,&mystat);
if(x<0)
{
return(0);
/* printf("Stat failed %d\n",x); */
}
if(mystat.st_mode & S_IFREG)
{
/*printf("Is a regular file\n");*/
return(1);
}
return(0);
}
| int child_attach | ( | int | s, |
| int | flag | ||
| ) |
Definition at line 20831 of file iozone.c.
{
unsigned int me;
int ns;
struct sockaddr_in *addr;
if(flag)
{
addr=&child_async_sock;
if(cdebug)
{
fprintf(newstdout,"Child %d attach async\n",(int)chid);
fflush(newstdout);
}
}
else
{
addr=&child_sync_sock;
if(cdebug)
{
fprintf(newstdout,"Child %d attach sync\n",(int)chid);
fflush(newstdout);
}
}
me=sizeof(struct sockaddr_in);
if(cdebug)
{
printf("Child %d enters listen\n",(int)chid);
fflush(stdout);
}
listen(s,10);
if(cdebug)
{
fprintf(newstdout,"Child %d enters accept\n",(int)chid);
fflush(newstdout);
}
ns=accept(s,(void *)addr,&me);
if(cdebug)
{
fprintf(newstdout,"Child %d attached for receive. Sock %d %d\n",
(int)chid, ns,errno);
fflush(newstdout);
}
return(ns);
}

| void child_listen | ( | ) |

| void child_listen | ( | int | sock, |
| int | size_of_message | ||
| ) |
Definition at line 20888 of file iozone.c.
{
int tsize;
int rcvd;
int s;
int rc;
char *cnc;
cnc = (char *)&child_rcv_buf[0];
bzero(cnc, sizeof(child_rcv_buf));
s = sock;
tsize=size_of_message; /* Number of messages to receive */
rcvd = 0;
while(rcvd < tsize)
{
if(cdebug ==1)
{
fprintf(newstdout,"Child %d In recieve \n",(int)chid);
fflush(newstdout);
}
rc=read(s,cnc,size_of_message);
if(rc < 0)
{
fprintf(newstdout,"Read failed. Errno %d \n",errno);
fflush(newstdout);
exit(21);
}
if(cdebug >= 1)
{
fprintf(newstdout,"Child %d: Got %d bytes\n",(int)chid, rc);
fflush(newstdout);
}
rcvd+=rc;
cnc+=rc;
}
if(cdebug >= 1)
{
fprintf(newstdout,"Child %d: return from listen\n",(int)chid);
fflush(newstdout);
}
}

| void child_listen_async | ( | ) |

| void child_listen_async | ( | int | sock, |
| int | size_of_message | ||
| ) |
Definition at line 21010 of file iozone.c.
{
int tsize;
int rcvd;
int s;
int rc;
char *cnc;
cnc = &child_async_rcv_buf[0];
s = sock;
tsize=size_of_message; /* Number of messages to receive */
rcvd = 0;
while(rcvd < tsize)
{
if(cdebug ==1)
{
fprintf(newstdout,"Child %d In async recieve \n",(int)chid);
fflush(newstdout);
}
rc=read(s,cnc,size_of_message);
if(rc < 0)
{
fprintf(newstdout,"Read failed. Errno %d \n",errno);
fflush(newstdout);
exit(21);
}
/* Special case. If master gets final results, it can
exit, and close the connection to the async child
too quickly. When this happens the child gets a
read() that returns 0. It just needs to exit here.
*/
if(rc==0)
exit(0);
if(cdebug >= 1)
{
fprintf(newstdout,"Child %d: Got %d bytes (async) \n",(int)chid,rc);
fflush(newstdout);
}
rcvd+=rc;
cnc+=rc;
}
if(cdebug >= 1)
{
fprintf(newstdout,"Child %d: return from async listen\n",(int)chid);
fflush(newstdout);
}
}

| void child_remove_files | ( | ) |

| void child_remove_files | ( | int | i | ) |
Definition at line 22504 of file iozone.c.
{
char *dummyfile[MAXSTREAMS]; /* name of dummy file */
dummyfile[i]=(char *)malloc((size_t)MAXNAMESIZE);
if(mfflag)
{
sprintf(dummyfile[i],"%s",filearray[i]);
}
else
{
sprintf(dummyfile[i],"%s.DUMMY.%d",filearray[i],i);
}
if(cdebug)
{
fprintf(newstdout,"Child %d remove: %s \n",(int)chid, dummyfile[i]);
fflush(newstdout);
}
if(check_filename(dummyfile[i]))
unlink(dummyfile[i]);
}

| void child_send | ( | ) |

| void child_send | ( | char * | controlling_host_name, |
| struct master_command * | send_buffer, | ||
| int | send_size | ||
| ) |
Definition at line 20406 of file iozone.c.
{
int rc,child_socket_val;
struct hostent *he;
int tmp_port;
struct in_addr *ip;
struct sockaddr_in cs_addr,cs_raddr;
struct master_neutral_command outbuf;
struct timespec req,rem;
req.tv_sec = 0;
req.tv_nsec = 10000000;
rem.tv_sec = 0;
rem.tv_nsec = 10000000;
if(cdebug)
{
fprintf(newstdout,"Start_child_send: %s Size %d\n",controlling_host_name,send_size);
fflush(newstdout);
}
he = gethostbyname(controlling_host_name);
if (he == NULL)
{
exit(22);
}
ip = (struct in_addr *)he->h_addr_list[0];
over:
cs_raddr.sin_family = AF_INET;
cs_raddr.sin_port = htons(controlling_host_port);
cs_raddr.sin_addr.s_addr = ip->s_addr;
child_socket_val = socket(AF_INET, SOCK_STREAM, 0);
if (child_socket_val < 0)
{
perror("Child: socket failed:");
exit(23);
}
bzero(&cs_addr, sizeof(struct sockaddr_in));
tmp_port= CHILD_ESEND_PORT;
cs_addr.sin_port = htons(tmp_port);
cs_addr.sin_family = AF_INET;
cs_addr.sin_addr.s_addr = INADDR_ANY;
rc = -1;
while (rc < 0)
{
rc = bind(child_socket_val, (struct sockaddr *)&cs_addr,
sizeof(struct sockaddr_in));
if(rc < 0)
{
tmp_port++;
cs_addr.sin_port=htons(tmp_port);
continue;
}
}
if (rc < 0)
{
perror("Child: bind failed\n");
exit(24);
}
if(cdebug)
{
fprintf(newstdout,"Child sender bound to port %d Master port %d \n",tmp_port,HOST_LIST_PORT);
fflush(newstdout);
}
again:
nanosleep(&req,&rem);
rc = connect(child_socket_val, (struct sockaddr *)&cs_raddr,
sizeof(struct sockaddr_in));
if (rc < 0)
{
if((ecount++ < 200) && (errno != EISCONN))
{
nanosleep(&req,&rem);
/*sleep(1);*/
goto again;
}
if(cdebug)
{
fprintf(newstdout,"Child: connect failed. Errno %d \n",errno);
fflush(newstdout);
}
close(child_socket_val);
nanosleep(&req,&rem);
/*sleep(1);*/
ecount=0;
goto over;
}
ecount=0;
if(cdebug)
{
fprintf(newstdout,"Child connected\n");
fflush(newstdout);
}
/* NOW send */
bzero(&outbuf, sizeof(struct master_neutral_command));
if(cdebug>=1)
{
fprintf(newstdout,"Child %d sending message to %s \n",(int)chid, controlling_host_name);
fflush(newstdout);
}
/*
* Convert internal commands to string format to neutral format for portability
*/
strcpy(outbuf.m_host_name,send_buffer->m_host_name);
strcpy(outbuf.m_client_name,send_buffer->m_client_name);
sprintf(outbuf.m_client_number,"%d",send_buffer->m_client_number);
sprintf(outbuf.m_client_error,"%d",send_buffer->m_client_error);
sprintf(outbuf.m_child_port,"%d",send_buffer->m_child_port);
sprintf(outbuf.m_child_async_port,"%d",send_buffer->m_child_async_port);
sprintf(outbuf.m_command,"%d",send_buffer->m_command);
sprintf(outbuf.m_testnum,"%d",send_buffer->m_testnum);
sprintf(outbuf.m_version,"%d",send_buffer->m_version);
sprintf(outbuf.m_mygen,"%d",send_buffer->m_mygen);
sprintf(outbuf.m_throughput,"%f",send_buffer->m_throughput);
sprintf(outbuf.m_cputime,"%f", send_buffer->m_cputime);
sprintf(outbuf.m_walltime,"%f",send_buffer->m_walltime);
sprintf(outbuf.m_stop_flag,"%d",send_buffer->m_stop_flag);
sprintf(outbuf.m_actual,"%f",send_buffer->m_actual);
#ifdef NO_PRINT_LLD
sprintf(outbuf.m_child_flag,"%ld",send_buffer->m_child_flag);
#else
sprintf(outbuf.m_child_flag,"%lld",send_buffer->m_child_flag);
#endif
rc=write(child_socket_val,&outbuf,sizeof(struct master_neutral_command));
if (rc < 0) {
perror("write failed\n");
exit(26);
}
close(child_socket_val);
}

| void cleanup_children | ( | ) |
Definition at line 22647 of file iozone.c.
{
int i;
struct client_command cc;
bzero(&cc,sizeof(struct client_command));
cc.c_command = R_DEATH;
for(i=0;i<num_child;i++)
{
cc.c_client_number = (int)i;
/* Child not started yet */
if(child_idents[i].state == C_STATE_ZERO)
;
/* Child is waiting for who info */
if(child_idents[i].state == C_STATE_WAIT_WHO)
{
if(mdebug)
printf("Master sending signaled death to child !!\n");
master_send(master_send_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
}
/* Child is waiting at the barrier */
if(child_idents[i].state == C_STATE_WAIT_BARRIER)
{
if(mdebug)
printf("Master sending signaled death to child !!\n");
master_send(master_send_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
if(mdebug)
printf("Master sending signaled death to child async !!\n");
master_send(master_send_async_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
}
}
}


| void cleanup_comm | ( | ) |
Definition at line 22690 of file iozone.c.
{
int i;
for(i=0;i<num_child;i++)
{
close(master_send_sockets[i]);
close(master_send_async_sockets[i]);
}
}


| int close | ( | ) |
| void close_xls | ( | ) |

| static double cpu_util | ( | ) | [static] |

| static double cpu_util | ( | double | cputime, |
| double | walltime | ||
| ) | [static] |
Definition at line 19347 of file iozone.c.
{
double cpu;
if (walltime <= (double)0.0)
{
cpu = (double)0.0;
return cpu;
}
if (cputime <= (double)0.0)
cputime = 0.0;
if (walltime <= (double)0.0)
cpu = (double)100.0;
else {
cpu = (((double)100.0 * cputime) / walltime);
/*
if (cpu > (double)100.0)
cpu = (double)99.99;
*/
}
return cpu;
}
| void create_list | ( | ) |
| void create_temp | ( | ) |
| int create_xls | ( | ) |

| void del_record_sizes | ( | ) |
Definition at line 20128 of file iozone.c.
{
struct size_entry *size_listp;
struct size_entry *save_item;
size_listp=rec_size_list;
if(rec_size_list)
{
while(size_listp!=0)
{
save_item=size_listp->next;
free(size_listp);
size_listp=save_item;
}
}
rec_size_list=0;
}

| void disrupt | ( | ) |

| void disrupt | ( | int | fd | ) |
Definition at line 19502 of file iozone.c.
{
char *nbuff,*free_addr;
off64_t current;
free_addr=nbuff=(char *)malloc((size_t)page_size+page_size);
nbuff=(char *)(((long)nbuff+(long)page_size) & (long)~(page_size-1));
/* Save current position */
current = I_LSEEK(fd,0,SEEK_CUR);
/* Move to beginning of file */
I_LSEEK(fd,0,SEEK_SET);
/* Read a little of the file */
if(direct_flag)
junk=read(fd,nbuff,page_size);
else
junk=read(fd,nbuff,1);
/* Skip into the file */
I_LSEEK(fd,page_size,SEEK_SET);
/* Read a little of the file */
if(direct_flag)
junk=read(fd,nbuff,page_size);
else
junk=read(fd,nbuff,1);
/* Restore current position in file, before disruption */
I_LSEEK(fd,current,SEEK_SET);
free(free_addr);
}

| void distribute_stop | ( | ) |
Definition at line 22564 of file iozone.c.
{
int i;
struct client_command cc;
/*
* Only send one stop to the clients. Each client will
* send stop to the master, but the master only needs
* to distribute the first stop. Without this, the
* master may distribute too many stops and overflow
* the socket buffer on the client.
*/
if(sent_stop)
{
if(mdebug)
{
s_count++;
printf("Master not send stop %d\n",s_count);
}
return;
}
bzero(&cc,sizeof(struct client_command));
cc.c_command = R_STOP_FLAG;
cc.c_stop_flag = 1;
for(i=0;i<num_child;i++)
{
cc.c_client_number = (int)i;
if(mdebug)
printf("Master distributing stop flag to child %d\n",i);
master_send(master_send_async_sockets[i],child_idents[i].child_name, &cc,sizeof(struct client_command));
}
sent_stop=1;
}


| float do_compute | ( | ) |

| float do_compute | ( | float | comp_delay | ) |
Definition at line 19474 of file iozone.c.
{
double starttime,tmptime;
if(comp_delay == (float)0.0)
return(0.0);
starttime=time_so_far();
while(1)
{
tmptime=time_so_far()-starttime;
if(tmptime >= (double)comp_delay)
return(tmptime);
}
return(0.0);
}

| void do_float | ( | ) |

| void do_label | ( | ) |

| void do_speed_check | ( | ) |

| void do_speed_check | ( | int | client_flag | ) |
Definition at line 23531 of file iozone.c.
{
int i;
if(client_flag)
{
speed_main(" "," ",reclen,kilobytes64,client_flag);
}
else
{
printf("Checking %d clients\n",clients_found);
for(i=0;i<clients_found;i++)
{
speed_main(child_idents[i].child_name,
child_idents[i].execute_path,
reclen, kilobytes64,client_flag);
}
}
}

| void dump_cputimes | ( | void | ) |
Definition at line 11880 of file iozone.c.
{
bif_row++;
bif_column = 0;
if ((!include_tflag) || (include_mask & (long long)WRITER_MASK)) {
if(bif_flag)
do_label(bif_fd, "Writer CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cWriter CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(2);
if(bif_flag)
do_label(bif_fd, "Re-writer CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-writer CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(3);
}
if ((!include_tflag) || (include_mask & (long long)READER_MASK)) {
if(bif_flag)
do_label(bif_fd, "Reader CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cReader CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(4);
if(bif_flag)
do_label(bif_fd, "Re-reader CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Reader CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(5);
}
if ((!include_tflag) || (include_mask & (long long)RANDOM_RW_MASK)) {
if(bif_flag)
do_label(bif_fd, "Random Read CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRandom read CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(6);
if(bif_flag)
do_label(bif_fd, "Random Write CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRandom write CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(7);
}
if ((!include_tflag) || (include_mask & (long long)REVERSE_MASK)) {
if(bif_flag)
do_label(bif_fd, "Backward Read CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cBackward read CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(8);
}
if ((!include_tflag) || (include_mask & (long long)REWRITE_REC_MASK)) {
if(bif_flag)
do_label(bif_fd, "Record Rewrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRecord rewrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(9);
}
if ((!include_tflag) || (include_mask & (long long)STRIDE_READ_MASK)) {
if(bif_flag)
do_label(bif_fd, "Stride Read CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cStride read CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(10);
}
if ((!include_tflag) || (include_mask & (long long)FWRITER_MASK)) {
if(bif_flag)
do_label(bif_fd, "Fwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cFwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(11);
if(bif_flag)
do_label(bif_fd, "Re-fwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Fwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(12);
}
if ((!include_tflag) || (include_mask & (long long)FREADER_MASK)) {
if(bif_flag)
do_label(bif_fd, "Fread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cFread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(13);
if(bif_flag)
do_label(bif_fd, "Re-fread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Fread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(14);
}
#ifdef HAVE_PREAD
if(Eflag)
{
if ((!include_tflag) || (include_mask & (long long)PWRITER_MASK)) {
if(bif_flag)
do_label(bif_fd, "Pwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cPwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(15);
if(bif_flag)
do_label(bif_fd, "Re-pwrite CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Pwrite CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(16);
}
if ((!include_tflag) || (include_mask & (long long)PREADER_MASK)) {
if(bif_flag)
do_label(bif_fd, "Pread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cPread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(17);
if(bif_flag)
do_label(bif_fd, "Re-pread CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Pread CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(18);
}
#ifdef HAVE_PREADV
if ((!include_tflag) || (include_mask & (long long)PWRITEV_MASK)) {
if(bif_flag)
do_label(bif_fd, "Pwritev CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cPwritev CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(19);
if(bif_flag)
do_label(bif_fd, "Re-pwritev CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Pwritev CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(20);
}
if ((!include_tflag) || (include_mask & (long long)PREADV_MASK)) {
if(bif_flag)
do_label(bif_fd, "Preadv CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cPreadv CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(21);
if(bif_flag)
do_label(bif_fd, "Re-preadv CPU utilization report (Zero values should be ignored)", bif_row++, bif_column);
if(!silent) printf("\n%cRe-Preadv CPU utilization report (Zero values should be ignored)%c\n",'"','"');
dump_times(22);
}
#endif
}
#endif
}


| void dump_excel | ( | ) |
Definition at line 11653 of file iozone.c.
{
if(bif_flag)
{
bif_fd=create_xls(bif_filename);
do_label(bif_fd,command_line,bif_row++,bif_column);
do_label(bif_fd," ",bif_row++,bif_column);
do_label(bif_fd,"The top row is records sizes, the left column is file sizes",bif_row++,bif_column);
}
if(!silent) printf("Excel output is below:\n");
if ((!include_tflag) || (include_mask & (long long)WRITER_MASK)) {
if(bif_flag)
do_label(bif_fd,"Writer Report",bif_row++,bif_column);
if(!silent) printf("\n%cWriter report%c\n",'"','"');
dump_report(2);
if(bif_flag)
do_label(bif_fd,"Re-writer Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-writer report%c\n",'"','"');
dump_report(3);
}
if ((!include_tflag) || (include_mask & (long long)READER_MASK)) {
if(bif_flag)
do_label(bif_fd,"Reader Report",bif_row++,bif_column);
if(!silent) printf("\n%cReader report%c\n",'"','"');
dump_report(4);
if(bif_flag)
do_label(bif_fd,"Re-reader Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Reader report%c\n",'"','"');
dump_report(5);
}
if ((!include_tflag) || (include_mask & (long long)RANDOM_RW_MASK)) {
if(bif_flag)
do_label(bif_fd,"Random Read Report",bif_row++,bif_column);
if(!silent) printf("\n%cRandom read report%c\n",'"','"');
dump_report(6);
if(bif_flag)
do_label(bif_fd,"Random Write Report",bif_row++,bif_column);
if(!silent) printf("\n%cRandom write report%c\n",'"','"');
dump_report(7);
}
if ((!include_tflag) || (include_mask & (long long)REVERSE_MASK)) {
if(bif_flag)
do_label(bif_fd,"Backward Read Report",bif_row++,bif_column);
if(!silent) printf("\n%cBackward read report%c\n",'"','"');
dump_report(8);
}
if ((!include_tflag) || (include_mask & (long long)REWRITE_REC_MASK)) {
if(bif_flag)
do_label(bif_fd,"Record Rewrite Report",bif_row++,bif_column);
if(!silent) printf("\n%cRecord rewrite report%c\n",'"','"');
dump_report(9);
}
if ((!include_tflag) || (include_mask & (long long)STRIDE_READ_MASK)) {
if(bif_flag)
do_label(bif_fd,"Stride Read Report",bif_row++,bif_column);
if(!silent) printf("\n%cStride read report%c\n",'"','"');
dump_report(10);
}
if ((!include_tflag) || (include_mask & (long long)FWRITER_MASK)) {
if(bif_flag)
do_label(bif_fd,"Fwrite Report",bif_row++,bif_column);
if(!silent) printf("\n%cFwrite report%c\n",'"','"');
dump_report(11);
if(bif_flag)
do_label(bif_fd,"Re-fwrite Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Fwrite report%c\n",'"','"');
dump_report(12);
}
if ((!include_tflag) || (include_mask & (long long)FREADER_MASK)) {
if(bif_flag)
do_label(bif_fd,"Fread Report",bif_row++,bif_column);
if(!silent) printf("\n%cFread report%c\n",'"','"');
dump_report(13);
if(bif_flag)
do_label(bif_fd,"Re-fread Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Fread report%c\n",'"','"');
dump_report(14);
}
#ifdef HAVE_PREAD
if(Eflag)
{
if ((!include_tflag) || (include_mask & (long long)PWRITER_MASK)) {
if(bif_flag)
do_label(bif_fd,"Pwrite Report",bif_row++,bif_column);
if(!silent) printf("\n%cPwrite report%c\n",'"','"');
dump_report(15);
if(bif_flag)
do_label(bif_fd,"Re-pwrite Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Pwrite report%c\n",'"','"');
dump_report(16);
}
if ((!include_tflag) || (include_mask & (long long)PREADER_MASK)) {
if(bif_flag)
do_label(bif_fd,"Pread Report",bif_row++,bif_column);
if(!silent) printf("\n%cPread report%c\n",'"','"');
dump_report(17);
if(bif_flag)
do_label(bif_fd,"Re-pread Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Pread report%c\n",'"','"');
dump_report(18);
}
#ifdef HAVE_PREADV
if ((!include_tflag) || (include_mask & (long long)PWRITEV_MASK)) {
if(bif_flag)
do_label(bif_fd,"Pwritev Report",bif_row++,bif_column);
if(!silent) printf("\n%cPwritev report%c\n",'"','"');
dump_report(19);
if(bif_flag)
do_label(bif_fd,"Re-pwritev Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Pwritev report%c\n",'"','"');
dump_report(20);
}
if ((!include_tflag) || (include_mask & (long long)PREADV_MASK)) {
if(bif_flag)
do_label(bif_fd,"Preadv Report",bif_row++,bif_column);
if(!silent) printf("\n%cPreadv report%c\n",'"','"');
dump_report(21);
if(bif_flag)
do_label(bif_fd,"Re-preadv Report",bif_row++,bif_column);
if(!silent) printf("\n%cRe-Preadv report%c\n",'"','"');
dump_report(22);
}
#endif
}
#endif
if (cpuutilflag)
dump_cputimes();
if(bif_flag)
close_xls(bif_fd);
}


| void dump_hist | ( | ) |

| void dump_hist | ( | char * | what, |
| int | id | ||
| ) |
Definition at line 24284 of file iozone.c.
{
FILE *fp;
char name[256];
sprintf(name,"%s_child_%d.txt","Iozone_histogram",id);
fp = fopen(name,"a");
#ifndef NO_PRINT_LLD
fprintf(fp,"Child: %d Op: %s\n",id,what);
fprintf(fp,"Band 1: ");
fprintf(fp," 20us:%-7.1lld ",buckets[0]);
fprintf(fp," 40us:%-7.1lld ",buckets[1]);
fprintf(fp," 60us:%-7.1lld ",buckets[2]);
fprintf(fp," 80us:%-7.1lld ",buckets[3]);
fprintf(fp,"100us:%-7.1lld \n",buckets[4]);
fprintf(fp,"Band 2: ");
fprintf(fp,"200us:%-7.1lld ",buckets[5]);
fprintf(fp,"400us:%-7.1lld ",buckets[6]);
fprintf(fp,"600us:%-7.1lld ",buckets[7]);
fprintf(fp,"800us:%-7.1lld ",buckets[8]);
fprintf(fp," 1ms:%-7.1lld \n",buckets[9]);
fprintf(fp,"Band 3: ");
fprintf(fp," 2ms:%-7.1lld ",buckets[10]);
fprintf(fp," 4ms:%-7.1lld ",buckets[11]);
fprintf(fp," 6ms:%-7.1lld ",buckets[12]);
fprintf(fp," 8ms:%-7.1lld ",buckets[13]);
fprintf(fp," 10ms:%-7.1lld \n",buckets[14]);
fprintf(fp,"Band 4: ");
fprintf(fp," 12ms:%-7.1lld ",buckets[15]);
fprintf(fp," 14ms:%-7.1lld ",buckets[16]);
fprintf(fp," 16ms:%-7.1lld ",buckets[17]);
fprintf(fp," 18ms:%-7.1lld ",buckets[18]);
fprintf(fp," 20ms:%-7.1lld \n",buckets[19]);
fprintf(fp,"Band 5: ");
fprintf(fp," 40ms:%-7.1lld ",buckets[20]);
fprintf(fp," 60ms:%-7.1lld ",buckets[21]);
fprintf(fp," 80ms:%-7.1lld ",buckets[22]);
fprintf(fp,"100ms:%-7.1lld \n",buckets[23]);
fprintf(fp,"Band 6: ");
fprintf(fp,"200ms:%-7.1lld ",buckets[24]);
fprintf(fp,"400ms:%-7.1lld ",buckets[25]);
fprintf(fp,"600ms:%-7.1lld ",buckets[26]);
fprintf(fp,"800ms:%-7.1lld ",buckets[27]);
fprintf(fp," 1s:%-7.1lld \n",buckets[28]);
fprintf(fp,"Band 7: ");
fprintf(fp," 2s:%-7.1lld ",buckets[29]);
fprintf(fp," 4s:%-7.1lld ",buckets[30]);
fprintf(fp," 6s:%-7.1lld ",buckets[31]);
fprintf(fp," 8s:%-7.1lld ",buckets[32]);
fprintf(fp," 10s:%-7.1lld \n",buckets[33]);
fprintf(fp,"Band 8: ");
fprintf(fp," 20s:%-7.1lld ",buckets[34]);
fprintf(fp," 40s:%-7.1lld ",buckets[35]);
fprintf(fp," 60s:%-7.1lld ",buckets[36]);
fprintf(fp," 80s:%-7.1lld ",buckets[37]);
fprintf(fp," 120s:%-7.1lld \n",buckets[38]);
fprintf(fp,"Band 9: ");
fprintf(fp,"120+s:%-7.1lld \n\n",buckets[39]);
#else
fprintf(fp,"Child: %d Op: %s\n",id,what);
fprintf(fp,"Band 1: ");
fprintf(fp," 20us:%-7.1ld ",buckets[0]);
fprintf(fp," 40us:%-7.1ld ",buckets[1]);
fprintf(fp," 60us:%-7.1ld ",buckets[2]);
fprintf(fp," 80us:%-7.1ld ",buckets[3]);
fprintf(fp,"100us:%-7.1ld \n",buckets[4]);
fprintf(fp,"Band 2: ");
fprintf(fp,"200us:%-7.1ld ",buckets[5]);
fprintf(fp,"400us:%-7.1ld ",buckets[6]);
fprintf(fp,"600us:%-7.1ld ",buckets[7]);
fprintf(fp,"800us:%-7.1ld ",buckets[8]);
fprintf(fp," 1ms:%-7.1ld \n",buckets[9]);
fprintf(fp,"Band 3: ");
fprintf(fp," 2ms:%-7.1ld ",buckets[10]);
fprintf(fp," 4ms:%-7.1ld ",buckets[11]);
fprintf(fp," 6ms:%-7.1ld ",buckets[12]);
fprintf(fp," 8ms:%-7.1ld ",buckets[13]);
fprintf(fp," 10ms:%-7.1ld \n",buckets[14]);
fprintf(fp,"Band 4: ");
fprintf(fp," 12ms:%-7.1ld ",buckets[15]);
fprintf(fp," 14ms:%-7.1ld ",buckets[16]);
fprintf(fp," 16ms:%-7.1ld ",buckets[17]);
fprintf(fp," 18ms:%-7.1ld ",buckets[18]);
fprintf(fp," 20ms:%-7.1ld \n",buckets[19]);
fprintf(fp,"Band 5: ");
fprintf(fp," 40ms:%-7.1ld ",buckets[20]);
fprintf(fp," 60ms:%-7.1ld ",buckets[21]);
fprintf(fp," 80ms:%-7.1ld ",buckets[22]);
fprintf(fp,"100ms:%-7.1ld \n",buckets[23]);
fprintf(fp,"Band 6: ");
fprintf(fp,"200ms:%-7.1ld ",buckets[24]);
fprintf(fp,"400ms:%-7.1ld ",buckets[25]);
fprintf(fp,"600ms:%-7.1ld ",buckets[26]);
fprintf(fp,"800ms:%-7.1ld ",buckets[27]);
fprintf(fp," 1s:%-7.1ld \n",buckets[28]);
fprintf(fp,"Band 7: ");
fprintf(fp," 2s:%-7.1ld ",buckets[29]);
fprintf(fp," 4s:%-7.1ld ",buckets[30]);
fprintf(fp," 6s:%-7.1ld ",buckets[31]);
fprintf(fp," 8s:%-7.1ld ",buckets[32]);
fprintf(fp," 10s:%-7.1ld \n",buckets[33]);
fprintf(fp,"Band 8: ");
fprintf(fp," 20s:%-7.1ld ",buckets[34]);
fprintf(fp," 40s:%-7.1ld ",buckets[35]);
fprintf(fp," 60s:%-7.1ld ",buckets[36]);
fprintf(fp," 80s:%-7.1ld ",buckets[37]);
fprintf(fp," 120s:%-7.1ld \n",buckets[38]);
fprintf(fp,"Band 9: ");
fprintf(fp,"120+s:%-7.1ld \n\n",buckets[39]);
#endif
fclose(fp);
}
| dump_report | ( | long long | who | ) |
Definition at line 11567 of file iozone.c.
{
long long i;
off64_t current_file_size;
off64_t rec_size;
if(bif_flag)
bif_column++;
if(!silent) printf(" ");
/*
* Need to reconstruct the record size list
* as the crossover in -a changed the list.
*/
del_record_sizes();
init_record_sizes(orig_min_rec_size, orig_max_rec_size);
for(rec_size=get_next_record_size(0); rec_size <= orig_max_rec_size;
rec_size=get_next_record_size(rec_size))
{
if (rec_size == 0) break;
if(bif_flag)
do_float(bif_fd,(double)(rec_size/1024),bif_row,bif_column++);
#ifdef NO_PRINT_LLD
if(!silent) printf(" %c%ld%c",'"',rec_size/1024,'"');
#else
if(!silent) printf(" %c%lld%c",'"',rec_size/1024,'"');
#endif
}
if(!silent) printf("\n");
if(bif_flag)
{
bif_column=0;
bif_row++;
}
current_file_size = report_array[0][0];
if(bif_flag)
{
do_float(bif_fd,(double)(current_file_size),bif_row,bif_column++);
}
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
#endif
for(i=0;i<=max_y;i++){
if(report_array[0][i] != current_file_size){
if(!silent) printf("\n");
current_file_size = report_array[0][i];
if(bif_flag)
{
bif_row++;
bif_column=0;
do_float(bif_fd,(double)(current_file_size),bif_row,bif_column++);
}
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
#endif
}
if(bif_flag)
do_float(bif_fd,(double)(report_array[who][i]),bif_row,bif_column++);
#ifdef NO_PRINT_LLD
if(!silent) printf(" %ld ",report_array[who][i]);
#else
if(!silent) printf(" %lld ",report_array[who][i]);
#endif
}
if(bif_flag)
{
bif_row++;
bif_column=0;
}
if(!silent) printf("\n");
}


| void dump_throughput | ( | ) |
Definition at line 18694 of file iozone.c.
{
long long x,y,i,j;
char *port;
char *label;
char print_str[300];
x=max_x;
y=max_y;
if(use_thread)
port="threads";
else
port="processes";
if(!silent) printf("\n\"Throughput report Y-axis is type of test X-axis is number of %s\"\n",port);
if(bif_flag)
{
bif_fd=create_xls(bif_filename);
do_label(bif_fd,command_line,bif_row++,bif_column);
sprintf(print_str,"Throughput report Y-axis is type of test X-axis is number of %s",port);
do_label(bif_fd,print_str,bif_row++,bif_column);
}
if(OPS_flag)
label="ops/sec";
else
if(MS_flag)
label="microseconds/op";
else
label="Kbytes/sec";
#ifdef NO_PRINT_LLD
if(!silent) printf("\"Record size = %ld Kbytes \"\n",reclen/1024);
#else
if(!silent) printf("\"Record size = %lld Kbytes \"\n",reclen/1024);
#endif
if(!silent) printf("\"Output is in %s\"\n\n",label);
if(bif_flag)
{
#ifdef NO_PRINT_LLD
sprintf(print_str,"Record size = %ld Kbytes",reclen/1024);
#else
sprintf(print_str,"Record size = %lld Kbytes",reclen/1024);
#endif
do_label(bif_fd,print_str,bif_row++,bif_column);
sprintf(print_str,"Output is in %s",label);
do_label(bif_fd,print_str,bif_row++,bif_column);
}
for(i=0;i<=toutputindex;i++)
{
if(!silent) printf("\"%15s \"",toutput[i]);
if(bif_flag)
{
sprintf(print_str,"%15s ",toutput[i]);
do_label(bif_fd,print_str,bif_row,bif_column++);
bif_column++;
}
for(j=0;j<=y;j++)
{
if(bif_flag)
{
do_float(bif_fd,(double)report_darray[i][j],bif_row,bif_column++);
}
if(!silent) printf(" %10.2f ",report_darray[i][j]);
}
if(!silent) printf("\n\n");
if(bif_flag)
{
bif_column=0;
bif_row++;
}
}
if (cpuutilflag)
dump_throughput_cpu();
if(bif_flag)
close_xls(bif_fd);
}


| void dump_throughput_cpu | ( | ) |
Definition at line 18625 of file iozone.c.
{
long long x,y,i,j;
char *port;
char *label;
char print_str[300];
x=max_x;
y=max_y;
port = use_thread ? "threads" : "processes";
printf("\n\"CPU utilization report Y-axis is type of test X-axis is number of %s\"\n",port);
if (bif_flag)
{
sprintf(print_str, "CPU utilization report Y-axis is type of test X-axis is number of %s", port);
do_label(bif_fd, print_str, bif_row++, bif_column);
}
label = OPS_flag ? "ops/sec" :
MS_flag ? "microseconds/op" : "Kbytes/sec";
#ifdef NO_PRINT_LLD
if(!silent) printf("\"Record size = %ld Kbytes \"\n", reclen/1024);
#else
if(!silent) printf("\"Record size = %lld Kbytes \"\n", reclen/1024);
#endif
if(!silent) printf("\"Output is in CPU%%\"\n\n");
if (bif_flag)
{
#ifdef NO_PRINT_LLD
sprintf(print_str, "Record size = %ld Kbytes", reclen/1024);
#else
sprintf(print_str, "Record size = %lld Kbytes", reclen/1024);
#endif
do_label(bif_fd, print_str, bif_row++, bif_column);
sprintf(print_str, "Output is in CPU%%");
do_label(bif_fd, print_str, bif_row++, bif_column);
}
for (i = 0; i < x; i++)
{
if(!silent) printf("\"%15s \"", throughput_tests[i]);
if (bif_flag)
{
sprintf(print_str, "%15s ", throughput_tests[i]);
do_label(bif_fd, print_str, bif_row, bif_column++);
bif_column++;
}
for (j = 0; j <= y; j++)
{
if (bif_flag)
do_float(bif_fd, runtimes[i][j].cpuutil, bif_row, bif_column++);
if(!silent) printf(" %10.2f ", runtimes[i][j].cpuutil);
}
if(!silent) printf("\n\n");
if (bif_flag)
{
bif_column=0;
bif_row++;
}
}
}


| dump_times | ( | long long | who | ) |
Definition at line 11804 of file iozone.c.
{
long long i;
off64_t current_file_size;
off64_t rec_size;
if (bif_flag)
bif_column++;
if(!silent) printf(" ");
for (rec_size = get_next_record_size(0); rec_size <= orig_max_rec_size;
rec_size = get_next_record_size(rec_size))
{
if (rec_size == 0) break;
if (bif_flag)
do_float(bif_fd, (double)(rec_size/1024), bif_row, bif_column++);
#ifdef NO_PRINT_LLD
if(!silent) printf(" %c%ld%c",'"',rec_size/1024,'"');
#else
if(!silent) printf(" %c%lld%c",'"',rec_size/1024,'"');
#endif
}
if(!silent) printf("\n");
if (bif_flag)
{
bif_column=0;
bif_row++;
}
current_file_size = report_array[0][0];
if (bif_flag)
{
do_float(bif_fd, (double)(current_file_size), bif_row, bif_column++);
}
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
#endif
for (i = 0; i <= max_y; i++) {
if (report_array[0][i] != current_file_size) {
if(!silent) printf("\n");
current_file_size = report_array[0][i];
if (bif_flag)
{
bif_row++;
bif_column=0;
do_float(bif_fd, (double)(current_file_size), bif_row, bif_column++);
}
#ifdef NO_PRINT_LLD
if(!silent) printf("%c%ld%c ",'"',current_file_size,'"');
#else
if(!silent) printf("%c%lld%c ",'"',current_file_size,'"');
#endif
}
if (bif_flag)
do_float(bif_fd, (double)(runtimes [who][i].cpuutil), bif_row, bif_column++);
if(!silent) printf(" %6.2f", runtimes [who][i].cpuutil);
}
if(!silent) printf("\n");
if (bif_flag)
{
bif_row++;
bif_column=0;
}
}


| void exit | ( | ) |
| void fetchit | ( | ) |

| void fetchit | ( | char * | buffer, |
| long long | length | ||
| ) |
Definition at line 6909 of file iozone.c.
{
char *where;
volatile long long x[4];
long long i;
where=(char *)buffer;
for(i=0;i<(length/cache_line_size);i++)
{
x[(i & 3)]=*(where);
where+=cache_line_size;
}
}
| fill_area | ( | long long * | src_buffer, |
| long long * | dest_buffer, | ||
| long long | length | ||
| ) |
| void fill_buffer | ( | ) |

| void fill_buffer | ( | char * | buffer, |
| long long | length, | ||
| long long | pattern, | ||
| char | sverify, | ||
| long long | recnum | ||
| ) |
Definition at line 7115 of file iozone.c.
{
unsigned long long *where;
long long i,j,xx2;
long long mpattern;
unsigned int seed;
unsigned long x;
unsigned long long value,value1;
unsigned long long a = 0x01020304;
unsigned long long b = 0x05060708;
unsigned long long c = 0x01010101;
unsigned long long d = 0x01010101;
value = (a << 32) | b;
value1 = (c << 32) | d;
xx2=chid;
if(share_file)
xx2=(long long)0;
x=0;
mpattern=pattern;
/* printf("Fill: Sverify %d verify %d diag_v %d\n",sverify,verify,diag_v);*/
if(dedup)
{
gen_new_buf((char *)dedup_ibuf,(char *)buffer, (long)recnum, (int)length,(int)dedup, (int) dedup_interior, dedup_compress, 1);
return;
}
if(diag_v)
{
/*if(client_iozone)
base_time=0;
*/
if(no_unlink)
base_time=0;
seed= (unsigned int)(base_time+xx2+recnum);
srand(seed);
mpattern=(long long)rand();
mpattern=(mpattern<<48) | (mpattern<<32) | (mpattern<<16) | mpattern;
mpattern=mpattern+value;
}
where=(unsigned long long *)buffer;
if(sverify == 1)
{
for(i=0;i<(length);i+=page_size)
{
*where = (long long)((pattern<<32) | pattern);
where+=(page_size/sizeof(long long));
/* printf("Filling page %lld \n",i/page_size);*/
}
}
else
{
for(i=0;i<(length/cache_line_size);i++)
{
for(j=0;j<(cache_line_size/sizeof(long long));j++)
{
if(diag_v)
{
*where = (long long)(mpattern);
mpattern=mpattern+value1;
}
else
*where = (long long)((pattern<<32) | pattern);
where++;
}
}
}
}

| void find_external_mon | ( | char * | imon_start, |
| char* | imon_stop | ||
| ) |
Definition at line 22729 of file iozone.c.
{
char *start,*stop,*sync;
imon_start[0]=(char)0;
imon_stop[0]=(char)0;
start=(char *)getenv("IMON_START");
if(start)
{
strcpy(imon_start,start);
}
stop=(char *)getenv("IMON_STOP");
if(stop)
{
strcpy(imon_stop,stop);
}
sync=(char *)getenv("IMON_SYNC");
if(sync)
{
imon_sync=1;
}
return;
}


| void find_remote_shell | ( | ) |

| void find_remote_shell | ( | char * | shell | ) |
| void fread_perf_test | ( | ) |
| void fread_perf_test | ( | off64_t | kilo64, |
| long long | reclen, | ||
| long long * | data1, | ||
| long long* | data2 | ||
| ) |
Definition at line 8083 of file iozone.c.
{
double starttime2;
double readtime[2];
double walltime[2], cputime[2];
double compute_val = (double)0;
long long j;
off64_t i,numrecs64;
long long Index = 0;
unsigned long long readrate[2];
off64_t filebytes64;
FILE *stream = 0;
char *stdio_buf;
int fd,ltest;
if(mmapflag || async_flag)
return;
numrecs64 = (kilo64*1024)/reclen;
filebytes64 = numrecs64*reclen;
stdio_buf=(char *)malloc((size_t)reclen);
if(noretest)
ltest=1;
else
ltest=2;
for( j=0; j<ltest; j++ )
{
if(cpuutilflag)
{
walltime[j] = time_so_far();
cputime[j] = cputime_so_far();
}
if(Uflag) /* Unmount and re-mount the mountpoint */
{
purge_buffer_cache();
}
#ifdef IRIX64
if((stream=(FILE *)fopen(filename,"r")) == 0)
{
printf("\nCan not fdopen temp file: %s\n",
filename);
perror("fdopen");
exit(51);
}
#else
if((stream=(FILE *)I_FOPEN(filename,"r")) == 0)
{
printf("\nCan not fdopen temp file: %s\n",
filename);
perror("fdopen");
exit(52);
}
#endif
fd=I_OPEN(filename,O_RDONLY,0);
fsync(fd);
close(fd);
setvbuf(stream,stdio_buf,_IOFBF,reclen);
buffer=mainbuffer;
if(fetchon)
fetchit(buffer,reclen);
compute_val=(double)0;
starttime2 = time_so_far();
for(i=0; i<numrecs64; i++)
{
if(compute_flag)
compute_val+=do_compute(compute_time);
if(multi_buffer)
{
Index +=reclen;
if(Index > (MAXBUFFERSIZE-reclen))
Index=0;
buffer = mbuffer + Index;
}
if(purge)
purgeit(buffer,reclen);
if(fread(buffer, (size_t) reclen,1, stream) != 1)
{
#ifdef _64BIT_ARCH_
#ifdef NO_PRINT_LLD
printf("\nError freading block %lu %lx\n", i,
(unsigned long long)buffer);
#else
printf("\nError freading block %llu %llx\n", i,
(unsigned long long)buffer);
#endif
#else
#ifdef NO_PRINT_LLD
printf("\nError freading block %lu %lx\n", i,
(long)buffer);
#else
printf("\nError freading block %llu %lx\n", i,
(long)buffer);
#endif
#endif
perror("read");
exit(54);
}
if(verify){
if(verify_buffer(buffer,reclen,(off64_t)i,reclen,(long long)pattern,sverify)){
exit(55);
}
}
}
if(include_flush)
fflush(stream);
if(include_close)
{
fclose(stream);
}
readtime[j] = ((time_so_far() - starttime2)-time_res)
-compute_val;
if(readtime[j] < (double).000001)
{
readtime[j]= time_res;
if(rec_prob < reclen)
rec_prob = reclen;
res_prob=1;
}
if(!include_close)
{
fflush(stream);
fclose(stream);
}
stream = NULL;
if(cpuutilflag)
{
cputime[j] = cputime_so_far() - cputime[j];
if (cputime[j] < cputime_res)
cputime[j] = 0.0;
walltime[j] = time_so_far() - walltime[j];
if (walltime[j] < cputime[j])
walltime[j] = cputime[j];
}
if(restf)
sleep((int)rest_val);
}
free(stdio_buf);
if(OPS_flag || MS_flag){
filebytes64=filebytes64/reclen;
}
for(j=0;j<ltest;j++)
{
if(MS_flag)
{
readrate[j]=1000000.0*(readtime[j] / (double)filebytes64);
continue;
}
else
{
readrate[j] =
(unsigned long long) ((double) filebytes64 / readtime[j]);
}
if(!(OPS_flag || MS_flag))
readrate[j] >>= 10;
}
data1[0]=readrate[0];
data2[0]=1;
if(noretest)
{
readrate[1]=(long long)0;
if(cpuutilflag)
{
walltime[1]=0.0;
cputime[1]=0.0;
}
}
/* Must save walltime & cputime before calling store_value() for each/any cell.*/
if(cpuutilflag)
store_times(walltime[0], cputime[0]);
store_value((off64_t)readrate[0]);
if(cpuutilflag)
store_times(walltime[1], cputime[1]);
store_value((off64_t)readrate[1]);
#ifdef NO_PRINT_LLD
if(!silent) printf("%8ld",readrate[0]);
if(!silent) printf("%9ld",readrate[1]);
if(!silent) fflush(stdout);
#else
if(!silent) printf("%8lld",readrate[0]);
if(!silent) printf("%9lld",readrate[1]);
if(!silent) fflush(stdout);
#endif
}

| int fsync | ( | ) |

| void fwrite_perf_test | ( | ) |
| void fwrite_perf_test | ( | off64_t | kilo64, |
| long long | reclen, | ||
| long long * | data1, | ||
| long long * | data2 | ||
| ) |
Definition at line 7859 of file iozone.c.
{
double starttime1;
double writetime[2];
double walltime[2], cputime[2];
double compute_val = (double)0;
long long i,j;
off64_t numrecs64;
long long Index = 0;
unsigned long long writerate[2];
off64_t filebytes64;
FILE *stream = NULL;
int fd;
int wval;
int ltest;
char *how;
char *stdio_buf;
if(mmapflag || async_flag)
return;
numrecs64 = (kilo64*1024)/reclen;
filebytes64 = numrecs64*reclen;
stdio_buf=(char *)malloc((size_t)reclen);
if(noretest)
ltest=1;
else
ltest=2;
for( j=0; j<ltest; j++)
{
if(cpuutilflag)
{
walltime[j] = time_so_far();
cputime[j] = cputime_so_far();
}
if(Uflag) /* Unmount and re-mount the mountpoint */
{
purge_buffer_cache();
}
if(j==0)
{
if(check_filename(filename))
how="r+"; /* file exists, don't create and zero a new one. */
else
how="w+"; /* file doesn't exist. create it. */
}
else
how="r+"; /* re-tests should error out if file does not exist. */
#ifdef IRIX64
if((stream=(FILE *)fopen(filename,how)) == 0)
{
printf("\nCan not fdopen temp file: %s %lld\n",
filename,errno);
perror("fdopen");
exit(48);
}
#else
if((stream=(FILE *)I_FOPEN(filename,how)) == 0)
{
#ifdef NO_PRINT_LLD
printf("\nCan not fdopen temp file: %s %d\n",
filename,errno);
#else
printf("\nCan not fdopen temp file: %s %d\n",
filename,errno);
#endif
perror("fdopen");
exit(49);
}
#endif
fd=fileno(stream);
fsync(fd);
setvbuf(stream,stdio_buf,_IOFBF,reclen);
buffer=mainbuffer;
if(fetchon)
fetchit(buffer,reclen);
if(verify || dedup || dedup_interior)
fill_buffer(buffer,reclen,(long long)pattern,sverify,(long long)0);
starttime1 = time_so_far();
compute_val=(double)0;
for(i=0; i<numrecs64; i++){
if(compute_flag)
compute_val+=do_compute(compute_time);
if(multi_buffer)
{
Index +=reclen;
if(Index > (MAXBUFFERSIZE-reclen))
Index=0;
buffer = mbuffer + Index;
}
if((verify & diag_v) || dedup || dedup_interior)
fill_buffer(buffer,reclen,(long long)pattern,sverify,i);
if(purge)
purgeit(buffer,reclen);
if(fwrite(buffer, (size_t) reclen, 1, stream) != 1)
{
#ifdef NO_PRINT_LLD
printf("\nError fwriting block %ld, fd= %d\n", i,
fd);
#else
printf("\nError fwriting block %lld, fd= %d\n", i,
fd);
#endif
perror("fwrite");
signal_handler();
}
}
if(include_flush)
{
fflush(stream);
wval=fsync(fd);
if(wval==-1){
perror("fsync");
signal_handler();
}
}
if(include_close)
{
wval=fclose(stream);
if(wval==-1){
perror("fclose");
signal_handler();
}
}
writetime[j] = ((time_so_far() - starttime1)-time_res)
-compute_val;
if(writetime[j] < (double).000001)
{
writetime[j]= time_res;
if(rec_prob < reclen)
rec_prob = reclen;
res_prob=1;
}
if(!include_close)
{
wval=fflush(stream);
if(wval==-1){
perror("fflush");
signal_handler();
}
wval=fsync(fd);
if(wval==-1){
perror("fsync");
signal_handler();
}
wval=fclose(stream);
if(wval==-1){
perror("fclose");
signal_handler();
}
}
if(cpuutilflag)
{
cputime[j] = cputime_so_far() - cputime[j];
if (cputime[j] < cputime_res)
cputime[j] = 0.0;
walltime[j] = time_so_far() - walltime[j];
if (walltime[j] < cputime[j])
walltime[j] = cputime[j];
}
if(restf)
sleep((int)(int)rest_val);
}
free(stdio_buf);
if(OPS_flag || MS_flag){
filebytes64=filebytes64/reclen;
}
for(j=0;j<ltest;j++)
{
if(MS_flag)
{
writerate[j]=1000000.0*(writetime[j] / (double)filebytes64);
continue;
}
else
{
writerate[j] =
(unsigned long long) ((double) filebytes64 / writetime[j]);
}
if(!(OPS_flag || MS_flag))
writerate[j] >>= 10;
}
/* Must save walltime & cputime before calling store_value() for each/any cell.*/
if(noretest)
{
writerate[1]=(long long)0;
if(cpuutilflag)
{
walltime[1]=0.0;
cputime[1]=0.0;
}
}
if(cpuutilflag)
store_times(walltime[0], cputime[0]);
store_value((off64_t)writerate[0]);
if(cpuutilflag)
store_times(walltime[1], cputime[1]);
store_value((off64_t)writerate[1]);
data1[0]=writerate[0];
#ifdef NO_PRINT_LLD
if(!silent) printf("%9ld",writerate[0]);
if(!silent) printf("%9ld",writerate[1]);
if(!silent) fflush(stdout);
#else
if(!silent) printf("%9lld",writerate[0]);
if(!silent) printf("%9lld",writerate[1]);
if(!silent) fflush(stdout);
#endif
}

| int gen_new_buf | ( | ) |

| 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.
{
register long *ip, *op; /* Register for speed */
register long iseed; /* Register for speed */
register long isize; /* Register for speed */
register long cseed; /* seed for dedupable for within & ! across */
register int x,w; /* Register for speed */
register int value; /* Register for speed */
register int interior_size; /* size of interior dedup region */
register int compress_size; /* size of compression dedup region */
if(ibuf == NULL) /* no input buf */
return(-1);
if(obuf == NULL) /* no output buf */
return(-1);
if((percent > 100) || (percent < 0)) /* percent check */
return(-1);
if(size == 0) /* size check */
return(-1);
srand(seed+1+(((int)numrecs64)*dedup_mseed)); /* set random seed */
iseed = rand(); /* generate random value */
isize = (size * percent)/100; /* percent that is dedupable */
interior_size = ((isize * percent_interior)/100);/* /sizeof(long) */
compress_size =((interior_size * percent_compress)/100);
ip = (long *)ibuf; /* pointer to input buf */
op = (long *)obuf; /* pointer to output buf */
if(all == 0) /* Special case for verify only */
isize = sizeof(long);
/* interior_size = dedup_within + dedup_across */
for(w=0;w<interior_size;w+=sizeof(long))
{
*op=0xdeadbeef+dedup_mseed;
*ip=0xdeadbeef+dedup_mseed;
op++;
ip++;
}
/* Prepare for dedup within but not across */
w=interior_size - compress_size;
op=(long *)&obuf[w];
ip=(long *)&ibuf[w];
srand(chid+1+dedup_mseed); /* set randdom seed */
cseed = rand(); /* generate random value */
for(w=(interior_size-compress_size);w<interior_size;w+=sizeof(long))
{
*op=*ip ^ cseed; /* do the xor op */
op++;
ip++;
}
/* isize = dedup across only */
for(x=interior_size;x<isize;x+=sizeof(long)) /* tight loop for transformation */
{
*op=*ip ^ iseed; /* do the xor op */
op++;
ip++;
}
if(all == 0) /* Special case for verify only */
return(0);
/* make the rest of the buffer non-dedupable */
if(100-percent > 0)
{
srand(1+seed+((chid+1)*(int)numrecs64)*dedup_mseed);
value=rand();
/* printf("Non-dedup value %x seed %x\n",value,seed);*/
for( ; x<size;x+=sizeof(long))
*op++=(*ip++)^value; /* randomize the remainder */
}
return(0);
}

| long long genrand64_int63 | ( | void | ) |
Definition at line 23960 of file iozone.c.
{
return (long long)(genrand64_int64() >> 1);
}

| unsigned long long genrand64_int64 | ( | void | ) |
Definition at line 23922 of file iozone.c.
{
int i;
unsigned long long x;
static unsigned long long mag01[2]={0ULL, MATRIX_A};
if (mti >= NN) { /* generate NN words at one time */
/* if init_genrand64() has not been called, */
/* a default initial seed is used */
if (mti == NN+1)
init_genrand64(5489ULL);
for (i=0;i<NN-MM;i++) {
x = (mt[i]&UM)|(mt[i+1]&LM);
mt[i] = mt[i+MM] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
}
for (;i<NN-1;i++) {
x = (mt[i]&UM)|(mt[i+1]&LM);
mt[i] = mt[i+(MM-NN)] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
}
x = (mt[NN-1]&UM)|(mt[0]&LM);
mt[NN-1] = mt[MM-1] ^ (x>>1) ^ mag01[(int)(x&1ULL)];
mti = 0;
}
x = mt[mti++];
x ^= (x >> 29) & 0x5555555555555555ULL;
x ^= (x << 17) & 0x71D67FFFEDA60000ULL;
x ^= (x << 37) & 0xFFF7EEE000000000ULL;
x ^= (x >> 43);
return x;
}


| double genrand64_real1 | ( | void | ) |
Definition at line 23966 of file iozone.c.
{
return (genrand64_int64() >> 11) * (1.0/9007199254740991.0);
}

| double genrand64_real2 | ( | void | ) |
Definition at line 23972 of file iozone.c.
{
return (genrand64_int64() >> 11) * (1.0/9007199254740992.0);
}

| double genrand64_real3 | ( | void | ) |
Definition at line 23978 of file iozone.c.
{
return ((genrand64_int64() >> 12) + 0.5) * (1.0/4503599627370496.0);
}

| int get_client_info | ( | ) |
Definition at line 22417 of file iozone.c.
{
FILE *fd;
char *ret1;
int count;
char buffer[200];
count=0;
fd=fopen(client_filename,"r");
if(fd == (FILE *)NULL)
{
printf("Unable to open client file \"%s\"\n",
client_filename);
exit(176);
}
while(1)
{
if (count > MAXSTREAMS) {
printf("Too many lines in client file - max of %d supported\n",
MAXSTREAMS);
exit(7);
}
ret1=fgets(buffer,200,fd);
if(ret1== (char *)NULL)
break;
count+=parse_client_line(buffer,count);
}
fclose(fd);
return(count);
}


| void get_date | ( | ) |

| get_date | ( | char * | where | ) |

| off64_t get_next_file_size | ( | off64_t | size | ) |

| off64_t get_next_record_size | ( | off64_t | size | ) |
Definition at line 20193 of file iozone.c.
{
struct size_entry *size_listp;
size_listp=rec_size_list;
for( ; size_listp ; size_listp=size_listp->next )
{
if(size_listp->size > size)
return(size_listp->size);
}
return((off64_t)0);
}
| get_pattern | ( | void | ) |
Definition at line 23584 of file iozone.c.
{
int i,x,y;
char cp[100],*ptr;
int pat;
unsigned char inp_pat;
unsigned int temp;
y=0;
ptr=&cp[0];
strcpy(cp,THISVERSION);
x=strlen(THISVERSION);
for(i=0;i<x;i++)
y+=*ptr++;
srand(y);
pat=(rand()& 0xff);
/* For compatibility with old 0xa5 data sets. */
if(Z_flag)
pat=0xa5;
/* Lock pattern to 0xBB, for filesystem short circuit debug */
if(X_flag)
pat=PATTERN1;
/* Set global pattern */
inp_pat = pat;
temp =((inp_pat << 24) | (inp_pat << 16) | (inp_pat << 8) | inp_pat);
return(pat);
}

| void get_resolution | ( | ) |
Definition at line 19131 of file iozone.c.
{
double starttime, finishtime, besttime = 0;
long j,delay;
int k;
finishtime=time_so_far1(); /* Warm up the instruction cache */
starttime=time_so_far1(); /* Warm up the instruction cache */
delay=j=0; /* Warm up the data cache */
for(k=0;k<10;k++)
{
while(1)
{
starttime=time_so_far1();
for(j=0;j< delay;j++)
;
finishtime=time_so_far1();
if(starttime==finishtime)
delay++;
else
{
if(k==0)
besttime=(finishtime-starttime);
if((finishtime-starttime) < besttime)
besttime=(finishtime-starttime);
break;
}
}
}
time_res=besttime/1000000.0;
}


| void get_rusage_resolution | ( | ) |
Definition at line 19174 of file iozone.c.
{
double starttime, finishtime;
long j;
finishtime=cputime_so_far(); /* Warm up the instruction cache */
starttime=cputime_so_far(); /* Warm up the instruction cache */
delay=j=0; /* Warm up the data cache */
while(1)
{
starttime=cputime_so_far();
for(j=0;j< delay;j++)
;
finishtime=cputime_so_far();
if(starttime==finishtime)
delay++;
else
break;
}
cputime_res = (finishtime-starttime); /* in seconds */
}

| long long get_traj | ( | ) |

| long long get_traj | ( | FILE * | traj_fd, |
| long long * | traj_size, | ||
| float * | delay, | ||
| long | which | ||
| ) |
Definition at line 19596 of file iozone.c.
{
long long traj_offset = 0;
long long tmp2 = 0;
int tmp = 0;
int tokens;
int ret=0;
char *ret1,*where;
char buf[200];
char sbuf[200];
int got_line;
got_line=0;
while(got_line==0)
{
tokens=0;
ret1=fgets(buf,200,traj_fd);
if(ret1==(char *)0)
{
printf("\n\n\tEarly end of telemetry file. Results not accurate.\n");
signal_handler();
}
where=(char *)&buf[0];
strcpy(sbuf,buf);
if((*where=='#') || (*where=='\n'))
continue;
tokens++;
strtok(where," ");
while( (char *)(strtok( (char *)0," ")) != (char *)0)
{
tokens++;
}
got_line=1;
}
if(tokens == 3)
{
#ifdef NO_PRINT_LLD
ret=sscanf(sbuf,"%ld %ld %d\n",&traj_offset,&tmp2,&tmp);
#else
ret=sscanf(sbuf,"%lld %lld %d\n",&traj_offset,&tmp2,&tmp);
#endif
/*printf("\nReading %s trajectory with %d items\n",which?"write":"read",tokens);*/
*traj_size=tmp2;
*delay= ((float)tmp/1000);
}
if(tokens == 2)
{
#ifdef NO_PRINT_LLD
ret=sscanf(sbuf,"%ld %ld\n",&traj_offset,traj_size);
#else
ret=sscanf(sbuf,"%lld %lld\n",&traj_offset,traj_size);
#endif
*delay=compute_time;
/*printf("\nReading %s trajectory with %d items\n",which?"write":"read",tokens);*/
}
if((tokens != 2) && (tokens !=3))
{
printf("\n\tInvalid entry in telemetry file. > %s <\n",sbuf);
exit(178);
}
if(ret==EOF)
{
printf("\n\n\tEarly end of telemetry file. Results not accurate.\n");
signal_handler();
}
#ifdef DEBUG
#ifdef NO_PRINT_LLD
if(!silent) printf("\nOffset %lld Size %ld Compute delay %f\n",traj_offset, *traj_size,*delay);
#else
if(!silent) printf("\nOffset %lld Size %lld Compute delay %f\n",traj_offset, *traj_size,*delay);
#endif
#endif
return(traj_offset);
}

| char* getenv | ( | ) |

| void hist_insert | ( | ) |

| void hist_insert | ( | double | my_value | ) |
Definition at line 24255 of file iozone.c.
{
int k;
long long value;
/* Convert to micro-seconds */
value = (long long)(my_value * 1000000);
for(k=0;k<BUCKETS;k++)
{
if(k < (BUCKETS-1))
{
if(value <= bucket_val[k])
{
buckets[k]++;
break;
}
}
else
{
if(value > bucket_val[k])
{
buckets[k]++;
break;
}
}
}
}
| char* inet_ntoa | ( | ) |

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

| void init_by_array64 | ( | unsigned long long | init_key[], |
| unsigned long long | key_length | ||
| ) |
Definition at line 23897 of file iozone.c.
{
unsigned long long i, j, k;
init_genrand64(19650218ULL);
i=1; j=0;
k = (NN>key_length ? NN : key_length);
for (; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 62)) * 3935559000370003845ULL))
+ init_key[j] + j; /* non linear */
i++; j++;
if (i>=NN) { mt[0] = mt[NN-1]; i=1; }
if (j>=key_length) j=0;
}
for (k=NN-1; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 62)) * 2862933555777941757ULL))
- i; /* non linear */
i++;
if (i>=NN) { mt[0] = mt[NN-1]; i=1; }
}
mt[0] = 1ULL << 63; /* MSB is 1; assuring non-zero initial array */
}

| void init_file_sizes | ( | ) |

| void init_file_sizes | ( | off64_t | min_f_size, |
| off64_t | max_f_size | ||
| ) |
Definition at line 20000 of file iozone.c.
{
off64_t kilosi;
int x;
if(s_count > 1)
{
for(x=0; x < s_count; x++)
{
kilosi=s_range[x];
add_file_size((off64_t)kilosi);
}
}
else
{
for(kilosi=min_f_size;kilosi<=max_f_size;kilosi*=multiplier)
{
add_file_size((off64_t)kilosi);
}
}
}

| void init_genrand64 | ( | unsigned long long | seed | ) |
| void init_record_sizes | ( | ) |

| void init_record_sizes | ( | off64_t | min_r_size, |
| off64_t | max_r_size | ||
| ) |
Definition at line 20099 of file iozone.c.
{
int x;
off64_t size;
if(r_count > 1)
{
for(x=0; x < r_count; x++)
{
size=r_range[x];
add_record_size((off64_t)size);
}
}
else
{
for(size=min_r_size;size<=max_r_size;size*=multiplier)
{
add_record_size((off64_t)size);
}
}
}

| char* initfile | ( | ) |

Definition at line 18810 of file iozone.c.
{
char *pa;
int mflags=0;
long long x;
char *tmp,*stmp;
int file_flags;
long long recs;
long long i;
int dflag = 0;
if(flag)
{
#ifdef _HPUX_SOURCE
/*
* Save time, just have the operating system prealloc
* the file
*/
prealloc(fd,filebytes);
#else
/*
* Allocate a temporary buffer to meet any alignment
* contraints of any method.
*/
tmp=(char *)malloc((size_t)reclen * 2);
stmp=tmp;
/*
* Align to a reclen boundary.
*/
tmp = (char *)((((long)tmp + (long)reclen))& ~(((long)reclen-1)));
/*
* Special case.. Open O_DIRECT, and going to be mmap()
* Under Linux, one can not create a sparse file using
* a file that is opened with O_DIRECT
*/
file_flags=fcntl(fd,F_GETFL);
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
dflag = O_DIRECT;
#endif
#if defined(TRU64)
if(direct_flag)
dflag = O_DIRECTIO;
#endif
#endif
if((file_flags & dflag) !=0)
{
recs=filebytes/reclen;
for (i =0; i<recs ;i++)
{
x=write(fd,tmp,(size_t)reclen);
if(x < 1)
{
printf("Unable to write file\n");
exit(182);
}
}
}
else
{
/* Save time, just seek out and touch at the end */
I_LSEEK(fd,(filebytes-reclen),SEEK_SET);
x=write(fd,tmp,(size_t)reclen);
if(x < 1)
{
printf("Unable to write file\n");
exit(181);
}
}
free(stmp);
I_LSEEK(fd,0,SEEK_SET);
#endif
}
#ifdef IRIX64
if((prot & PROT_WRITE)==PROT_WRITE)
mflags=MAP_SHARED;
else
mflags=MAP_PRIVATE;
#else
#ifdef IRIX
if((prot & PROT_WRITE)==PROT_WRITE)
mflags=MAP_SHARED;
else
mflags=MAP_PRIVATE;
#else
if((prot & PROT_WRITE)==PROT_WRITE)
mflags=MAP_FILE|MAP_SHARED;
else
mflags=MAP_FILE|MAP_PRIVATE;
#endif
#endif
#if defined(bsd4_2) && !defined(macosx)
pa = (char *)mmap( 0,&filebytes, (int)prot,
(int)mflags, (int)fd, 0);
#else
pa = (char *)I_MMAP( ((char *)0),filebytes, prot,
mflags, fd, 0);
#endif
#ifdef __convex_spp
if(pa == (char *)-1)
{
printf("\nMmap failed, errno %d Flags %x\n",errno,(int)mflags);
exit(165);
}
#else
#ifdef linux
if(pa == (char *)-1)
{
printf("Mapping failed, errno %d\n",errno);
exit(166);
}
#else
#ifdef bsd4_2
if(pa == (char *)-1)
{
printf("Mapping failed, errno %d\n",errno);
exit(167);
}
#else
if(pa == (char *)MAP_FAILED)
{
printf("\nMapping failed, errno %d Flags = %x\n",errno,mflags);
exit(168);
}
#endif
#endif
#endif
#ifndef NO_MADVISE
if(advise_flag)
{
switch(advise_op){
case 0:
madvise( (char *)pa, (size_t) filebytes, MADV_NORMAL);
break;
case 1:
madvise( (char *)pa, (size_t) filebytes, MADV_RANDOM);
break;
case 2:
madvise( (char *)pa, (size_t) filebytes, MADV_SEQUENTIAL);
break;
case 3:
madvise( (char *)pa, (size_t) filebytes, MADV_DONTNEED);
break;
case 4:
madvise( (char *)pa, (size_t) filebytes, MADV_WILLNEED);
break;
default:
break;
};
}
#endif
return(pa);
}

| void Kill | ( | ) |

| void Kill | ( | long long | pid, |
| long long | sig | ||
| ) |
| long long l_max | ( | ) |

| long long l_max | ( | long long | one, |
| long long | two | ||
| ) |
| long long l_min | ( | ) |

| long long l_min | ( | long long | num1, |
| long long | num2 | ||
| ) |
| long lrand48 | ( | ) |

| int main | ( | ) |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1608 of file iozone.c.
{
long long fileindx,i,tval;
long long ind;
int ret;
FILE *pi;
char reply[IBUFSIZE];
unsigned char inp_pat;
time_t time_run;
char *port,*m,*subarg;
int num_child1;
int cret;
int anwser,bind_cpu;
char *evalue;
anwser=bind_cpu=0;
/* Used to make fread/fwrite do something better than their defaults */
setvbuf( stdout, NULL, _IONBF, (size_t) NULL );
setvbuf( stderr, NULL, _IONBF, (size_t) NULL );
/* Save the master's name */
gethostname(controlling_host_name,100);
/* Let user activate mdebug or cdebug via environmental variables */
evalue = (char *)NULL;
evalue=(char *)getenv("CDEBUG");
if(evalue)
cdebug=atoi(evalue);
evalue = (char *)NULL;
evalue=(char *)getenv("MDEBUG");
if(evalue)
mdebug=atoi(evalue);
srand(time(0));
mygen=rand(); /* Pick a random generation number */
/* Try to find the actual VM page size, if possible */
#if defined (solaris) || defined (_HPUX_SOURCE) || defined (linux) || defined(IRIX) || defined (IRIX64)
#ifndef __convex_spp
page_size=getpagesize();
#endif
#endif
/* Try to find the actual number of ticks per second */
#ifdef unix
sc_clk_tck = clk_tck();
#endif
for(ind=0;ind<MAXSTREAMS;ind++)
filearray[ind]=(char *)tfile;
/* base_time=(long)time_so_far(); */
myid=(long long)getpid(); /* save the master's PID */
/* get_resolution(); Get clock resolution */
time_run = time(0); /* Start a timer */
(void)find_external_mon(imon_start, imon_stop);
/*
* Save the splash screen for later display. When in distributed network
* mode this output does not get displayed on the clients.
*/
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n");
sprintf(splash[splash_line++],"\t%s\n\t%s\n", THISVERSION,MODE);
sprintf(splash[splash_line++],"\t\tBuild: %s \n\n",build_name);
sprintf(splash[splash_line++],"\tContributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins\n");
sprintf(splash[splash_line++],"\t Al Slater, Scott Rhine, Mike Wisner, Ken Goss\n");
sprintf(splash[splash_line++],"\t Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,\n");
sprintf(splash[splash_line++],"\t Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,\n");
sprintf(splash[splash_line++],"\t Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,\n");
sprintf(splash[splash_line++],"\t Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,\n");
sprintf(splash[splash_line++],"\t Fabrice Bacchella, Zhenghua Xue, Qin Li, Darren Sawyer.\n");
sprintf(splash[splash_line++],"\t Ben England.\n\n");
sprintf(splash[splash_line++],"\tRun began: %s\n",ctime(&time_run));
argcsave=argc;
argvsave=argv;
signal(SIGINT, signal_handler); /* handle user interrupt */
signal(SIGTERM, signal_handler); /* handle kill from shell */
/********************************************************/
/* Allocate and align buffer with beginning of the */
/* on chip data cache. */
/********************************************************/
buffer = (char *) alloc_mem((long long)(MAXBUFFERSIZE + (2 * cache_size)),(int)0);
if(buffer == 0) {
perror("Memory allocation failed:");
exit(1);
}
#ifdef _64BIT_ARCH_
buffer = (char *) ((long long )(buffer + cache_size ) &
~(cache_size-1));
#else
buffer = (char *) ((long)(buffer + cache_size ) &
~((long)cache_size-1));
#endif
mainbuffer = buffer;
/* de-dup input buf */
buffer1 = (char *) alloc_mem((long long)(MAXBUFFERSIZE + (2 * cache_size)),(int)0);
if(buffer1 == 0) {
perror("Memory allocation failed:");
exit(1);
}
#ifdef _64BIT_ARCH_
buffer1 = (char *) ((long long )(buffer1 + cache_size ) &
~(cache_size-1));
#else
buffer1 = (char *) ((long)(buffer1 + cache_size ) &
~((long)cache_size-1));
#endif
dedup_ibuf = buffer1;
touch_dedup(buffer1, MAXBUFFERSIZE);
#ifdef FOOB
/* de-dup temp buf */
buffer1 = (char *) alloc_mem((long long)(MAXBUFFERSIZE + (2 * cache_size)),(int)0);
if(buffer1 == 0) {
perror("Memory allocation failed:");
exit(1);
}
#ifdef _64BIT_ARCH_
buffer1 = (char *) ((long long )(buffer1 + cache_size ) &
~(cache_size-1));
#else
buffer1 = (char *) ((long)(buffer1 + cache_size ) &
~((long)cache_size-1));
#endif
#endif
dedup_temp = mainbuffer;
fetchon++; /* By default, prefetch the CPU cache lines associated with the buffer */
strcpy(filename,default_filename); /* Init default filename */
sprintf(dummyfile[0],"%s.DUMMY",default_filename);
if(argc <=1){
printf(USAGE);
exit(255);
}
auto_mode = 0; /* Default is to disable auto mode */
inp_pat = PATTERN; /* Init default pattern for verification */
/* Fill the entire pattern variable with the same character */
pattern = ((inp_pat << 24) | (inp_pat << 16) | (inp_pat << 8) | inp_pat);
/*
* Parse all of the options that the user specified.
*/
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){
switch(cret){
case 'k': /* Async I/O with no bcopys */
depth = (long long)(atoi(optarg));
if(depth <0)
depth=0;
/*
if(depth > 60)
depth=60;
*/
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tPOSIX Async I/O (no bcopy). Depth %ld \n",depth);
#else
sprintf(splash[splash_line++],"\tPOSIX Async I/O (no bcopy). Depth %lld \n",depth);
#endif
no_copy_flag=1;
async_flag++;
k_flag++;
break;
case 'T': /* Switch to POSIX thread based */
#ifndef NO_THREADS
use_thread++;
#else
printf("\tThreads not supported in this version\n");
exit(2);
#endif
break;
case 'H': /* Use POSIX async_io */
h_flag++;
depth = (long long)(atoi(optarg));
if(depth <0)
depth=0;
/*
* Hmmm. many systems fail is strange ways when the maximum
* number of async I/Os per user or proc is exceeded.
*/
/*
if(depth > 60)
depth=60;
*/
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tPOSIX async I/O (with bcopy). Depth %ld\n",depth);
#else
sprintf(splash[splash_line++],"\tPOSIX async I/O (with bcopy). Depth %lld\n",depth);
#endif
async_flag++;
break;
case 'I': /* Use VXFS direct advisory or O_DIRECT from Linux or AIX , or O_DIRECTIO for TRU64 or Solaris directio */
#ifdef VXFS
direct_flag++;
sprintf(splash[splash_line++],"\tVxFS advanced feature SET_CACHE, VX_DIRECT enabled\n");
break;
#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined(__FreeBSD__) || defined(solaris)
direct_flag++;
sprintf(splash[splash_line++],"\tO_DIRECT feature enabled\n");
break;
#endif
#if defined(TRU64)
direct_flag++;
sprintf(splash[splash_line++],"\tO_DIRECTIO feature enabled\n");
break;
#endif
#else
break;
#endif
#if defined(Windows)
sprintf(splash[splash_line++],"\tO_DIRECTIO feature not available in Windows version.\n");
break;
#endif
case 'B': /* Use mmap file for test file */
sprintf(splash[splash_line++],"\tUsing mmap files\n");
mmapflag++;
mmapnsflag++;
break;
case 'D': /* Use async msync mmap file */
sprintf(splash[splash_line++],"\tUsing msync(MS_ASYNC) on mmap files\n");
mmapflag++;
mmapasflag++;
mmapnsflag=0;
break;
case 'G': /* Use msync sync for mmap file */
sprintf(splash[splash_line++],"\tUsing msync(MS_SYNC) on mmap files\n");
mmapssflag++;
mmapnsflag=0;
break;
case 'C': /* show children xfer counts */
Cflag++;
break;
case 'Q': /* Enable output offset/latency files */
sprintf(splash[splash_line++],"\tOffset/latency files enabled.\n");
Q_flag++;
break;
case 'x': /* Disable stone_wall */
sprintf(splash[splash_line++],"\tStonewall disabled\n");
xflag++;
break;
case 'a': /* auto mode */
fetchon=1;
purge=0;
multi_buffer=0;
auto_mode = 1;
aflag++;
sprintf(splash[splash_line++],"\tAuto Mode\n");
break;
case 'c': /* Include close in timing */
include_close++;
sprintf(splash[splash_line++],"\tInclude close in write timing\n");
break;
case 'e': /* Include fsync in timing */
include_flush++;
sprintf(splash[splash_line++],"\tInclude fsync in write timing\n");
break;
case 'A': /* auto2 mode. Soon to go away. Please use -az */
fetchon=1;
purge=0;
multi_buffer=0;
auto_mode = 1;
aflag++;
sprintf(splash[splash_line++],"\tAuto Mode 2. This option is obsolete. Use -az -i0 -i1 \n");
RWONLYflag++;
NOCROSSflag++;
include_tflag++; /* automatically set WRITER_TEST and READER_TEST */
include_test[WRITER_TEST]++;
include_test[READER_TEST]++;
break;
case 's': /* Set file size */
#ifdef NO_PRINT_LLD
sscanf(optarg,"%ld",&kilobytes64);
#else
sscanf(optarg,"%lld",&kilobytes64);
#endif
if(optarg[strlen(optarg)-1]=='k' ||
optarg[strlen(optarg)-1]=='K'){
;
}
if(optarg[strlen(optarg)-1]=='m' ||
optarg[strlen(optarg)-1]=='M'){
kilobytes64 = kilobytes64 * 1024;
}
if(optarg[strlen(optarg)-1]=='g' ||
optarg[strlen(optarg)-1]=='G'){
kilobytes64 = kilobytes64 *1024 * 1024;
}
if(kilobytes64 <= 0)
kilobytes64=512;
s_range[s_count++]=kilobytes64;
max_file_size = (off64_t)s_range[s_count-1]; /* Make visable globally */
min_file_size = (off64_t)s_range[0]; /* Make visable globally */
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tFile size set to %ld KB\n",kilobytes64);
#else
sprintf(splash[splash_line++],"\tFile size set to %lld KB\n",kilobytes64);
#endif
sflag++;
break;
case 'l': /* Set lower thread/proc limit */
mint = (long long)(atoi(optarg));
if(mint <= 0)
{
mint=1;
num_child=1;
}else
num_child=mint;
if(mint > (unsigned long long)MAXSTREAMS){
printf("Invalid options: maximum streams for ");
printf("throughput is MAXSTREAMS\n");
exit(4);
}
lflag++;
trflag++;
if(Uflag)
{
printf("Can not run throughput tests with unmount & remounts.\n");
exit(5);
}
break;
case 'u': /* Set upper thread/proc limit */
maxt = (long long)(atoi(optarg));
if(maxt <= 0)
maxt=1;
if(maxt > MAXSTREAMS){
printf("Invalid options: maximum streams for ");
printf("throughput is MAXSTREAMS\n");
exit(6);
}
uflag++;
trflag++;
if(Uflag)
{
printf("Can not run throughput tests with unmount & remounts.\n");
exit(7);
}
break;
case 'm': /* Use multiple buffers */
fetchon=0;
multi_buffer=1;
mflag++;
mbuffer = (char *) alloc_mem((long long)MAXBUFFERSIZE,(int)0);
if(mbuffer == 0) {
perror("Memory allocation failed:");
exit(8);
}
sprintf(splash[splash_line++],"\tMulti_buffer. Work area %d bytes\n",
MAXBUFFERSIZE);
break;
case 'M': /* Report machine name and OS */
bzero(reply,sizeof(reply));
pi=popen("uname -a", "r");
if(pi == (FILE *)0)
{
sprintf(splash[splash_line++],"\n\tError using popen() on uname\n");
sprintf(splash[splash_line++],"\t-M option suppressed.\n");
}
else
{
junk=fread(reply,IBUFSIZE-1,1,pi);
pclose(pi);
m=reply;
while(*m) /* Strip new line */
{
if(*m=='\n')
*m=0;
else
m++;
}
sprintf(splash[splash_line++],"\n\tMachine = %s\n",reply);
}
break;
case 'P': /* Set beginning processor for binding. */
#ifndef NO_THREADS
#if defined(_HPUX_SOURCE) || defined(linux)
#if defined(_HPUX_SOURCE)
num_processors= pthread_num_processors_np();
#else
num_processors = sysconf(_SC_NPROCESSORS_ONLN);
#endif
begin_proc = atoi(optarg);
if(begin_proc < 0)
begin_proc=0;
if(begin_proc > num_processors)
begin_proc=0;
sprintf(splash[splash_line++],"\tBinding of processors beginning with %d \n",begin_proc);
ioz_processor_bind++;
#else
sprintf(splash[splash_line++],"\tProcessor binding not available in this version\n");
#endif
#endif
break;
case 'p': /* purge the processor cache */
sprintf(splash[splash_line++],"\tPurge Mode On\n");
fetchon=0;
pflag++;
purge=1;
break;
case 'h': /* show help */
hflag++;
show_help();
exit(0);
break;
case 'E': /* Extended testing for pread/pwrite... */
Eflag++;
break;
case 'R': /* Generate Excel compatible Report */
Rflag++;
sprintf(splash[splash_line++],"\tExcel chart generation enabled\n");
break;
case 'o': /* Open OSYNC */
sprintf(splash[splash_line++],"\tSYNC Mode. \n");
oflag++;
break;
case 'O': /* Report in Ops/sec instead of KB/sec */
sprintf(splash[splash_line++],"\tOPS Mode. Output is in operations per second.\n");
OPS_flag++;
break;
case 'N': /* Report in usec/op */
sprintf(splash[splash_line++],"\tMicroseconds/op Mode. Output is in microseconds per operation.\n");
MS_flag++;
break;
case 'V': /* Turn on Verify every byte */
sverify=0;
inp_pat = (char)(atoi(optarg));
if(inp_pat == 0)
inp_pat = PATTERN;
pattern = ((inp_pat << 24) | (inp_pat << 16) | (inp_pat << 8)
| inp_pat);
verify=1;
sprintf(splash[splash_line++],"\tVerify Mode. Pattern %x\n",pattern);
sprintf(splash[splash_line++],"\tPerformance measurements are invalid in this mode.\n");
break;
case 'S': /* Set the processor cache size */
cache_size = (long)(atoi(optarg)*1024);
if(cache_size == 0)
cache_size = CACHE_SIZE;
break;
case 'L': /* Set processor cache line size */
cache_line_size = (long)(atoi(optarg));
if(cache_line_size == 0)
cache_line_size = CACHE_LINE_SIZE;
break;
case 'f': /* Specify the file name */
if(mfflag) {
printf("invalid options: -f and -F are mutually exclusive\n");
exit(10);
}
fflag++;
strcpy(filename,optarg);
sprintf(dummyfile[0],"%s.DUMMY",optarg);
break;
case 'b': /* Specify the biff file name */
Rflag++;
bif_flag++;
strcpy(bif_filename,optarg);
break;
case 'F': /* Specify multiple file names for -t */
mfflag++;
if(fflag) {
printf("invalid options: -f and -F are mutually exclusive\n");
exit(11);
}
if(!trflag) {
printf("invalid options: must specify -t N before -F\n");
exit(12);
}
optind--;
for(fileindx=0;fileindx<maxt;fileindx++) {
filearray[fileindx]=argv[optind++];
if(optind > argc) {
#ifdef NO_PRINT_LLD
printf("invalid options: not enough filenames for %ld streams\n",num_child);
#else
printf("invalid options: not enough filenames for %lld streams\n",num_child);
#endif
exit(13);
}
}
break;
case 'r': /* Specify the record size to use */
rflag++;
reclen = ((long long)(atoi(optarg))*1024);
if(optarg[strlen(optarg)-1]=='k' ||
optarg[strlen(optarg)-1]=='K'){
reclen = (long long)(1024 * atoi(optarg));
}
if(optarg[strlen(optarg)-1]=='m' ||
optarg[strlen(optarg)-1]=='M'){
reclen = (long long)(1024 * 1024 * atoi(optarg));
}
if(optarg[strlen(optarg)-1]=='g' ||
optarg[strlen(optarg)-1]=='G'){
reclen = (long long)(1024 * 1024 * 1024 *(long long)atoi(optarg));
}
if(reclen <= 0)
reclen=(long long)4096;
r_range[r_count++]=reclen;
max_rec_size = (off64_t)r_range[r_count-1]; /* Make visable globally */
min_rec_size = (off64_t)r_range[0]; /* Make visable globally */
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tRecord Size %ld KB\n",reclen/1024);
#else
sprintf(splash[splash_line++],"\tRecord Size %lld KB\n",reclen/1024);
#endif
if(max_rec_size > MAXBUFFERSIZE) {
#ifdef NO_PRINT_LLD
printf("Error: maximum record size %ld KB is greater than maximum buffer size %ld KB\n ",
max_rec_size/1024, MAXBUFFERSIZE/1024);
#else
printf("Error: maximum record size %lld KB is greater than maximum buffer size %lld KB\n ",
(long long)(max_rec_size/1024LL), (long long)MAXBUFFERSIZE/1024LL);
#endif
exit(23);
}
break;
case 'J': /* Specify the compute time in millisecs */
compute_time = (float)(atoi(optarg));
compute_time=compute_time/1000;
if(compute_time < (float)0)
compute_time=(float)0;
else
compute_flag=1;
jflag++;
break;
case 'j': /* Specify the stride in records */
stride = (long long)(atoi(optarg));
if(stride < 0)
stride=0;
stride_flag=1;
break;
case 't': /* Specify the number of children to run */
num_child1=(atoi(optarg));
num_child = (long long)num_child1;
if(num_child > (long long)MAXSTREAMS) {
printf("invalid options: maximum streams for throughput is MAXSTREAMS\n");
#ifdef NO_PRINT_LLD
printf("Numchild %ld %s\n",num_child,optarg);
#else
printf("Numchild %lld %s\n",num_child,optarg);
#endif
exit(14);
}
if(num_child <= 0)
num_child = 8;
if(num_child == 0)
num_child=1;
t_range[t_count++]=num_child;
maxt = (maxt>num_child?maxt:num_child);
trflag++;
if(Uflag)
{
printf("Can not run throughput tests with unmount & remounts.\n");
exit(15);
}
break;
case 'd': /* Specify the delay of children to run */
delay_start = (long long)(atoi(optarg));
if(delay_start < 0)
delay_start=0;
break;
case 'i': /* Specify specific tests */
tval=(long long)(atoi(optarg));
if(tval < 0) tval=0;
#ifndef HAVE_PREAD
if(tval > RANDOM_MIX_TEST)
{
printf("\tPread tests not available on this operating system.\n");
exit(183);
}
#endif
if(tval > sizeof(func)/sizeof(char *))
{
tval=0;
sprintf(splash[splash_line++],"\tSelected test not available on the version.\n");
}
include_test[tval]++;
include_tflag++;
break;
case 'v': /* Show version information */
for(ind=0; strlen(head1[ind]); ind++)
{
printf("%s\n", head1[ind]);
}
exit(0);
break;
case 'U': /* Specify the dev name for umount/mount*/
Uflag++;
strcpy(mountname,optarg);
if(trflag)
{
printf("Can not run throughput tests with unmount & remounts.\n");
exit(16);
}
break;
case 'w': /* Do not unlink files */
sprintf(splash[splash_line++],"\tSetting no_unlink\n");
no_unlink = 1;
break;
case 'Z': /* Turn on the mmap and file I/O mixing */
sprintf(splash[splash_line++],"\tEnable mmap & file I/O mixing.\n");
mmap_mix = 1;
break;
case 'W': /* Read/Write with file locked */
file_lock=1;
sprintf(splash[splash_line++],"\tLock file when reading/writing.\n");
break;
case 'K': /* Cause disrupted read pattern */
disrupt_flag=1;
sprintf(splash[splash_line++],"\tDisrupted read patterns selected.\n");
break;
case 'X': /* Open write telemetry file */
compute_flag=1;
sverify=2; /* touch lightly */
w_traj_flag=1;
strcpy(write_traj_filename,optarg);
traj_vers();
w_traj_size();
sprintf(splash[splash_line++],"\tUsing write telemetry file \"%s\"\n",
write_traj_filename);
w_traj_fd=open_w_traj();
if(w_traj_fd == (FILE *)0)
exit(200);
break;
case 'Y': /* Open Read telemetry file */
compute_flag=1;
sverify=2; /* touch lightly */
r_traj_flag=1;
strcpy(read_traj_filename,optarg);
sprintf(splash[splash_line++],"\tUsing read telemetry file \"%s\"\n",
read_traj_filename);
traj_vers();
r_traj_size();
r_traj_fd=open_r_traj();
if(r_traj_fd == (FILE*) 0)
exit(200);
break;
case 'n': /* Set min file size for auto mode */
nflag=1;
minimum_file_size = (off64_t)atoi(optarg);
if(optarg[strlen(optarg)-1]=='k' ||
optarg[strlen(optarg)-1]=='K'){
;
}
if(optarg[strlen(optarg)-1]=='m' ||
optarg[strlen(optarg)-1]=='M'){
minimum_file_size = (long long)(1024 * atoi(optarg));
}
if(optarg[strlen(optarg)-1]=='g' ||
optarg[strlen(optarg)-1]=='G'){
minimum_file_size = (long long)(1024 * 1024 * (long long)atoi(optarg));
}
if(minimum_file_size < RECLEN_START/1024)
minimum_file_size=(off64_t)(RECLEN_START/1024);
if(minimum_file_size < page_size/1024)
minimum_file_size=(off64_t)(page_size/1024);
#ifdef NO_PRINT_LLD
sprintf(splash[splash_line++],"\tUsing minimum file size of %ld kilobytes.\n",minimum_file_size);
#else
sprintf(splash[splash_line++],"\tUsing minimum file size of %lld kilobytes.\n",minimum_file_size);
#endif
break;
case 'g': /* Set maximum file size for auto mode */
gflag=1;
maximum_file_size = (off64_t)atoi(optarg);
if(optarg[strlen(optarg)-1]=='k' ||
optarg[strlen(optarg)-1]=='K'){
;
}
if(optarg[strlen(optarg)-1]=='m' ||
optarg[strlen(optarg)-1]=='M'){
maximum_file_size = (long long)(1024 * atoi(optarg));
}
if(optarg[strlen(optarg)-1]=='g' ||
optarg[strlen(optarg)-1]=='G'){
maximum_file_size = (long long)(1024 * 1024 * (long long)