@@ -40,6 +40,7 @@ maxstddevpct=5 # maximum allowable standard deviation in percent
4040max_failures=6 # after N failed attempts to hit below $maxstddevpct, move on to the nest test
4141supported_test_types=" read,write,rw,randread,randwrite,randrw"
4242install_only=" n"
43+ remote_only=" n"
4344config=" "
4445rate_iops=" "
4546test_types=" read,randread" # default is -non- destructive
@@ -134,10 +135,13 @@ function fio_usage() {
134135 printf -- " \t--install\n"
135136 printf " \t\tinstall only\n"
136137 printf " \t\tDefault is n\n"
138+ printf -- " \t--remote-only\n"
139+ printf " \trun this on the remotes only\n"
137140}
138141
139142function fio_process_options() {
140- opts=$( getopt -q -o jic:t:b:s:d:r: --longoptions " help,max-stddev:,max-failures:,samples:,direct:,sync:,install,clients:,client-file:,iodepth:,ioengine:,config:,jobs-per-dev:,job-mode:,rate-iops:,ramptime:,runtime:,test-types:,block-sizes:,file-size:,targets:,tool-group:,postprocess-only:,run-dir:,directory:,numjobs:,job-file:,pre-iteration-script:," -n " getopt.sh" -- " $@ " ) ;
143+ opts=$( getopt -q -o jic:t:b:s:d:r: --longoptions " help,max-stddev:,max-failures:,samples:,direct:,sync:,install,remote-only,clients:,client-file:,iodepth:,ioengine:,config:,jobs-per-dev:,job-mode:,rate-iops:,ramptime:,runtime:,test-types:,block-sizes:,file-size:,targets:,tool-group:,postprocess-only:,run-dir:,directory:,numjobs:,job-file:" -n " getopt.sh" -- " $@ " ) ;
144+
141145 if [ $? -ne 0 ]; then
142146 printf " \t${benchmark} : you specified an invalid option\n\n"
143147 fio_usage
@@ -154,6 +158,10 @@ function fio_process_options() {
154158 shift ;
155159 install_only=" y"
156160 ;;
161+ --remote-only)
162+ shift ;
163+ remote_only=" y"
164+ ;;
157165 --max-stddev)
158166 shift ;
159167 if [ -n " $1 " ]; then
@@ -359,7 +367,7 @@ function fio_process_options() {
359367 ;;
360368 esac
361369 done
362- if [ $postprocess_only = = " n" ]; then
370+ if [ " $postprocess_only " = " n" ]; then
363371 benchmark_run_dir=" $pbench_run /${benchmark} _${config} _$date "
364372 else
365373 if [ -z " $run_dir " ]; then
@@ -375,24 +383,36 @@ function fio_process_options() {
375383
376384# Ensure the right version of the benchmark is installed
377385function fio_install() {
378- if [ " $postprocess_only " == " n" ]; then
386+ if [ " $postprocess_only " = " n" ]; then
379387 if check_install_rpm $benchmark_rpm $ver ; then
380- debug_log " [$script_name ]$benchmark_rpm is installed"
388+ debug_log " [$script_name ]$benchmark_rpm $ver is installed"
381389 else
382- debug_log " [$script_name ]$benchmark_rpm installation failed, exiting"
390+ debug_log " [$script_name ]$benchmark_rpm $ver installation failed, exiting"
383391 exit 1
384- fi
392+ fi
393+
385394 fi
386395 if [ ! -z " $clients " ] ; then
387396 debug_log " verifying clients have fio installed"
388397 echo " verifying clients have fio installed"
389398 for client in ` echo $clients | sed -e s/,/" " /g` ; do
390- ssh $ssh_opts $client ${pbench_install_dir} /bench-scripts/$script_name --install &
399+ ssh $ssh_opts $client ${pbench_install_dir} /bench-scripts/$script_name --remote-only -- install &
391400 done
392401 wait
393402 fi
394- if [ " $install_only " == " y" ]; then
395- exit 0
403+ }
404+
405+ # install python-pandas on the controller: fiologparser_hist.py needs it
406+ function pandas_install() {
407+ if [ " $postprocess_only " = " n" ]; then
408+ if check_install_rpm python-pandas; then
409+ debug_log " [$script_name ]python-pandas is installed"
410+ else
411+ debug_log " [$script_name ]python-pandas installation failed, exiting."
412+ debug_log " [$script_name ]On RHEL, python-pandas is in the EPEL repo."
413+ debug_log " [$script_name ]See https://fedoraproject.org/wiki/EPEL for details."
414+ exit 1
415+ fi
396416 fi
397417}
398418
@@ -401,7 +421,7 @@ function print_iteration {
401421 printf " \n%28s" " $1 " >> $benchmark_summary_txt_file
402422 printf " \n%s" " $1 " >> $benchmark_summary_csv_file
403423 hists=` cat $iteration_dir /reference-result/fio.job 2> /dev/null | grep " ^log_hist_msec" `
404- if [ $1 = = " iteration" ]; then
424+ if [ " $1 " = " iteration" ]; then
405425 # this is just a label, so no links here
406426 if [ ! -z " $hist_interval " ]; then
407427 printf " \n%28s %s %s %s" " iteration" " summary" " hist-results" " tools" >> $benchmark_summary_html_file
@@ -442,7 +462,7 @@ function fio_device_check() {
442462 local dev=" "
443463 local client=" "
444464 local rc=0
445- if [ " $postprocess_only " == " n" ]; then
465+ if [ " $postprocess_only " = " n" ]; then
446466 debug_log " fio_device_check() $devs $clients "
447467 for dev in ` echo $devs | sed -e s/,/" " /g` ; do
448468 if echo $dev | grep -q " ^/dev/" ; then
@@ -543,7 +563,7 @@ function fio_run_job() {
543563 local client_opts=" "
544564
545565 if [ ! -z " $client_file " ] ; then
546- typeset -i nclients=$( wc -l $client_file )
566+ typeset -i nclients=$( wc -l $client_file | cut -d ' ' -f 1 )
547567 client_opts=" --client=$client_file --max-jobs=$nclients "
548568 elif [ ! -z " $clients " ]; then
549569 local max_jobs=0
@@ -624,7 +644,7 @@ function fio_run_benchmark() {
624644 echo " Restarting iteration $iteration ($count of $total_iterations )"
625645 log " Restarting iteration $iteration ($count of $total_iterations )"
626646 fi
627- if [ " $postprocess_only " == " n" ]; then
647+ if [ " $postprocess_only " = " n" ]; then
628648 mkdir -p $iteration_dir
629649 else
630650 if [ ! -e $iteration_dir ]; then
@@ -659,7 +679,7 @@ function fio_run_benchmark() {
659679 fi
660680 benchmark_results_dir=" $iteration_dir /sample$sample "
661681 benchmark_tools_dir=" $benchmark_results_dir /tools-$tool_group "
662- if [ " $postprocess_only " == " n" ]; then
682+ if [ " $postprocess_only " = " n" ]; then
663683 mkdir -p $benchmark_results_dir
664684 fio_job_file=" $benchmark_results_dir /fio.job"
665685 fio_create_jobfile " $test_type " " $ioengine " " $block_size " " $iodepth " " $direct " " $sync " " $runtime " " $ramptime " " $file_size " " $rate_iops " " $dev " " $fio_job_file "
@@ -757,11 +777,11 @@ function fio_run_benchmark() {
757777 else
758778 # delete the tool data [and respose time log for rr tests] from the other samples to save space
759779 # this option is off by default
760- if [ " $keep_failed_tool_data " == " n" ]; then
780+ if [ " $keep_failed_tool_data " = " n" ]; then
761781 /bin/rm -rf $iteration_dir /$sample_dir /tools-* $iteration_dir /$sample_dir /response-times.txt
762782 fi
763783 # since non reference-result sample data is rarely referenced, tar it up to reduce the number of files used
764- if [ " $tar_nonref_data " == " y" ]; then
784+ if [ " $tar_nonref_data " = " y" ]; then
765785 pushd " $iteration_dir " > /dev/null; tar --create --xz --force-local --file=$sample_dir .tar.xz $sample_dir && /bin/rm -rf $sample_dir ; popd > /dev/null
766786 fi
767787 fi
@@ -850,6 +870,14 @@ function fio_print_summary() {
850870fio_process_options " $@ "
851871fio_install
852872
873+ # pandas installed only on controller
874+ if [ " $remote_only " = " n" ] ; then
875+ pandas_install
876+ fi
877+ if [ " $install_only " = " y" ]; then
878+ exit 0
879+ fi
880+
853881mkdir -p $benchmark_run_dir
854882export benchmark config
855883pbench-collect-sysinfo --group=$tool_group --dir=$benchmark_run_dir beg
0 commit comments