From: bangerth Date: Fri, 7 Oct 2011 19:53:40 +0000 (+0000) Subject: Suppress output from all but processor 0. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b15c6c1b8e710a110dddf2dd9a02115dc62cfd6a;p=dealii-svn.git Suppress output from all but processor 0. git-svn-id: https://svn.dealii.org/trunk@24557 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/mpi/p4est_2d_coarse_01.cc b/tests/mpi/p4est_2d_coarse_01.cc index b58a3c424e..4b6526ab85 100644 --- a/tests/mpi/p4est_2d_coarse_01.cc +++ b/tests/mpi/p4est_2d_coarse_01.cc @@ -54,7 +54,10 @@ void test() << std::endl; } - deallog << "subdomainid = " << tr.begin_active()->subdomain_id() << std::endl; + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) + deallog << "subdomainid = " + << tr.begin_active()->subdomain_id() + << std::endl; // std::vector< unsigned int > cell_subd; // cell_subd.resize(tr.n_active_cells()); @@ -72,9 +75,11 @@ void test() ExcInternalError() ); } - deallog << "Checksum: " - << tr.get_checksum () - << std::endl; + const unsigned int checksum = tr.get_checksum (); + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) + deallog << "Checksum: " + << checksum + << std::endl; } diff --git a/tests/mpi/p4est_2d_ghost_01.cc b/tests/mpi/p4est_2d_ghost_01.cc index 543a80d78d..5909b120a4 100644 --- a/tests/mpi/p4est_2d_ghost_01.cc +++ b/tests/mpi/p4est_2d_ghost_01.cc @@ -98,8 +98,9 @@ void test() } + const unsigned int checksum = tr.get_checksum (); deallog << "Checksum: " - << tr.get_checksum () + << checksum << std::endl; } diff --git a/tests/mpi/p4est_2d_refine_01.cc b/tests/mpi/p4est_2d_refine_01.cc index bcc6961ca7..8d4d026168 100644 --- a/tests/mpi/p4est_2d_refine_01.cc +++ b/tests/mpi/p4est_2d_refine_01.cc @@ -55,15 +55,17 @@ void test() deallog << cell_subd[i] << " "; deallog << std::endl; } - + if (myid == 0) { deallog << "#cells = " << tr.n_global_active_cells() << std::endl; } - deallog << "Checksum: " - << tr.get_checksum () - << std::endl; + const unsigned int checksum = tr.get_checksum (); + if (myid == 0) + deallog << "Checksum: " + << checksum + << std::endl; } diff --git a/tests/mpi/p4est_2d_simple.cc b/tests/mpi/p4est_2d_simple.cc index f23366836b..af2b357266 100644 --- a/tests/mpi/p4est_2d_simple.cc +++ b/tests/mpi/p4est_2d_simple.cc @@ -48,21 +48,27 @@ void test() Assert(tr.n_active_cells()==1, ExcInternalError()); if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) - deallog << "subdomainid = " << tr.begin_active()->subdomain_id() << std::endl; + deallog << "subdomainid = " + << tr.begin_active()->subdomain_id() + << std::endl; if (myid == numproc-1) { - Assert( tr.begin_active()->subdomain_id()==(unsigned int)myid, ExcInternalError() ); + Assert( tr.begin_active()->subdomain_id()==(unsigned int)myid, + ExcInternalError() ); } else { - Assert( tr.begin_active()->subdomain_id()==types::artificial_subdomain_id, ExcInternalError() ); + Assert( tr.begin_active()->subdomain_id()==types::artificial_subdomain_id, + ExcInternalError() ); } - deallog << "Checksum: " - << tr.get_checksum () - << std::endl; + const unsigned int checksum = tr.get_checksum (); + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) + deallog << "Checksum: " + << checksum + << std::endl; } diff --git a/tests/mpi/p4est_3d_ghost_01.cc b/tests/mpi/p4est_3d_ghost_01.cc index a20ae20469..9238bcd8d5 100644 --- a/tests/mpi/p4est_3d_ghost_01.cc +++ b/tests/mpi/p4est_3d_ghost_01.cc @@ -40,7 +40,7 @@ void test() { if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; - + parallel::distributed::Triangulation tr(MPI_COMM_WORLD); unsigned int rep=2; @@ -54,7 +54,7 @@ void test() GridGenerator::subdivided_hyper_rectangle(tr, repetitions, p, q, false); tr.refine_global(ref); - + if (myid==0) { @@ -98,16 +98,17 @@ void test() } - + } - deallog << "Checksum: " - << tr.get_checksum () - << std::endl; + const unsigned int checksum = tr.get_checksum (); if (myid==0) { + deallog << "Checksum: " + << checksum + << std::endl; + std::ofstream file("p4est_3d_ghost_01/1.gpl"); - GridOut().write_gnuplot (tr, file); }