static inline int should_check_rate(struct thread_data *td)
{
+ struct thread_options *o = &td->o;
+
/*
- * No minimum rate set, always ok
+ * If some rate setting was given, we need to check it
*/
- if (!td->o.ratemin && !td->o.rate_iops_min)
- return 0;
+ if (o->rate || o->ratemin || o->rate_iops || o->rate_iops_min)
+ return 1;
- return 1;
+ return 0;
}
/*
*/
if (td->o.time_based || td->o.loops)
td->nr_done_files = 0;
+
+ /*
+ * Set the same seed to get repeatable runs
+ */
+ td_fill_rand_seeds(td);
}
void reset_all_stats(struct thread_data *td)
memcpy(&td->start, &tv, sizeof(tv));
}
-static int clear_io_state(struct thread_data *td)
+static void clear_io_state(struct thread_data *td)
{
struct fio_file *f;
unsigned int i;
- int ret;
reset_io_counters(td);
close_files(td);
-
- ret = 0;
- for_each_file(td, f, i) {
+ for_each_file(td, f, i)
f->flags &= ~FIO_FILE_DONE;
- ret = td_io_open_file(td, f);
- if (ret)
- break;
- }
-
- return ret;
}
/*
if (td_io_init(td))
goto err;
- if (open_files(td))
- goto err;
-
if (init_random_map(td))
goto err;
memcpy(&td->lastrate, &td->ts.stat_sample_time,
sizeof(td->lastrate));
- if (clear_state && clear_io_state(td))
- break;
+ if (clear_state)
+ clear_io_state(td);
prune_io_piece_log(td);
(td->io_ops->flags & FIO_UNIDIR))
continue;
- if (clear_io_state(td))
- break;
+ clear_io_state(td);
fio_gettime(&td->start, NULL);