Confusion with jobname, nrfiles, and numjobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am confused around the interaction between the jobname, nrfiles, and
numjobs parameters together and, in particular, where nrfiles == 1. In
this case, when I run fio with nrfiles=1 and numjobs=3, only one file
is created. However, if I bump nrfiles=2, 6 files are created. I can
repro this with HEAD.

FIO=fio-data-$(date +%s)

rm -rf ${FIO} && mkdir ${FIO} && \
  ./fio --name=${FIO} --directory=${FIO} --rw=write --size=1m \
  --bs=64k --scramble_buffers=1 --ioengine=sync --nrfiles=2 \
  --numjobs=3 > /dev/null && ls ${FIO} | wc -l
       6

rm -rf ${FIO} && mkdir ${FIO} && \
  ./fio --name=${FIO} --directory=${FIO} --rw=write --size=1m \
  --bs=64k --scramble_buffers=1 --ioengine=sync --nrfiles=1 \
  --numjobs=3 > /dev/null && ls ${FIO} | wc -l
       1

Note that the filename in the run with --nrfiles=1 is simply "jobname"
instead of "jobname.jobnumber.filenumber". After looking at the code,
it turns out that this happens because the job name is the same as the
directory name. A very quick code scan leads me to believe that this
comes from init.c that does this:

                if (o->nr_files == 1 && exists_and_not_file(jobname))
                        add_file(td, jobname);
                else {
                        for (i = 0; i < o->nr_files; i++)
                add_file(td, make_filename(fname, o, jobname,
td->thread_number, i));
                }

Is there a reason for the short circuit in the first case? Would be
great to document this somewhere if there is a reason the code should
stay.

Cheers,
Niraj
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux