]> https://gitweb.dealii.org/ - dealii.git/commitdiff
minor cleanup
authorMatthias Maier <tamiko@43-1.org>
Fri, 11 Mar 2022 21:18:44 +0000 (15:18 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 11 Mar 2022 21:46:34 +0000 (15:46 -0600)
 - switch to std::uint64_t
 - use DEAL_II_FALLTHROUGH;

tests/performance/instrumentation_step_22.cc
tests/performance/instrumentation_step_3.cc
tests/performance/performance_test_driver.h
tests/performance/timing_step_22.cc
tests/performance/timing_step_3.cc
tests/performance/valgrind_instrumentation.h

index c177b7ecb9edad2be0faa66eeac688dd9917d8b2..0d7bfb81d05a2b61540c74a4bd704d211a638309 100644 (file)
@@ -579,7 +579,7 @@ template <int dim>
 Measurement
 StokesProblem<dim>::run()
 {
-  std::map<std::string, unsigned long long> cycle_count;
+  std::map<std::string, std::uint64_t> cycle_count;
 
   {
     std::vector<unsigned int> subdivisions(dim, 1);
@@ -611,7 +611,7 @@ StokesProblem<dim>::run()
         triangulation.refine_global(4 - dim);
         break;
       case TestingEnvironment::medium:
-        /* fallthrough */
+        DEAL_II_FALLTHROUGH;
       case TestingEnvironment::heavy:
         triangulation.refine_global(5 - dim);
         break;
index 5857b20fe2e2fe1fed99e2c814727ef6b595297b..8914cb0c3bacb5bdc9b98b99fe343b802bc0cb24 100644 (file)
@@ -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<std::string, unsigned long long> cycle_count;
+  std::map<std::string, std::uint64_t> cycle_count;
 
   callgrind_wrapper::start_instrumentation();
   make_grid();
index 09da47fc2e611a9039579311db2e4334ec678aa3..e662f843f2df07086f6814935d24a28317dba612 100644 (file)
@@ -97,7 +97,7 @@ describe_measurements();
 /**
  * The Measurement type returned by perform_single_measurement(). We
  * support returning a <code>std::vector<double></code> for timings or a
- * <code>std::vector<unsigned long long></code> for instruction counts.
+ * <code>std::vector<std::uint64_t></code> 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<unsigned long long> results)
+  Measurement(std::initializer_list<std::uint64_t> results)
     : instruction_count(results)
   {}
 
-  std::vector<double>             timing;
-  std::vector<unsigned long long> instruction_count;
+  std::vector<double>        timing;
+  std::vector<std::uint64_t> 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;
         }
index 4631e48a3b175f176e1df7fe17c9d9ca2e4a0dd5..99bcee9d60271cbf7f8ccffe109776dfc31a4380 100644 (file)
@@ -609,7 +609,7 @@ StokesProblem<dim>::run()
         triangulation.refine_global(5 - dim);
         break;
       case TestingEnvironment::medium:
-        /* fallthrough */
+        DEAL_II_FALLTHROUGH;
       case TestingEnvironment::heavy:
         triangulation.refine_global(6 - dim);
         break;
index 609ab92affe9d59bf37179e2763567c2bce1107a..8bb6fe465d0124c3f3128eda6346ba7387d737d4 100644 (file)
@@ -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;
index b8b9dc22573cb6e38fad0bdcbc5adadd3bf3ad83..c2554f1c5b7d1d9b20f391731f5846db53ef5a9c 100644 (file)
@@ -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)
       {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.