Skip to content

Commit 35c5734

Browse files
committed
minor stylistic change
1 parent 3e2a531 commit 35c5734

8 files changed

+20
-18
lines changed

include/builders/external_memory_builder_partitioned_phf.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct external_memory_builder_partitioned_phf {
3030
build_timings timings;
3131
if (config.verbose) {
3232
std::cout << "num_partitions " << num_partitions << std::endl;
33-
std::cout << "using " << static_cast<double>(config.ram) / 1000000000 << " GB of RAM"
33+
std::cout << "using " << static_cast<double>(config.ram) / 1'000'000'000 << " GB of RAM"
3434
<< std::endl;
3535
}
3636

include/builders/external_memory_builder_single_phf.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ struct external_memory_builder_single_phf {
6666
if (bitmap_taken_bytes + hashed_pilots_cache_bytes >= ram) {
6767
std::stringstream ss;
6868
ss << "not enough RAM available, the bitmap alone takes "
69-
<< static_cast<double>(bitmap_taken_bytes) / 1000000000 << " GB of space.";
69+
<< static_cast<double>(bitmap_taken_bytes) / 1'000'000'000 << " GB of space.";
7070
throw std::runtime_error(ss.str());
7171
}
7272

7373
if (config.verbose) {
74-
constexpr uint64_t GB = 1000000000;
74+
constexpr uint64_t GB = 1'000'000'000;
7575
uint64_t peak = num_keys * (sizeof(bucket_payload_pair) + sizeof(uint64_t)) +
7676
(num_keys + num_buckets) * sizeof(uint64_t);
7777
std::cout << "lambda (avg. bucket size) = " << config.lambda << std::endl;
@@ -100,7 +100,7 @@ struct external_memory_builder_single_phf {
100100
auto stop = clock_type::now();
101101
if (config.verbose) {
102102
std::cout << " == map+sort " << tfm.get_num_pairs_files()
103-
<< " files(s) took: " << to_microseconds(stop - start) / 1000000
103+
<< " files(s) took: " << to_microseconds(stop - start) / 1'000'000
104104
<< " seconds" << std::endl;
105105
}
106106
start = clock_type::now();
@@ -112,8 +112,9 @@ struct external_memory_builder_single_phf {
112112
tfm.remove_all_pairs_files();
113113
stop = clock_type::now();
114114
if (config.verbose) {
115-
std::cout << " == merge+check took: " << to_microseconds(stop - start) / 1000000
116-
<< " seconds" << std::endl;
115+
std::cout << " == merge+check took: "
116+
<< to_microseconds(stop - start) / 1'000'000 << " seconds"
117+
<< std::endl;
117118
std::cout << " == max bucket size = " << int(tfm.max_bucket_size())
118119
<< std::endl;
119120
}

include/builders/internal_memory_builder_single_phf.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ struct internal_memory_builder_single_phf {
9090
map(hashes, num_keys, pairs_blocks, config);
9191
auto elapsed = to_microseconds(clock_type::now() - start);
9292
if (config.verbose) {
93-
std::cout << " == map+sort took: " << elapsed / 1000000 << " seconds" << std::endl;
93+
std::cout << " == map+sort took: " << elapsed / 1'000'000 << " seconds"
94+
<< std::endl;
9495
}
9596

9697
start = clock_type::now();
9798
merge(pairs_blocks, buckets, config.verbose);
9899
elapsed = to_microseconds(clock_type::now() - start);
99100
if (config.verbose) {
100-
std::cout << " == merge+check took: " << elapsed / 1000000 << " seconds"
101+
std::cout << " == merge+check took: " << elapsed / 1'000'000 << " seconds"
101102
<< std::endl;
102103
}
103104
}
@@ -106,7 +107,7 @@ struct internal_memory_builder_single_phf {
106107
time.mapping_ordering_microseconds = to_microseconds(clock_type::now() - start);
107108
if (config.verbose) {
108109
std::cout << " == mapping+ordering took "
109-
<< time.mapping_ordering_microseconds / 1000000 << " seconds " << std::endl;
110+
<< time.mapping_ordering_microseconds / 1'000'000 << " seconds " << std::endl;
110111
buckets.print_bucket_size_distribution();
111112
}
112113

@@ -129,7 +130,7 @@ struct internal_memory_builder_single_phf {
129130
}
130131
time.searching_microseconds = to_microseconds(clock_type::now() - start);
131132
if (config.verbose) {
132-
std::cout << " == search took " << time.searching_microseconds / 1000000 << " seconds"
133+
std::cout << " == search took " << time.searching_microseconds / 1'000'000 << " seconds"
133134
<< std::endl;
134135
}
135136

src/build.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ int main(int argc, char** argv) {
465465
/* Optional arguments. */
466466
constexpr bool OPTIONAL = !REQUIRED;
467467
parser.add("alpha",
468-
"The table load factor. It must be a quantity > 0 and <= 1 (Defaults is " +
468+
"The table load factor. It must be a quantity > 0 and <= 1 (Default is " +
469469
std::to_string(constants::default_alpha) + ").",
470470
"-a", OPTIONAL);
471471
parser.add("avg_partition_size", "Average partition size for HEM.", "-p", OPTIONAL);

src/example.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ int main() {
77
using namespace pthash;
88

99
/* Generate 1M random 64-bit keys as input data. */
10-
static const uint64_t num_keys = 1000000;
10+
static const uint64_t num_keys = 1'000'000;
1111
static const uint64_t seed = 1234567890;
1212
std::cout << "generating input data..." << std::endl;
1313
auto keys = distinct_uints<uint64_t>(num_keys, seed);
@@ -21,7 +21,7 @@ int main() {
2121
config.lambda = 5;
2222
config.alpha = 0.97;
2323
config.verbose = true;
24-
config.avg_partition_size = 100000;
24+
config.avg_partition_size = 100'000;
2525
config.num_threads = 4;
2626
config.dense_partitioning = true;
2727

@@ -54,9 +54,9 @@ int main() {
5454
double total_microseconds = timings.partitioning_microseconds +
5555
timings.mapping_ordering_microseconds +
5656
timings.searching_microseconds + timings.encoding_microseconds;
57-
std::cout << "function built in " << to_microseconds(clock_type::now() - start) / 1000000
57+
std::cout << "function built in " << to_microseconds(clock_type::now() - start) / 1'000'000
5858
<< " seconds" << std::endl;
59-
std::cout << "computed: " << total_microseconds / 1000000 << " seconds" << std::endl;
59+
std::cout << "computed: " << total_microseconds / 1'000'000 << " seconds" << std::endl;
6060

6161
/* Compute and print the number of bits spent per key. */
6262
double bits_per_key = static_cast<double>(f.num_bits()) / f.num_keys();

test/test_internal_memory_dense_partitioned_mphf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void test_internal_memory_dense_partitioned_mphf(Iterator keys, uint64_t num_key
5252
}
5353

5454
int main() {
55-
static const uint64_t universe = 100000;
55+
static const uint64_t universe = 100'000;
5656
for (int i = 0; i != 5; ++i) {
5757
uint64_t num_keys = constants::table_size_per_partition + (random_value() % universe);
5858
std::vector<uint64_t> keys = distinct_uints<uint64_t>(num_keys, random_value());

test/test_internal_memory_partitioned_mphf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void test_internal_memory_partitioned_mphf(Iterator keys, uint64_t num_keys) {
2424
config.verbose = false;
2525
config.seed = random_value();
2626

27-
std::vector<uint64_t> avg_partition_size{1000, 10000, 100000, 1000000};
27+
std::vector<uint64_t> avg_partition_size{1'000, 10'000, 100'000, 1'000'000};
2828
std::vector<double> L{4.0, 4.5, 5.0, 5.5, 6.0};
2929
std::vector<double> A{1.0, 0.99, 0.98, 0.97, 0.96};
3030
for (auto lambda : L) {

test/test_internal_memory_single_mphf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void test_internal_memory_single_mphf(Iterator keys, uint64_t num_keys) {
5555
}
5656

5757
int main() {
58-
static const uint64_t universe = 100000;
58+
static const uint64_t universe = 100'000;
5959
for (int i = 0; i != 5; ++i) {
6060
uint64_t num_keys = random_value() % universe;
6161
if (num_keys == 0) num_keys = 1;

0 commit comments

Comments
 (0)