]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Temporarily check the MFlops rate for matrix-vector-product. Remove this next time...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 20 May 1998 17:10:49 +0000 (17:10 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 20 May 1998 17:10:49 +0000 (17:10 +0000)
git-svn-id: https://svn.dealii.org/trunk@326 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/Attic/examples/convergence/convergence.cc
tests/big-tests/convergence/convergence.cc

index b2424130dc329343c4381a0e99bbf3d77fca5f59..32377e0c1d5b380076499376a851162e2995d78d 100644 (file)
@@ -223,7 +223,7 @@ void PoissonProblem<dim>::create_new () {
 
 
 
-
+#include <basic/timer.h>
 
 template <int dim>
 void PoissonProblem<dim>::run (const unsigned int level) {
@@ -261,6 +261,20 @@ void PoissonProblem<dim>::run (const unsigned int level) {
   cout << "    Solving..." << endl;
   solve ();
 
+  if (true) 
+    {
+      cout << "    Checking performance... " << flush;
+      dVector tmp(solution.size());
+      Timer timer;
+      const unsigned int n_loops=200;
+      for (unsigned int i=0; i<n_loops; ++i)
+       system_matrix.vmult (tmp, solution);
+      double time = timer.stop();
+      cout << 2.0*system_matrix.n_nonzero_elements()/time/1e6*n_loops
+          << " MFlops (" << time << " seconds)."  << endl;
+    };
+  
+
   Solution<dim> sol;
   dVector       l1_error_per_cell, l2_error_per_cell, linfty_error_per_cell;
   dVector       h1_seminorm_error_per_cell, h1_error_per_cell;
index b2424130dc329343c4381a0e99bbf3d77fca5f59..32377e0c1d5b380076499376a851162e2995d78d 100644 (file)
@@ -223,7 +223,7 @@ void PoissonProblem<dim>::create_new () {
 
 
 
-
+#include <basic/timer.h>
 
 template <int dim>
 void PoissonProblem<dim>::run (const unsigned int level) {
@@ -261,6 +261,20 @@ void PoissonProblem<dim>::run (const unsigned int level) {
   cout << "    Solving..." << endl;
   solve ();
 
+  if (true) 
+    {
+      cout << "    Checking performance... " << flush;
+      dVector tmp(solution.size());
+      Timer timer;
+      const unsigned int n_loops=200;
+      for (unsigned int i=0; i<n_loops; ++i)
+       system_matrix.vmult (tmp, solution);
+      double time = timer.stop();
+      cout << 2.0*system_matrix.n_nonzero_elements()/time/1e6*n_loops
+          << " MFlops (" << time << " seconds)."  << endl;
+    };
+  
+
   Solution<dim> sol;
   dVector       l1_error_per_cell, l2_error_per_cell, linfty_error_per_cell;
   dVector       h1_seminorm_error_per_cell, h1_error_per_cell;

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.