diff --git a/filesetup.c b/filesetup.c index 84eaed6..aa908ad 100644 --- a/filesetup.c +++ b/filesetup.c @@ -752,7 +752,7 @@ uint64_t get_start_offset(struct thread_data *td, struct fio_file *f) return f->real_file_size; return td->o.start_offset + - (td->thread_number - 1) * td->o.offset_increment; + td->subjob_number * td->o.offset_increment; } /* diff --git a/fio.1 b/fio.1 index 62f40ea..10f4b77 100644 --- a/fio.1 +++ b/fio.1 @@ -658,9 +658,10 @@ Offset in the file to start I/O. Data before the offset will not be touched. .BI offset_increment \fR=\fPint If this is provided, then the real offset becomes the offset + offset_increment * thread_number, where the thread number is a counter -that starts at 0 and is incremented for each job. This option is useful if -there are several jobs which are intended to operate on a file in parallel in -disjoint segments, with even spacing between the starting points. +that starts at 0 and is incremented for each sub-job (i.e. when numjobs option +is specified). This option is useful if there are several jobs which are +intended to operate on a file in parallel in disjoint segments, with even +spacing between the starting points. .TP .BI number_ios \fR=\fPint Fio will normally perform IOs until it has exhausted the size of the region diff --git a/fio.h b/fio.h index 4d4af0a..b0c247e 100644 --- a/fio.h +++ b/fio.h @@ -101,6 +101,7 @@ struct thread_data { char verror[FIO_VERROR_SIZE]; pthread_t thread; unsigned int thread_number; + unsigned int subjob_number; unsigned int groupid; struct thread_stat ts; diff --git a/init.c b/init.c index a546861..a454e5e 100644 --- a/init.c +++ b/init.c @@ -363,6 +363,7 @@ static struct thread_data *get_new_job(int global, struct thread_data *parent, profile_add_hooks(td); td->thread_number = thread_number; + td->subjob_number = 0; if (!parent->o.group_reporting) stat_number++; @@ -1198,6 +1199,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, td_new->o.numjobs = 1; td_new->o.stonewall = 0; td_new->o.new_group = 0; + td_new->subjob_number = numjobs; if (file_alloced) { if (td_new->files) {