double val;
char *nr;
- if (td->o.random_distribution == FIO_RAND_DIST_RANDOM)
+ if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
+ val = 1.1;
+ else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
+ val = 0.2;
+ else
return 0;
nr = get_opt_postfix(str);
- if (!nr)
- val = 0.6;
- else if (!str_to_float(nr, &val)) {
+ if (nr && !str_to_float(nr, &val)) {
log_err("fio: random postfix parsing failed\n");
free(nr);
return 1;
}
- td->o.zipf_theta = val;
free(nr);
+
+ if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) {
+ if (val == 1.00) {
+ log_err("fio: zipf theta must different than 1.0\n");
+ return 1;
+ }
+ td->o.zipf_theta = val;
+ } else {
+ if (val <= 0.00 || val >= 1.00) {
+ log_err("fio: pareto input out of range (0 < input < 1.0)\n");
+ return 1;
+ }
+ td->o.pareto_h = val;
+ }
+
return 0;
}
.oval = FIO_RAND_DIST_ZIPF,
.help = "Zipf distribution",
},
+ { .ival = "pareto",
+ .oval = FIO_RAND_DIST_PARETO,
+ .help = "Pareto distribution",
+ },
},
},
{