X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Fgenzipf.c;h=4fc10ae72d8421e3407d0239d0f96c2257529d59;hb=b4dbb3cece5de5ebc723253b05f69eff1a129a6d;hp=ff0729e5bd3bae68fe6045824d69e61df1c473fa;hpb=87f5fce38c1b8fc979cea10c926973c2f2a76217;p=fio.git diff --git a/t/genzipf.c b/t/genzipf.c index ff0729e5..4fc10ae7 100644 --- a/t/genzipf.c +++ b/t/genzipf.c @@ -3,8 +3,8 @@ * what an access pattern would look like. * * For instance, the following would generate a zipf distribution - * with theta 1.2, using 262144 (1 GB / 4096) values and split the reporting into - * 20 buckets: + * with theta 1.2, using 262144 (1 GiB / 4096) values and split the + * reporting into 20 buckets: * * ./t/fio-genzipf -t zipf -i 1.2 -g 1 -b 4096 -o 20 * @@ -14,7 +14,6 @@ */ #include #include -#include #include #include @@ -49,7 +48,7 @@ enum { }; static int dist_type = TYPE_ZIPF; -static unsigned long gb_size = 500; +static unsigned long gib_size = 500; static unsigned long block_size = 4096; static unsigned long output_nranges = DEF_NR_OUTPUT; static double percentage; @@ -131,7 +130,7 @@ static int parse_options(int argc, char *argv[]) } break; case 'g': - gb_size = strtoul(optarg, NULL, 10); + gib_size = strtoul(optarg, NULL, 10); break; case 'i': dist_val = atof(optarg); @@ -227,7 +226,7 @@ static void output_normal(struct node *nodes, unsigned long nnodes, if (percentage) { if (total_vals >= blocks) { - double cs = i * block_size / (1024 * 1024); + double cs = (double) i * block_size / (1024.0 * 1024.0); char p = 'M'; if (cs > 1024.0) { @@ -291,9 +290,10 @@ int main(int argc, char *argv[]) return 1; if (output_type != OUTPUT_CSV) - printf("Generating %s distribution with %f input and %lu GB size and %lu block_size.\n", dist_types[dist_type], dist_val, gb_size, block_size); + printf("Generating %s distribution with %f input and %lu GiB size and %lu block_size.\n", + dist_types[dist_type], dist_val, gib_size, block_size); - nranges = gb_size * 1024 * 1024 * 1024ULL; + nranges = gib_size * 1024 * 1024 * 1024ULL; nranges /= block_size; if (dist_type == TYPE_ZIPF)