Skip to content

Commit 1e1ded0

Browse files
committed
Merge pull request #109 from ekuric/master
enable pbench_fio to accept numjobs parameter
2 parents 0cdd462 + cc79628 commit 1e1ded0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

agent/bench-scripts/pbench_fio

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ test_types="read,randread" # default is -non- destructive
3939
block_sizes="4,64,1024"
4040
targets="/tmp/fio"
4141
directory=""
42+
numjobs=""
4243
runtime=30
4344
ramptime=5
4445
iodepth=32
@@ -100,10 +101,12 @@ function fio_usage() {
100101
printf "\t\tprovide the path of an existig result (typically somewhere in $pbench_run\n"
101102
printf -- "\t--directory=<path>\n"
102103
printf "\t\tprovide the path to an existing directory where fio operations will be performed\n"
104+
printf -- "\t--numjobs=<int>\n"
105+
printf "\t\tnumber of jobs to run, if not given then fio default of numjobs=1 will be used\n"
103106
}
104107

105108
function fio_process_options() {
106-
opts=$(getopt -q -o jic:t:b:s:d:r: --longoptions "help,max-stddev:,max-failures:,samples:,direct:,sync:,install,clients:,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:" -n "getopt.sh" -- "$@");
109+
opts=$(getopt -q -o jic:t:b:s:d:r: --longoptions "help,max-stddev:,max-failures:,samples:,direct:,sync:,install,clients:,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:" -n "getopt.sh" -- "$@");
107110
if [ $? -ne 0 ]; then
108111
printf "\t${benchmark}: you specified an invalid option\n\n"
109112
fio_usage
@@ -266,6 +269,13 @@ function fio_process_options() {
266269
directory="$1"
267270
shift;
268271
fi
272+
;;
273+
--numjobs)
274+
shift;
275+
if [ -n "$1" ]; then
276+
numjobs="$1"
277+
shift;
278+
fi
269279
;;
270280
--)
271281
shift;
@@ -418,6 +428,9 @@ function fio_create_jobfile() {
418428
else
419429
printf "filename=%s\n" $target >>$fio_job_file
420430
fi
431+
if [ ! -z "$numjobs" ]; then
432+
printf "numjobs=$numjobs\n" >>$fio_job_file
433+
fi
421434
let job_num=$job_num+1
422435
done
423436

0 commit comments

Comments
 (0)