From 644f73d40cf867f6d13630adfc604cceb77ee628 Mon Sep 17 00:00:00 2001 From: heister Date: Sun, 26 May 2013 13:59:55 +0000 Subject: [PATCH] add failing test git-svn-id: https://svn.dealii.org/trunk@29605 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/mpi/tria_01.cc | 95 +++++++++++++++++++++++++++ tests/mpi/tria_01/ncpu_10/cmp/generic | 5 ++ tests/mpi/tria_01/ncpu_2/cmp/generic | 5 ++ tests/mpi/tria_01/ncpu_4/cmp/generic | 5 ++ 4 files changed, 110 insertions(+) create mode 100644 tests/mpi/tria_01.cc create mode 100644 tests/mpi/tria_01/ncpu_10/cmp/generic create mode 100644 tests/mpi/tria_01/ncpu_2/cmp/generic create mode 100644 tests/mpi/tria_01/ncpu_4/cmp/generic diff --git a/tests/mpi/tria_01.cc b/tests/mpi/tria_01.cc new file mode 100644 index 0000000000..4417c12bad --- /dev/null +++ b/tests/mpi/tria_01.cc @@ -0,0 +1,95 @@ +//--------------------------------------------------------------------------- +// $Id: p4est_2d_coarse_01.cc 29074 2013-03-27 14:53:45Z heister $ +// Version: $Name$ +// +// Copyright (C) 2009, 2010, 2011 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + + +// test n_levels and iterators on those levels +// begin(i) should work even if we have no cells on that level + +#include "../tests.h" +#include "coarse_grid_common.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + + +template +void test() +{ + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + + parallel::distributed::Triangulation tr(MPI_COMM_WORLD); + GridGenerator::hyper_cube(tr); + tr.refine_global(1); + if (myid == 0) + deallog << "#cells = " << tr.n_global_active_cells() << std::endl; + + deallog << "proc " << myid << ", n levels " << tr.n_levels() << std::endl; + deallog << "proc " << myid << ", n gobal levels " << tr.n_global_levels() << std::endl; + + deallog << "begin().cell_index " << tr.begin()->index() << std::endl; + deallog << "begin(0).cell_index " << tr.begin(0)->index() << std::endl; + + deallog << "begin(1)==end(1)? " << (tr.begin(1)==tr.end(1)) << std::endl; + + if (myid!=0) + Assert(tr.begin(1)==tr.end(1), ExcInternalError()); + + deallog << "subdomainid = " + << tr.begin_active()->subdomain_id() + << std::endl; + + const unsigned int checksum = tr.get_checksum (); + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) + deallog << "Checksum: " + << checksum + << std::endl; + + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) + deallog << "OK" << std::endl; +} + + +int main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + + + deallog.push(Utilities::int_to_string(myid)); + + if (myid == 0) + { + std::ofstream logfile(output_file_for_mpi("tria_01").c_str()); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + deallog.push("2d"); + test<2>(); + deallog.pop(); + } + else + test<2>(); + +} diff --git a/tests/mpi/tria_01/ncpu_10/cmp/generic b/tests/mpi/tria_01/ncpu_10/cmp/generic new file mode 100644 index 0000000000..106d06a0d2 --- /dev/null +++ b/tests/mpi/tria_01/ncpu_10/cmp/generic @@ -0,0 +1,5 @@ + +DEAL:0:2d::subdomainid = 0 +DEAL:0:2d::#cells = 29035 +DEAL:0:2d::Checksum: 1364131841 +DEAL:0:2d::OK diff --git a/tests/mpi/tria_01/ncpu_2/cmp/generic b/tests/mpi/tria_01/ncpu_2/cmp/generic new file mode 100644 index 0000000000..106d06a0d2 --- /dev/null +++ b/tests/mpi/tria_01/ncpu_2/cmp/generic @@ -0,0 +1,5 @@ + +DEAL:0:2d::subdomainid = 0 +DEAL:0:2d::#cells = 29035 +DEAL:0:2d::Checksum: 1364131841 +DEAL:0:2d::OK diff --git a/tests/mpi/tria_01/ncpu_4/cmp/generic b/tests/mpi/tria_01/ncpu_4/cmp/generic new file mode 100644 index 0000000000..106d06a0d2 --- /dev/null +++ b/tests/mpi/tria_01/ncpu_4/cmp/generic @@ -0,0 +1,5 @@ + +DEAL:0:2d::subdomainid = 0 +DEAL:0:2d::#cells = 29035 +DEAL:0:2d::Checksum: 1364131841 +DEAL:0:2d::OK -- 2.39.5