From bebf3df42eee40b055d7a8c1e3e45a4689fd8312 Mon Sep 17 00:00:00 2001 From: heister Date: Mon, 17 Sep 2012 20:53:30 +0000 Subject: [PATCH] add failing test for TimerOutput git-svn-id: https://svn.dealii.org/trunk@26446 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/timer_02.cc | 42 +++++++++++++++++++++++++++++++++ tests/base/timer_02/cmp/generic | 5 ++++ 2 files changed, 47 insertions(+) create mode 100644 tests/base/timer_02.cc create mode 100644 tests/base/timer_02/cmp/generic diff --git a/tests/base/timer_02.cc b/tests/base/timer_02.cc new file mode 100644 index 0000000000..7648a2f9ec --- /dev/null +++ b/tests/base/timer_02.cc @@ -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 +#include +#include +#include +#include + +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 index 0000000000..5f42bb230f --- /dev/null +++ b/tests/base/timer_02/cmp/generic @@ -0,0 +1,5 @@ + +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK -- 2.39.5