From: Timo Heister Date: Sun, 13 Aug 2017 22:23:52 +0000 (-0600) Subject: allow MPILogInitAll to be used more than once X-Git-Tag: v9.0.0-rc1~1265^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f04f7af6a4b5d8eb992aede81f6e4fa4c3e92192;p=dealii.git allow MPILogInitAll to be used more than once --- diff --git a/tests/tests.h b/tests/tests.h index 64d6811538..e4b0cf2e85 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -377,11 +377,21 @@ struct MPILogInitAll { #ifdef DEAL_II_WITH_MPI unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - deallogname = "output"; - if (myid != 0) - deallogname = deallogname + Utilities::int_to_string(myid); - deallogfile.open(deallogname.c_str()); - deallog.attach(deallogfile); + if (myid == 0) + { + if (!deallog.has_file()) + { + deallogfile.open("output"); + deallog.attach(deallogfile); + } + } + else + { + deallogname = "output" + Utilities::int_to_string(myid); + deallogfile.open(deallogname.c_str()); + deallog.attach(deallogfile); + } + deallog.depth_console(console?10:0); deallog.push(Utilities::int_to_string(myid)); @@ -418,19 +428,11 @@ struct MPILogInitAll for (unsigned int i=1; i