From be54b526d18990451140d260d022be5d4db25de0 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 11 Mar 2022 15:18:44 -0600 Subject: [PATCH] minor cleanup - switch to std::uint64_t - use DEAL_II_FALLTHROUGH; --- tests/performance/instrumentation_step_22.cc | 4 ++-- tests/performance/instrumentation_step_3.cc | 4 ++-- tests/performance/performance_test_driver.h | 10 +++++----- tests/performance/timing_step_22.cc | 2 +- tests/performance/timing_step_3.cc | 2 +- tests/performance/valgrind_instrumentation.h | 18 +++++++++--------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/performance/instrumentation_step_22.cc b/tests/performance/instrumentation_step_22.cc index c177b7ecb9..0d7bfb81d0 100644 --- a/tests/performance/instrumentation_step_22.cc +++ b/tests/performance/instrumentation_step_22.cc @@ -579,7 +579,7 @@ template Measurement StokesProblem::run() { - std::map cycle_count; + std::map cycle_count; { std::vector subdivisions(dim, 1); @@ -611,7 +611,7 @@ StokesProblem::run() triangulation.refine_global(4 - dim); break; case TestingEnvironment::medium: - /* fallthrough */ + DEAL_II_FALLTHROUGH; case TestingEnvironment::heavy: triangulation.refine_global(5 - dim); break; diff --git a/tests/performance/instrumentation_step_3.cc b/tests/performance/instrumentation_step_3.cc index 5857b20fe2..8914cb0c3b 100644 --- a/tests/performance/instrumentation_step_3.cc +++ b/tests/performance/instrumentation_step_3.cc @@ -103,7 +103,7 @@ Step3::make_grid() triangulation.refine_global(6); break; case TestingEnvironment::medium: - /* fallthrough */ + DEAL_II_FALLTHROUGH; case TestingEnvironment::heavy: triangulation.refine_global(7); break; @@ -217,7 +217,7 @@ Step3::output_results() const Measurement Step3::run() { - std::map cycle_count; + std::map cycle_count; callgrind_wrapper::start_instrumentation(); make_grid(); diff --git a/tests/performance/performance_test_driver.h b/tests/performance/performance_test_driver.h index 09da47fc2e..e662f843f2 100644 --- a/tests/performance/performance_test_driver.h +++ b/tests/performance/performance_test_driver.h @@ -97,7 +97,7 @@ describe_measurements(); /** * The Measurement type returned by perform_single_measurement(). We * support returning a std::vector for timings or a - * std::vector for instruction counts. + * std::vector for instruction counts. * * Note that the following could be improved using std::variant once we * switch to C++17. @@ -108,12 +108,12 @@ struct Measurement : timing(results) {} - Measurement(std::initializer_list results) + Measurement(std::initializer_list results) : instruction_count(results) {} - std::vector timing; - std::vector instruction_count; + std::vector timing; + std::vector instruction_count; }; @@ -234,7 +234,7 @@ main(int argc, char *argv[]) break; case Metric::instruction_count: - const unsigned long long x = measurements[0].instruction_count[i]; + const std::uint64_t x = measurements[0].instruction_count[i]; pout << names[i] << "\t" << x << "\n"; break; } diff --git a/tests/performance/timing_step_22.cc b/tests/performance/timing_step_22.cc index 4631e48a3b..99bcee9d60 100644 --- a/tests/performance/timing_step_22.cc +++ b/tests/performance/timing_step_22.cc @@ -609,7 +609,7 @@ StokesProblem::run() triangulation.refine_global(5 - dim); break; case TestingEnvironment::medium: - /* fallthrough */ + DEAL_II_FALLTHROUGH; case TestingEnvironment::heavy: triangulation.refine_global(6 - dim); break; diff --git a/tests/performance/timing_step_3.cc b/tests/performance/timing_step_3.cc index 609ab92aff..8bb6fe465d 100644 --- a/tests/performance/timing_step_3.cc +++ b/tests/performance/timing_step_3.cc @@ -101,7 +101,7 @@ Step3::make_grid() triangulation.refine_global(9); break; case TestingEnvironment::medium: - /* fallthrough */ + DEAL_II_FALLTHROUGH; case TestingEnvironment::heavy: triangulation.refine_global(10); break; diff --git a/tests/performance/valgrind_instrumentation.h b/tests/performance/valgrind_instrumentation.h index b8b9dc2257..c2554f1c5b 100644 --- a/tests/performance/valgrind_instrumentation.h +++ b/tests/performance/valgrind_instrumentation.h @@ -65,11 +65,11 @@ namespace callgrind_wrapper CALLGRIND_DUMP_STATS_AT("callgrind-wrapper-token"); CALLGRIND_STOP_INSTRUMENTATION; - std::ifstream callgrind_output("callgrind.out"); - std::string token; - unsigned long long cycles = 0ull; - bool found_token = false; - unsigned long found_pid = 0; + std::ifstream callgrind_output("callgrind.out"); + std::string token; + std::uint64_t cycles = 0ull; + bool found_token = false; + unsigned long found_pid = 0; while (callgrind_output) { @@ -117,15 +117,15 @@ namespace callgrind_wrapper * executed since the last start_instrumentation() call. */ DEAL_II_ALWAYS_INLINE - inline unsigned long long + inline std::uint64_t stop_instrumentation() { CALLGRIND_DUMP_STATS; CALLGRIND_STOP_INSTRUMENTATION; - std::ifstream callgrind_output("callgrind.out"); - std::string token; - unsigned long long cycles = 0ull; + std::ifstream callgrind_output("callgrind.out"); + std::string token; + std::uint64_t cycles = 0ull; while (callgrind_output) { -- 2.39.5