From 188f379da4f0edf32d810aa67878640700191c65 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 3 Dec 2017 11:27:39 +0100 Subject: [PATCH] Adjust test output for Zoltan --- source/distributed/shared_tria.cc | 4 +- .../communicate_active_fe_indices_01.cc | 5 +- ...cate_active_fe_indices_01.mpirun=3.output} | 0 ...inos=false.with_metis=true.mpirun=3.output | 23 ---- ..._trilinos_with_zoltan=true.mpirun=3.output | 23 ---- .../communicate_active_fe_indices_01a.cc | 110 ++++++++++++++++++ ..._trilinos_with_zoltan=true.mpirun=3.output | 23 ++++ .../communicate_active_fe_indices_01b.cc | 110 ++++++++++++++++++ ...ndices_01b.with_metis=true.mpirun=3.output | 23 ++++ 9 files changed, 272 insertions(+), 49 deletions(-) rename tests/sharedtria/{communicate_active_fe_indices_01.with_trilinos=false.with_metis=false.mpirun=3.output => communicate_active_fe_indices_01.mpirun=3.output} (100%) delete mode 100644 tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=false.with_metis=true.mpirun=3.output delete mode 100644 tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output create mode 100644 tests/sharedtria/communicate_active_fe_indices_01a.cc create mode 100644 tests/sharedtria/communicate_active_fe_indices_01a.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output create mode 100644 tests/sharedtria/communicate_active_fe_indices_01b.cc create mode 100644 tests/sharedtria/communicate_active_fe_indices_01b.with_metis=true.mpirun=3.output diff --git a/source/distributed/shared_tria.cc b/source/distributed/shared_tria.cc index 1cb8ce2030..948a2bf5a7 100644 --- a/source/distributed/shared_tria.cc +++ b/source/distributed/shared_tria.cc @@ -78,7 +78,7 @@ namespace parallel = (partition_zoltan | partition_metis | partition_zorder | partition_custom_signal) & settings; if (partition_settings == partition_auto) -#ifdef DEAL_II_WITH_ZOLTAN +#ifdef DEAL_II_TRILINOS_WITH_ZOLTAN partition_settings = partition_zoltan; #elif defined DEAL_II_WITH_METIS partition_settings = partition_metis; @@ -88,7 +88,7 @@ namespace parallel if (partition_settings == partition_zoltan) { -#ifndef DEAL_II_WITH_ZOLTAN +#ifndef DEAL_II_TRILINOS_WITH_ZOLTAN AssertThrow (false, ExcMessage("Choosing 'partition_zoltan' requires the library " "to be compiled with support for Zoltan! " diff --git a/tests/sharedtria/communicate_active_fe_indices_01.cc b/tests/sharedtria/communicate_active_fe_indices_01.cc index e39435f4e8..72c4fd46a7 100644 --- a/tests/sharedtria/communicate_active_fe_indices_01.cc +++ b/tests/sharedtria/communicate_active_fe_indices_01.cc @@ -40,7 +40,10 @@ template void test() { parallel::shared::Triangulation - triangulation (MPI_COMM_WORLD); + triangulation (MPI_COMM_WORLD, + ::Triangulation::none, + false, + parallel::shared::Triangulation::partition_zorder); GridGenerator::hyper_cube(triangulation); triangulation.refine_global (3); diff --git a/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=false.with_metis=false.mpirun=3.output b/tests/sharedtria/communicate_active_fe_indices_01.mpirun=3.output similarity index 100% rename from tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=false.with_metis=false.mpirun=3.output rename to tests/sharedtria/communicate_active_fe_indices_01.mpirun=3.output diff --git a/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=false.with_metis=true.mpirun=3.output b/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=false.with_metis=true.mpirun=3.output deleted file mode 100644 index 8a0dde9022..0000000000 --- a/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=false.with_metis=true.mpirun=3.output +++ /dev/null @@ -1,23 +0,0 @@ - -DEAL:0:1d::n_dofs: 9 -DEAL:0:1d::n_locally_owned_dofs: 3 -DEAL:0:2d::n_dofs: 81 -DEAL:0:2d::n_locally_owned_dofs: 31 -DEAL:0:3d::n_dofs: 729 -DEAL:0:3d::n_locally_owned_dofs: 297 - -DEAL:1:1d::n_dofs: 9 -DEAL:1:1d::n_locally_owned_dofs: 4 -DEAL:1:2d::n_dofs: 81 -DEAL:1:2d::n_locally_owned_dofs: 30 -DEAL:1:3d::n_dofs: 729 -DEAL:1:3d::n_locally_owned_dofs: 240 - - -DEAL:2:1d::n_dofs: 9 -DEAL:2:1d::n_locally_owned_dofs: 2 -DEAL:2:2d::n_dofs: 81 -DEAL:2:2d::n_locally_owned_dofs: 20 -DEAL:2:3d::n_dofs: 729 -DEAL:2:3d::n_locally_owned_dofs: 192 - diff --git a/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output b/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output deleted file mode 100644 index 8a0dde9022..0000000000 --- a/tests/sharedtria/communicate_active_fe_indices_01.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output +++ /dev/null @@ -1,23 +0,0 @@ - -DEAL:0:1d::n_dofs: 9 -DEAL:0:1d::n_locally_owned_dofs: 3 -DEAL:0:2d::n_dofs: 81 -DEAL:0:2d::n_locally_owned_dofs: 31 -DEAL:0:3d::n_dofs: 729 -DEAL:0:3d::n_locally_owned_dofs: 297 - -DEAL:1:1d::n_dofs: 9 -DEAL:1:1d::n_locally_owned_dofs: 4 -DEAL:1:2d::n_dofs: 81 -DEAL:1:2d::n_locally_owned_dofs: 30 -DEAL:1:3d::n_dofs: 729 -DEAL:1:3d::n_locally_owned_dofs: 240 - - -DEAL:2:1d::n_dofs: 9 -DEAL:2:1d::n_locally_owned_dofs: 2 -DEAL:2:2d::n_dofs: 81 -DEAL:2:2d::n_locally_owned_dofs: 20 -DEAL:2:3d::n_dofs: 729 -DEAL:2:3d::n_locally_owned_dofs: 192 - diff --git a/tests/sharedtria/communicate_active_fe_indices_01a.cc b/tests/sharedtria/communicate_active_fe_indices_01a.cc new file mode 100644 index 0000000000..236d4009b5 --- /dev/null +++ b/tests/sharedtria/communicate_active_fe_indices_01a.cc @@ -0,0 +1,110 @@ +// --------------------------------------------------------------------- +// +// 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 processors correctly communicate active_fe_index +// information from their own locally owned cells to the ghosts on +// other processors +// This is the same as communicate_active_fe_indices_01 but using +// Zoltan as partitioner. + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +template +void test() +{ + parallel::shared::Triangulation + triangulation (MPI_COMM_WORLD, + ::Triangulation::none, + false, + parallel::shared::Triangulation::partition_zoltan); + + GridGenerator::hyper_cube(triangulation); + triangulation.refine_global (3); + + hp::FECollection fe; + for (unsigned int i=0; i(1)); + + hp::DoFHandler dof_handler (triangulation); + + // set the active_fe_index on all locally active cells equal to the + // subdomain_id. we can later verify this equality also on ghost + // cells + for (auto cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + cell->set_active_fe_index (cell->subdomain_id()); + + 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; + + // verify that the information has been communicated between processors + for (auto cell : dof_handler.active_cell_iterators()) + { + if (cell->is_locally_owned()) + Assert (cell->active_fe_index () + == + cell->subdomain_id(), + ExcInternalError()); + if (cell->is_ghost()) + Assert (cell->active_fe_index () + == + cell->subdomain_id(), + ExcInternalError()); + + // in the current mode for p::s::Tria, every cell is either + // locally owned or a ghost + Assert (cell->is_locally_owned() || cell->is_ghost(), + ExcInternalError()); + } +} + + +int main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + + MPILogInitAll all; + + deallog.push("1d"); + test<1>(); + deallog.pop(); + + deallog.push("2d"); + test<2>(); + deallog.pop(); + + deallog.push("3d"); + test<3>(); + deallog.pop(); +} diff --git a/tests/sharedtria/communicate_active_fe_indices_01a.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output b/tests/sharedtria/communicate_active_fe_indices_01a.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output new file mode 100644 index 0000000000..1c9600ac8c --- /dev/null +++ b/tests/sharedtria/communicate_active_fe_indices_01a.with_trilinos=true.with_trilinos_with_zoltan=true.mpirun=3.output @@ -0,0 +1,23 @@ + +DEAL:0:1d::n_dofs: 9 +DEAL:0:1d::n_locally_owned_dofs: 3 +DEAL:0:2d::n_dofs: 81 +DEAL:0:2d::n_locally_owned_dofs: 36 +DEAL:0:3d::n_dofs: 729 +DEAL:0:3d::n_locally_owned_dofs: 290 + +DEAL:1:1d::n_dofs: 9 +DEAL:1:1d::n_locally_owned_dofs: 3 +DEAL:1:2d::n_dofs: 81 +DEAL:1:2d::n_locally_owned_dofs: 26 +DEAL:1:3d::n_dofs: 729 +DEAL:1:3d::n_locally_owned_dofs: 216 + + +DEAL:2:1d::n_dofs: 9 +DEAL:2:1d::n_locally_owned_dofs: 3 +DEAL:2:2d::n_dofs: 81 +DEAL:2:2d::n_locally_owned_dofs: 19 +DEAL:2:3d::n_dofs: 729 +DEAL:2:3d::n_locally_owned_dofs: 223 + diff --git a/tests/sharedtria/communicate_active_fe_indices_01b.cc b/tests/sharedtria/communicate_active_fe_indices_01b.cc new file mode 100644 index 0000000000..4a9306619d --- /dev/null +++ b/tests/sharedtria/communicate_active_fe_indices_01b.cc @@ -0,0 +1,110 @@ +// --------------------------------------------------------------------- +// +// 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 processors correctly communicate active_fe_index +// information from their own locally owned cells to the ghosts on +// other processors +// This is the same as communicate_active_fe_indices_01 but using +// METIS as partitioner. + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +template +void test() +{ + parallel::shared::Triangulation + triangulation (MPI_COMM_WORLD, + ::Triangulation::none, + false, + parallel::shared::Triangulation::partition_metis); + + GridGenerator::hyper_cube(triangulation); + triangulation.refine_global (3); + + hp::FECollection fe; + for (unsigned int i=0; i(1)); + + hp::DoFHandler dof_handler (triangulation); + + // set the active_fe_index on all locally active cells equal to the + // subdomain_id. we can later verify this equality also on ghost + // cells + for (auto cell : dof_handler.active_cell_iterators()) + if (cell->is_locally_owned()) + cell->set_active_fe_index (cell->subdomain_id()); + + 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; + + // verify that the information has been communicated between processors + for (auto cell : dof_handler.active_cell_iterators()) + { + if (cell->is_locally_owned()) + Assert (cell->active_fe_index () + == + cell->subdomain_id(), + ExcInternalError()); + if (cell->is_ghost()) + Assert (cell->active_fe_index () + == + cell->subdomain_id(), + ExcInternalError()); + + // in the current mode for p::s::Tria, every cell is either + // locally owned or a ghost + Assert (cell->is_locally_owned() || cell->is_ghost(), + ExcInternalError()); + } +} + + +int main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + + MPILogInitAll all; + + deallog.push("1d"); + test<1>(); + deallog.pop(); + + deallog.push("2d"); + test<2>(); + deallog.pop(); + + deallog.push("3d"); + test<3>(); + deallog.pop(); +} diff --git a/tests/sharedtria/communicate_active_fe_indices_01b.with_metis=true.mpirun=3.output b/tests/sharedtria/communicate_active_fe_indices_01b.with_metis=true.mpirun=3.output new file mode 100644 index 0000000000..ecbb3507f9 --- /dev/null +++ b/tests/sharedtria/communicate_active_fe_indices_01b.with_metis=true.mpirun=3.output @@ -0,0 +1,23 @@ + +DEAL:0:1d::n_dofs: 9 +DEAL:0:1d::n_locally_owned_dofs: 4 +DEAL:0:2d::n_dofs: 81 +DEAL:0:2d::n_locally_owned_dofs: 32 +DEAL:0:3d::n_dofs: 729 +DEAL:0:3d::n_locally_owned_dofs: 304 + +DEAL:1:1d::n_dofs: 9 +DEAL:1:1d::n_locally_owned_dofs: 4 +DEAL:1:2d::n_dofs: 81 +DEAL:1:2d::n_locally_owned_dofs: 27 +DEAL:1:3d::n_dofs: 729 +DEAL:1:3d::n_locally_owned_dofs: 244 + + +DEAL:2:1d::n_dofs: 9 +DEAL:2:1d::n_locally_owned_dofs: 1 +DEAL:2:2d::n_dofs: 81 +DEAL:2:2d::n_locally_owned_dofs: 22 +DEAL:2:3d::n_dofs: 729 +DEAL:2:3d::n_locally_owned_dofs: 181 + -- 2.39.5