]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add failing test for TimerOutput
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Sep 2012 20:53:30 +0000 (20:53 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Sep 2012 20:53:30 +0000 (20:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@26446 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/timer_02.cc [new file with mode: 0644]
tests/base/timer_02/cmp/generic [new file with mode: 0644]

diff --git a/tests/base/timer_02.cc b/tests/base/timer_02.cc
new file mode 100644 (file)
index 0000000..7648a2f
--- /dev/null
@@ -0,0 +1,42 @@
+//----------------------------  timer.cc  ---------------------------
+//    $Id: timer.cc 23710 2011-05-17 04:50:10Z bangerth $
+//    Version: $Name$ 
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//----------------------------  timer.cc  ---------------------------
+
+// TimerOutput is calling MPI functions internally when deal.II is
+// configured with MPI. This creates an error of the form:
+// *** The MPI_Allreduce() function was called before MPI_INIT was invoked.
+// *** This is disallowed by the MPI standard.
+// *** Your MPI job will now abort.
+
+#include "../tests.h"
+#include <deal.II/base/timer.h>
+#include <deal.II/base/logstream.h>
+#include <fstream>
+#include <cmath>
+#include <iomanip>
+
+int main ()
+{
+  std::ofstream logfile("timer/output");
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  TimerOutput t(std::cout, TimerOutput::summary, TimerOutput::cpu_times);
+
+  t.enter_subsection("hi");
+  t.leave_subsection("hi");
+
+  t.print_summary();
+  deallog << "ok" << std::endl;
+}
+
diff --git a/tests/base/timer_02/cmp/generic b/tests/base/timer_02/cmp/generic
new file mode 100644 (file)
index 0000000..5f42bb2
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL::OK
+DEAL::OK
+DEAL::OK
+DEAL::OK

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.