if (td->use_aio && !td->aio_depth)
td->aio_depth = 1;
+ if (td->min_bs == -1)
+ td->min_bs = td->bs;
+ if (td->max_bs == -1)
+ td->max_bs = td->bs;
+
if (setup_rate(td))
return -1;
if (write_bw_log)
setup_log(&td->bw_log);
- if (td->min_bs == -1)
- td->min_bs = td->bs;
- if (td->max_bs == -1)
- td->max_bs = td->bs;
-
printf("Client%d: file=%s, rw=%d, prio=%d/%d, seq=%d, odir=%d, bs=%d-%d, rate=%d, aio=%d, aio_depth=%d\n", td->thread_number, filename, td->ddir, prioclass, prio, td->sequential, td->odirect, td->min_bs, td->max_bs, td->rate, td->use_aio, td->aio_depth);
return 0;
}
unsigned long spent;
int i, todo, nr_running, m_rate, t_rate;
- gettimeofday(&genesis, NULL);
-
printf("Starting %d threads\n", thread_number);
fflush(stdout);
nr_running = 0;
m_rate = t_rate = 0;
+ for (i = 0; i < thread_number; i++) {
+ td = &threads[i];
+
+ /*
+ * do file setup here so it happens sequentially,
+ * we don't want X number of threads getting their
+ * client data interspersed on disk
+ */
+ if (setup_file(td)) {
+ td->runstate = TD_REAPED;
+ todo--;
+ }
+ }
+
+ gettimeofday(&genesis, NULL);
+
while (todo) {
/*
* create threads (TD_NOT_CREATED -> TD_CREATED)
continue;
}
- /*
- * do file setup here so it happens sequentially,
- * we don't want X number of threads getting their
- * client data interspersed on disk
- */
- if (setup_file(td)) {
- td->terminate = 1;
- continue;
- }
-
td->runstate = TD_CREATED;
run_str[td->thread_number - 1] = 'C';
sem_init(&startup_sem, 1, 1);