Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
mschimek committed May 24, 2024
1 parent f313387 commit b116a74
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/measurements/measurement_test_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ struct AggregatedDataSummary {
bool are_entries_consistent{true}; // number of values and value category are the same for all entries.
size_t num_entries{0u}; // number of entries per measurement, might be greater then one if for example
// counter/timer.append() has been called multiple times.
size_t num_values_per_entry{0u
}; // number of values per entry, might be greater than one if global aggregation mode "Gather" is executed.
size_t num_values_per_entry{
0u}; // number of values per entry, might be greater than one if global aggregation mode "Gather" is executed.
std::optional<std::vector<std::vector<T>>> aggregated_data;

bool operator==(AggregatedDataSummary<T> const& other) const {
Expand Down
30 changes: 20 additions & 10 deletions tests/measurements/mpi_timer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ TEST(TimerTest, basics) {

if (comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
EXPECT_EQ(printer.output, expected_output);
}
}
Expand All @@ -57,7 +58,8 @@ TEST(TimerTest, basics_append) {

if (comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(1).set_is_scalar(true)}};
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(1).set_is_scalar(true)}};
EXPECT_EQ(printer.output, expected_output);
}
}
Expand All @@ -75,7 +77,8 @@ TEST(TimerTest, basics_accumulate) {

if (comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
EXPECT_EQ(printer.output, expected_output);
}
}
Expand All @@ -93,8 +96,10 @@ TEST(TimerTest, stop_and_append_multiple_operations) {

if (comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:min", AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:min",
AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:gather",
AggregatedDataSummary{}.set_num_entries(2).set_num_values_per_entry(comm.size()).set_is_scalar(false)}};

Expand All @@ -115,8 +120,10 @@ TEST(TimerTest, stop_and_add_multiple_operations) {

if (comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:min", AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:min",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)},
{"root.measurement:gather",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(comm.size()).set_is_scalar(false)}};
EXPECT_EQ(printer.output, expected_output);
Expand All @@ -139,7 +146,8 @@ TEST(TimerTest, stop_nested_scenario) {
printer.print(aggregated_timer_tree.root());

if (comm.is_root()) {
auto const expected_summary = AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true);
auto const expected_summary =
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true);
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement1:max", expected_summary},
{"root.measurement1.measurement11:max", expected_summary},
Expand Down Expand Up @@ -249,7 +257,8 @@ TEST(TimerTest, aggregate_and_print_non_trivial_communicator) {

if (split_comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
EXPECT_EQ(printer.output, expected_output);
}
}
Expand Down Expand Up @@ -278,7 +287,8 @@ TEST(TimerTest, singleton) {

if (comm.is_root()) {
std::unordered_map<std::string, AggregatedDataSummary<>> expected_output{
{"root.measurement:max", AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
{"root.measurement:max",
AggregatedDataSummary{}.set_num_entries(1).set_num_values_per_entry(1).set_is_scalar(true)}};
EXPECT_EQ(printer.output, expected_output);
}
}
Expand Down

0 comments on commit b116a74

Please sign in to comment.