o->fsync_on_close = le32_to_cpu(top->fsync_on_close);
o->bs_is_seq_rand = le32_to_cpu(top->bs_is_seq_rand);
o->random_distribution = le32_to_cpu(top->random_distribution);
- o->gauss_dev = le32_to_cpu(top->gauss_dev);
o->zipf_theta.u.f = fio_uint64_to_double(le64_to_cpu(top->zipf_theta.u.i));
o->pareto_h.u.f = fio_uint64_to_double(le64_to_cpu(top->pareto_h.u.i));
+ o->gauss_dev.u.f = fio_uint64_to_double(le64_to_cpu(top->gauss_dev.u.i));
o->random_generator = le32_to_cpu(top->random_generator);
o->hugepage_size = le32_to_cpu(top->hugepage_size);
o->rw_min_bs = le32_to_cpu(top->rw_min_bs);
top->fsync_on_close = cpu_to_le32(o->fsync_on_close);
top->bs_is_seq_rand = cpu_to_le32(o->bs_is_seq_rand);
top->random_distribution = cpu_to_le32(o->random_distribution);
- top->gauss_dev = cpu_to_le32(o->gauss_dev);
top->zipf_theta.u.i = __cpu_to_le64(fio_double_to_uint64(o->zipf_theta.u.f));
top->pareto_h.u.i = __cpu_to_le64(fio_double_to_uint64(o->pareto_h.u.f));
+ top->gauss_dev.u.i = __cpu_to_le64(fio_double_to_uint64(o->gauss_dev.u.f));
top->random_generator = cpu_to_le32(o->random_generator);
top->hugepage_size = cpu_to_le32(o->hugepage_size);
top->rw_min_bs = cpu_to_le32(o->rw_min_bs);
else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
pareto_init(&f->zipf, nranges, td->o.pareto_h.u.f, seed);
else if (td->o.random_distribution == FIO_RAND_DIST_GAUSS)
- gauss_init(&f->gauss, nranges, td->o.gauss_dev, seed);
+ gauss_init(&f->gauss, nranges, td->o.gauss_dev.u.f, seed);
return 1;
}
return __hash_u64(sum) % gs->nranges;
}
-void gauss_init(struct gauss_state *gs, unsigned long nranges, unsigned int d,
+void gauss_init(struct gauss_state *gs, unsigned long nranges, double dev,
unsigned int seed)
{
memset(gs, 0, sizeof(*gs));
init_rand_seed(&gs->r, seed);
gs->nranges = nranges;
- if (d) {
- gs->stddev = (nranges * 100) / d;
+
+ if (dev != 0.0) {
+ gs->stddev = ceil((double) (nranges * 100.0) / dev);
if (gs->stddev > nranges / 2)
gs->stddev = nranges / 2;
}
unsigned int stddev;
};
-void gauss_init(struct gauss_state *gs, unsigned long nranges, unsigned int d,
+void gauss_init(struct gauss_state *gs, unsigned long nranges, double dev,
unsigned int seed);
unsigned long long gauss_next(struct gauss_state *gs);
log_err("fio: normal deviation out of range (0 < input < 100.0)\n");
return 1;
}
- td->o.gauss_dev = val;
+ td->o.gauss_dev.u.f = val;
}
return 0;
unsigned int verify_only;
unsigned int random_distribution;
- unsigned int gauss_dev;
fio_fp64_t zipf_theta;
fio_fp64_t pareto_h;
+ fio_fp64_t gauss_dev;
unsigned int random_generator;
uint32_t bs_is_seq_rand;
uint32_t random_distribution;
- uint32_t gauss_dev;
+ uint32_t pad;
+
fio_fp64_t zipf_theta;
fio_fp64_t pareto_h;
+ fio_fp64_t gauss_dev;
uint32_t random_generator;