From: maier Date: Wed, 16 Oct 2013 11:45:44 +0000 (+0000) Subject: Remove DeadlockKiller from tests. The rationale is X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8612325a05147a5bbde7298ad3ddea126212afd8;p=dealii-svn.git Remove DeadlockKiller from tests. The rationale is (a) it is no longer necessary with ctest which will take care of killing deadlocked tests, too. (b) exiting on the main thread without joining the other threads first violates current language standard - so a significant rewrite would be necessary git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31254 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/bits/data_out_curved_cells.cc b/tests/bits/data_out_curved_cells.cc index 0ea4b99d79..cfe6a99c92 100644 --- a/tests/bits/data_out_curved_cells.cc +++ b/tests/bits/data_out_curved_cells.cc @@ -256,14 +256,6 @@ int main () deallog.depth_console(0); deallog.threshold_double(1.e-10); - // this test, for reasons unknown - // to me, appears to deadlock at - // times. make sure we kill it - // after some time -#ifdef DEAL_II_WITH_THREADS - DeadlockKiller killer; -#endif - curved_grid (logfile); } diff --git a/tests/bits/fe_system.cc b/tests/bits/fe_system.cc index 5e1db16cfa..f871d9a8bb 100644 --- a/tests/bits/fe_system.cc +++ b/tests/bits/fe_system.cc @@ -44,11 +44,6 @@ template void test() { -#ifdef DEAL_II_WITH_THREADS - - DeadlockKiller killer; -#endif - // 0 components is not okay FESystem fe(FE_Q(1), 1, FE_Q(2), 0); Triangulation tria; diff --git a/tests/tests.h b/tests/tests.h index f94966866e..fadd4b7fc6 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -301,66 +301,6 @@ struct SetGrainSizes } set_grain_sizes; - - -// spawn a thread that terminates the program after a certain time -// given by the environment variable WALLTIME. this makes -// sure we don't let jobs that deadlock on some mutex hang around -// forever. note that this is orthogonal to using "ulimit" in -// Makefile.rules, which only affects CPU time and consequently works -// on infinite loops but not deadlocks -// -// the actual sleep time isn't all that important. the point is that -// we need to kill deadlocked threads at one point, whenever that is -#ifdef DEAL_II_WITH_THREADS - -struct DeadlockKiller -{ -private: - static void nuke_it () - { - char *env = std::getenv("WALLTIME"); - - if (env != 0) - { - std::istringstream conv (env); - int delay; - conv >> delay; - if (conv) - { - sleep (delay); - std::cerr << "Time's up: Killing job after " - << delay - << " seconds because it overran its allowed walltime." - << std::endl; - std::abort (); - } - else - { - std::cerr << "Invalid value for WALLTIME environment variable." - << std::endl; - std::abort (); - } - } - else - // environment variable is not set, so assume infinite wait time - // and simply quit this thread - { - } - } - -public: - DeadlockKiller () - { - dealii::Threads::new_thread (&nuke_it); - } -}; - -#endif - DEAL_II_NAMESPACE_CLOSE - - - #endif // __tests_tests_h