From: Wolfgang Bangerth Date: Thu, 6 Jul 2017 20:02:21 +0000 (-0600) Subject: Add a shared::tria test where one processor has no cells. X-Git-Tag: v9.0.0-rc1~1441^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebe87ca947c9e039ca76f21f9261696dba9609c5;p=dealii.git Add a shared::tria test where one processor has no cells. --- diff --git a/tests/sharedtria/no_cells_01.cc b/tests/sharedtria/no_cells_01.cc new file mode 100644 index 0000000000..95699292b3 --- /dev/null +++ b/tests/sharedtria/no_cells_01.cc @@ -0,0 +1,125 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + + +// check that everything is ok when we have a triangulation that has +// fewer cells than there are processors +// +// this test is run with sufficiently many processors so that there +// are idle processors in 1d, 2d, and 3d + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +template +void test() +{ + parallel::shared::Triangulation + triangulation (MPI_COMM_WORLD); + + GridGenerator::hyper_cube(triangulation); + triangulation.refine_global (1); + + // partition the triangulation by hand + for (auto cell : triangulation.active_cell_iterators()) + cell->set_subdomain_id (cell->active_cell_index() % + Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)); + + + FE_Q fe(1); + + DoFHandler dof_handler (triangulation); + dof_handler.distribute_dofs (fe); + + deallog << "n_dofs: " << dof_handler.n_dofs() << std::endl; + deallog << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl; + + deallog << "n_locally_owned_dofs_per_processor: "; + std::vector v = dof_handler.n_locally_owned_dofs_per_processor(); + unsigned int sum = 0; + for (unsigned int i=0; i(); + deallog.pop(); + + deallog.push("2d"); + test<2>(); + deallog.pop(); + + deallog.push("3d"); + test<3>(); + deallog.pop(); +} diff --git a/tests/sharedtria/no_cells_01.with_metis=true.mpirun=3.output b/tests/sharedtria/no_cells_01.with_metis=true.mpirun=3.output new file mode 100644 index 0000000000..81969ccd2c --- /dev/null +++ b/tests/sharedtria/no_cells_01.with_metis=true.mpirun=3.output @@ -0,0 +1,58 @@ + +DEAL:0:1d::n_dofs: 3 +DEAL:0:1d::n_locally_owned_dofs: 1 +DEAL:0:1d::n_locally_owned_dofs_per_processor: 1 2 0 sum: 3 +3 1 +0 1 +DEAL:0:1d:: locally_owned_dofs: +DEAL:0:2d::n_dofs: 9 +DEAL:0:2d::n_locally_owned_dofs: 4 +DEAL:0:2d::n_locally_owned_dofs_per_processor: 4 3 2 sum: 9 +9 1 +0 4 +DEAL:0:2d:: locally_owned_dofs: +DEAL:0:3d::n_dofs: 27 +DEAL:0:3d::n_locally_owned_dofs: 10 +DEAL:0:3d::n_locally_owned_dofs_per_processor: 10 11 6 sum: 27 +27 1 +0 10 +DEAL:0:3d:: locally_owned_dofs: + +DEAL:1:1d::n_dofs: 3 +DEAL:1:1d::n_locally_owned_dofs: 2 +DEAL:1:1d::n_locally_owned_dofs_per_processor: 1 2 0 sum: 3 +3 1 +1 3 +DEAL:1:1d:: locally_owned_dofs: +DEAL:1:2d::n_dofs: 9 +DEAL:1:2d::n_locally_owned_dofs: 3 +DEAL:1:2d::n_locally_owned_dofs_per_processor: 4 3 2 sum: 9 +9 1 +4 7 +DEAL:1:2d:: locally_owned_dofs: +DEAL:1:3d::n_dofs: 27 +DEAL:1:3d::n_locally_owned_dofs: 11 +DEAL:1:3d::n_locally_owned_dofs_per_processor: 10 11 6 sum: 27 +27 1 +10 21 +DEAL:1:3d:: locally_owned_dofs: + + +DEAL:2:1d::n_dofs: 3 +DEAL:2:1d::n_locally_owned_dofs: 0 +DEAL:2:1d::n_locally_owned_dofs_per_processor: 1 2 0 sum: 3 +3 0 +DEAL:2:1d:: locally_owned_dofs: +DEAL:2:2d::n_dofs: 9 +DEAL:2:2d::n_locally_owned_dofs: 2 +DEAL:2:2d::n_locally_owned_dofs_per_processor: 4 3 2 sum: 9 +9 1 +7 9 +DEAL:2:2d:: locally_owned_dofs: +DEAL:2:3d::n_dofs: 27 +DEAL:2:3d::n_locally_owned_dofs: 6 +DEAL:2:3d::n_locally_owned_dofs_per_processor: 10 11 6 sum: 27 +27 1 +21 27 +DEAL:2:3d:: locally_owned_dofs: + diff --git a/tests/sharedtria/no_cells_01.with_metis=true.mpirun=5.output b/tests/sharedtria/no_cells_01.with_metis=true.mpirun=5.output new file mode 100644 index 0000000000..648350f6cd --- /dev/null +++ b/tests/sharedtria/no_cells_01.with_metis=true.mpirun=5.output @@ -0,0 +1,95 @@ + +DEAL:0:1d::n_dofs: 3 +DEAL:0:1d::n_locally_owned_dofs: 1 +DEAL:0:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 sum: 3 +3 1 +0 1 +DEAL:0:1d:: locally_owned_dofs: +DEAL:0:2d::n_dofs: 9 +DEAL:0:2d::n_locally_owned_dofs: 1 +DEAL:0:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 sum: 9 +9 1 +0 1 +DEAL:0:2d:: locally_owned_dofs: +DEAL:0:3d::n_dofs: 27 +DEAL:0:3d::n_locally_owned_dofs: 5 +DEAL:0:3d::n_locally_owned_dofs_per_processor: 5 8 7 5 2 sum: 27 +27 1 +0 5 +DEAL:0:3d:: locally_owned_dofs: + +DEAL:1:1d::n_dofs: 3 +DEAL:1:1d::n_locally_owned_dofs: 2 +DEAL:1:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 sum: 3 +3 1 +1 3 +DEAL:1:1d:: locally_owned_dofs: +DEAL:1:2d::n_dofs: 9 +DEAL:1:2d::n_locally_owned_dofs: 3 +DEAL:1:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 sum: 9 +9 1 +1 4 +DEAL:1:2d:: locally_owned_dofs: +DEAL:1:3d::n_dofs: 27 +DEAL:1:3d::n_locally_owned_dofs: 8 +DEAL:1:3d::n_locally_owned_dofs_per_processor: 5 8 7 5 2 sum: 27 +27 1 +5 13 +DEAL:1:3d:: locally_owned_dofs: + + +DEAL:2:1d::n_dofs: 3 +DEAL:2:1d::n_locally_owned_dofs: 0 +DEAL:2:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 sum: 3 +3 0 +DEAL:2:1d:: locally_owned_dofs: +DEAL:2:2d::n_dofs: 9 +DEAL:2:2d::n_locally_owned_dofs: 2 +DEAL:2:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 sum: 9 +9 1 +4 6 +DEAL:2:2d:: locally_owned_dofs: +DEAL:2:3d::n_dofs: 27 +DEAL:2:3d::n_locally_owned_dofs: 7 +DEAL:2:3d::n_locally_owned_dofs_per_processor: 5 8 7 5 2 sum: 27 +27 1 +13 20 +DEAL:2:3d:: locally_owned_dofs: + + +DEAL:3:1d::n_dofs: 3 +DEAL:3:1d::n_locally_owned_dofs: 0 +DEAL:3:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 sum: 3 +3 0 +DEAL:3:1d:: locally_owned_dofs: +DEAL:3:2d::n_dofs: 9 +DEAL:3:2d::n_locally_owned_dofs: 3 +DEAL:3:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 sum: 9 +9 1 +6 9 +DEAL:3:2d:: locally_owned_dofs: +DEAL:3:3d::n_dofs: 27 +DEAL:3:3d::n_locally_owned_dofs: 5 +DEAL:3:3d::n_locally_owned_dofs_per_processor: 5 8 7 5 2 sum: 27 +27 1 +20 25 +DEAL:3:3d:: locally_owned_dofs: + + +DEAL:4:1d::n_dofs: 3 +DEAL:4:1d::n_locally_owned_dofs: 0 +DEAL:4:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 sum: 3 +3 0 +DEAL:4:1d:: locally_owned_dofs: +DEAL:4:2d::n_dofs: 9 +DEAL:4:2d::n_locally_owned_dofs: 0 +DEAL:4:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 sum: 9 +9 0 +DEAL:4:2d:: locally_owned_dofs: +DEAL:4:3d::n_dofs: 27 +DEAL:4:3d::n_locally_owned_dofs: 2 +DEAL:4:3d::n_locally_owned_dofs_per_processor: 5 8 7 5 2 sum: 27 +27 1 +25 27 +DEAL:4:3d:: locally_owned_dofs: + diff --git a/tests/sharedtria/no_cells_01.with_metis=true.mpirun=9.output b/tests/sharedtria/no_cells_01.with_metis=true.mpirun=9.output new file mode 100644 index 0000000000..06567b8304 --- /dev/null +++ b/tests/sharedtria/no_cells_01.with_metis=true.mpirun=9.output @@ -0,0 +1,166 @@ + +DEAL:0:1d::n_dofs: 3 +DEAL:0:1d::n_locally_owned_dofs: 1 +DEAL:0:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 1 +0 1 +DEAL:0:1d:: locally_owned_dofs: +DEAL:0:2d::n_dofs: 9 +DEAL:0:2d::n_locally_owned_dofs: 1 +DEAL:0:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 1 +0 1 +DEAL:0:2d:: locally_owned_dofs: +DEAL:0:3d::n_dofs: 27 +DEAL:0:3d::n_locally_owned_dofs: 1 +DEAL:0:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +0 1 +DEAL:0:3d:: locally_owned_dofs: + +DEAL:1:1d::n_dofs: 3 +DEAL:1:1d::n_locally_owned_dofs: 2 +DEAL:1:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 1 +1 3 +DEAL:1:1d:: locally_owned_dofs: +DEAL:1:2d::n_dofs: 9 +DEAL:1:2d::n_locally_owned_dofs: 3 +DEAL:1:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 1 +1 4 +DEAL:1:2d:: locally_owned_dofs: +DEAL:1:3d::n_dofs: 27 +DEAL:1:3d::n_locally_owned_dofs: 4 +DEAL:1:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +1 5 +DEAL:1:3d:: locally_owned_dofs: + + +DEAL:2:1d::n_dofs: 3 +DEAL:2:1d::n_locally_owned_dofs: 0 +DEAL:2:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:2:1d:: locally_owned_dofs: +DEAL:2:2d::n_dofs: 9 +DEAL:2:2d::n_locally_owned_dofs: 2 +DEAL:2:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 1 +4 6 +DEAL:2:2d:: locally_owned_dofs: +DEAL:2:3d::n_dofs: 27 +DEAL:2:3d::n_locally_owned_dofs: 2 +DEAL:2:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +5 7 +DEAL:2:3d:: locally_owned_dofs: + + +DEAL:3:1d::n_dofs: 3 +DEAL:3:1d::n_locally_owned_dofs: 0 +DEAL:3:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:3:1d:: locally_owned_dofs: +DEAL:3:2d::n_dofs: 9 +DEAL:3:2d::n_locally_owned_dofs: 3 +DEAL:3:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 1 +6 9 +DEAL:3:2d:: locally_owned_dofs: +DEAL:3:3d::n_dofs: 27 +DEAL:3:3d::n_locally_owned_dofs: 5 +DEAL:3:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +7 12 +DEAL:3:3d:: locally_owned_dofs: + + +DEAL:4:1d::n_dofs: 3 +DEAL:4:1d::n_locally_owned_dofs: 0 +DEAL:4:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:4:1d:: locally_owned_dofs: +DEAL:4:2d::n_dofs: 9 +DEAL:4:2d::n_locally_owned_dofs: 0 +DEAL:4:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 0 +DEAL:4:2d:: locally_owned_dofs: +DEAL:4:3d::n_dofs: 27 +DEAL:4:3d::n_locally_owned_dofs: 2 +DEAL:4:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +12 14 +DEAL:4:3d:: locally_owned_dofs: + + +DEAL:5:1d::n_dofs: 3 +DEAL:5:1d::n_locally_owned_dofs: 0 +DEAL:5:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:5:1d:: locally_owned_dofs: +DEAL:5:2d::n_dofs: 9 +DEAL:5:2d::n_locally_owned_dofs: 0 +DEAL:5:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 0 +DEAL:5:2d:: locally_owned_dofs: +DEAL:5:3d::n_dofs: 27 +DEAL:5:3d::n_locally_owned_dofs: 4 +DEAL:5:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +14 18 +DEAL:5:3d:: locally_owned_dofs: + + +DEAL:6:1d::n_dofs: 3 +DEAL:6:1d::n_locally_owned_dofs: 0 +DEAL:6:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:6:1d:: locally_owned_dofs: +DEAL:6:2d::n_dofs: 9 +DEAL:6:2d::n_locally_owned_dofs: 0 +DEAL:6:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 0 +DEAL:6:2d:: locally_owned_dofs: +DEAL:6:3d::n_dofs: 27 +DEAL:6:3d::n_locally_owned_dofs: 4 +DEAL:6:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +18 22 +DEAL:6:3d:: locally_owned_dofs: + + +DEAL:7:1d::n_dofs: 3 +DEAL:7:1d::n_locally_owned_dofs: 0 +DEAL:7:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:7:1d:: locally_owned_dofs: +DEAL:7:2d::n_dofs: 9 +DEAL:7:2d::n_locally_owned_dofs: 0 +DEAL:7:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 0 +DEAL:7:2d:: locally_owned_dofs: +DEAL:7:3d::n_dofs: 27 +DEAL:7:3d::n_locally_owned_dofs: 5 +DEAL:7:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 1 +22 27 +DEAL:7:3d:: locally_owned_dofs: + + +DEAL:8:1d::n_dofs: 3 +DEAL:8:1d::n_locally_owned_dofs: 0 +DEAL:8:1d::n_locally_owned_dofs_per_processor: 1 2 0 0 0 0 0 0 0 sum: 3 +3 0 +DEAL:8:1d:: locally_owned_dofs: +DEAL:8:2d::n_dofs: 9 +DEAL:8:2d::n_locally_owned_dofs: 0 +DEAL:8:2d::n_locally_owned_dofs_per_processor: 1 3 2 3 0 0 0 0 0 sum: 9 +9 0 +DEAL:8:2d:: locally_owned_dofs: +DEAL:8:3d::n_dofs: 27 +DEAL:8:3d::n_locally_owned_dofs: 0 +DEAL:8:3d::n_locally_owned_dofs_per_processor: 1 4 2 5 2 4 4 5 0 sum: 27 +27 0 +DEAL:8:3d:: locally_owned_dofs: +