]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Suppress output from all but processor 0.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Oct 2011 19:53:40 +0000 (19:53 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Oct 2011 19:53:40 +0000 (19:53 +0000)
git-svn-id: https://svn.dealii.org/trunk@24557 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/p4est_2d_coarse_01.cc
tests/mpi/p4est_2d_ghost_01.cc
tests/mpi/p4est_2d_refine_01.cc
tests/mpi/p4est_2d_simple.cc
tests/mpi/p4est_3d_ghost_01.cc

index b58a3c424e5523e49b7a2f63db8abccfd7dcb1ee..4b6526ab85933c0f5301ad64ed533c91971743a1 100644 (file)
@@ -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;
     }
 
 
index 543a80d78d568c7f61c02a9c63d8dfaee15cbcf8..5909b120a4bde95a9262409fb3aa737540242f47 100644 (file)
@@ -98,8 +98,9 @@ void test()
 
        }
 
+      const unsigned int checksum = tr.get_checksum ();
       deallog << "Checksum: "
-             << tr.get_checksum ()
+             << checksum
              << std::endl;
     }
 
index bcc6961ca75491d5563050036fc1d767f2a172da..8d4d02616866a8ac77151de493150a05a6d11a00 100644 (file)
@@ -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;
     }
 
 
index f23366836bc443046c08c778f333838ae77f62fb..af2b357266935fd130e90343cab6b61f011aa40a 100644 (file)
@@ -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;
     }
 
 
index a20ae204694ad4927989e0c4cc8158ad6819eac5..9238bcd8d521215de57bbd589adc3219d23ce456 100644 (file)
@@ -40,7 +40,7 @@ void test()
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
        deallog << "hyper_cube" << std::endl;
-      
+
       parallel::distributed::Triangulation<dim> 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);
        }
 

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.