From 472044c5e2e142b0acb0bd5f9787793b41e5d5ef Mon Sep 17 00:00:00 2001 From: nivesh Date: Tue, 5 Dec 2017 14:11:49 +0100 Subject: [PATCH] Tests added for zoltan --- tests/zoltan/zoltan_01.cc | 3 +- tests/zoltan/zoltan_01.mpirun=2.output | 297 +++++++++++++++++++++++++ tests/zoltan/zoltan_01.output | 294 ++++++++++++------------ tests/zoltan/zoltan_02.cc | 90 ++++++++ tests/zoltan/zoltan_02.mpirun=2.output | 17 ++ tests/zoltan/zoltan_02.output | 8 + 6 files changed, 560 insertions(+), 149 deletions(-) create mode 100644 tests/zoltan/zoltan_01.mpirun=2.output create mode 100644 tests/zoltan/zoltan_02.cc create mode 100644 tests/zoltan/zoltan_02.mpirun=2.output create mode 100644 tests/zoltan/zoltan_02.output diff --git a/tests/zoltan/zoltan_01.cc b/tests/zoltan/zoltan_01.cc index 2f7141d973..b4649dd170 100644 --- a/tests/zoltan/zoltan_01.cc +++ b/tests/zoltan/zoltan_01.cc @@ -47,10 +47,9 @@ void test () int main (int argc, char **argv) { - initlog(); - //Initialize MPI and Zoltan Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv); + MPILogInitAll all; //tests test<1> (); diff --git a/tests/zoltan/zoltan_01.mpirun=2.output b/tests/zoltan/zoltan_01.mpirun=2.output new file mode 100644 index 0000000000..26646ed069 --- /dev/null +++ b/tests/zoltan/zoltan_01.mpirun=2.output @@ -0,0 +1,297 @@ + +DEAL:0::Partitioning +DEAL:0::4.0 4 +DEAL:0::4.1 4 +DEAL:0::4.2 4 +DEAL:0::4.3 3 +DEAL:0::4.4 3 +DEAL:0::4.5 3 +DEAL:0::4.6 2 +DEAL:0::4.7 2 +DEAL:0::4.8 2 +DEAL:0::4.9 1 +DEAL:0::4.10 1 +DEAL:0::4.11 1 +DEAL:0::4.12 1 +DEAL:0::4.13 0 +DEAL:0::4.14 0 +DEAL:0::4.15 0 +DEAL:0::Partitioning +DEAL:0::3.0 4 +DEAL:0::3.1 4 +DEAL:0::3.2 4 +DEAL:0::3.3 4 +DEAL:0::3.4 4 +DEAL:0::3.5 2 +DEAL:0::3.6 4 +DEAL:0::3.7 2 +DEAL:0::3.8 4 +DEAL:0::3.9 4 +DEAL:0::3.10 4 +DEAL:0::3.11 4 +DEAL:0::3.12 4 +DEAL:0::3.13 2 +DEAL:0::3.14 4 +DEAL:0::3.15 1 +DEAL:0::3.16 2 +DEAL:0::3.17 2 +DEAL:0::3.18 2 +DEAL:0::3.19 2 +DEAL:0::3.20 2 +DEAL:0::3.21 2 +DEAL:0::3.22 2 +DEAL:0::3.23 2 +DEAL:0::3.24 2 +DEAL:0::3.25 2 +DEAL:0::3.26 1 +DEAL:0::3.27 0 +DEAL:0::3.28 0 +DEAL:0::3.29 0 +DEAL:0::3.30 0 +DEAL:0::3.31 0 +DEAL:0::3.32 3 +DEAL:0::3.33 3 +DEAL:0::3.34 3 +DEAL:0::3.35 3 +DEAL:0::3.36 3 +DEAL:0::3.37 1 +DEAL:0::3.38 3 +DEAL:0::3.39 1 +DEAL:0::3.40 3 +DEAL:0::3.41 3 +DEAL:0::3.42 3 +DEAL:0::3.43 3 +DEAL:0::3.44 3 +DEAL:0::3.45 1 +DEAL:0::3.46 3 +DEAL:0::3.47 1 +DEAL:0::3.48 1 +DEAL:0::3.49 0 +DEAL:0::3.50 1 +DEAL:0::3.51 1 +DEAL:0::3.52 0 +DEAL:0::3.53 0 +DEAL:0::3.54 0 +DEAL:0::3.55 0 +DEAL:0::3.56 1 +DEAL:0::3.57 1 +DEAL:0::3.58 1 +DEAL:0::3.59 1 +DEAL:0::3.60 0 +DEAL:0::3.61 0 +DEAL:0::3.62 0 +DEAL:0::3.63 0 +DEAL:0::Partitioning +DEAL:0::2.0 4 +DEAL:0::2.1 4 +DEAL:0::2.2 4 +DEAL:0::2.3 4 +DEAL:0::2.4 3 +DEAL:0::2.5 3 +DEAL:0::2.6 3 +DEAL:0::2.7 3 +DEAL:0::2.8 4 +DEAL:0::2.9 4 +DEAL:0::2.10 2 +DEAL:0::2.11 2 +DEAL:0::2.12 4 +DEAL:0::2.13 4 +DEAL:0::2.14 2 +DEAL:0::2.15 2 +DEAL:0::2.16 0 +DEAL:0::2.17 0 +DEAL:0::2.18 0 +DEAL:0::2.19 0 +DEAL:0::2.20 0 +DEAL:0::2.21 0 +DEAL:0::2.22 0 +DEAL:0::2.23 0 +DEAL:0::2.24 2 +DEAL:0::2.25 2 +DEAL:0::2.26 2 +DEAL:0::2.27 2 +DEAL:0::2.28 1 +DEAL:0::2.29 2 +DEAL:0::2.30 1 +DEAL:0::2.31 1 +DEAL:0::2.32 3 +DEAL:0::2.33 3 +DEAL:0::2.34 3 +DEAL:0::2.35 3 +DEAL:0::2.36 3 +DEAL:0::2.37 3 +DEAL:0::2.38 3 +DEAL:0::2.39 3 +DEAL:0::2.40 4 +DEAL:0::2.41 4 +DEAL:0::2.42 2 +DEAL:0::2.43 2 +DEAL:0::2.44 4 +DEAL:0::2.45 4 +DEAL:0::2.46 2 +DEAL:0::2.47 2 +DEAL:0::2.48 0 +DEAL:0::2.49 0 +DEAL:0::2.50 0 +DEAL:0::2.51 0 +DEAL:0::2.52 0 +DEAL:0::2.53 1 +DEAL:0::2.54 0 +DEAL:0::2.55 1 +DEAL:0::2.56 1 +DEAL:0::2.57 1 +DEAL:0::2.58 1 +DEAL:0::2.59 1 +DEAL:0::2.60 1 +DEAL:0::2.61 1 +DEAL:0::2.62 1 +DEAL:0::2.63 1 + +DEAL:1::Partitioning +DEAL:1::4.0 4 +DEAL:1::4.1 4 +DEAL:1::4.2 4 +DEAL:1::4.3 3 +DEAL:1::4.4 3 +DEAL:1::4.5 3 +DEAL:1::4.6 2 +DEAL:1::4.7 2 +DEAL:1::4.8 2 +DEAL:1::4.9 1 +DEAL:1::4.10 1 +DEAL:1::4.11 1 +DEAL:1::4.12 1 +DEAL:1::4.13 0 +DEAL:1::4.14 0 +DEAL:1::4.15 0 +DEAL:1::Partitioning +DEAL:1::3.0 4 +DEAL:1::3.1 4 +DEAL:1::3.2 4 +DEAL:1::3.3 4 +DEAL:1::3.4 4 +DEAL:1::3.5 2 +DEAL:1::3.6 4 +DEAL:1::3.7 2 +DEAL:1::3.8 4 +DEAL:1::3.9 4 +DEAL:1::3.10 4 +DEAL:1::3.11 4 +DEAL:1::3.12 4 +DEAL:1::3.13 2 +DEAL:1::3.14 4 +DEAL:1::3.15 1 +DEAL:1::3.16 2 +DEAL:1::3.17 2 +DEAL:1::3.18 2 +DEAL:1::3.19 2 +DEAL:1::3.20 2 +DEAL:1::3.21 2 +DEAL:1::3.22 2 +DEAL:1::3.23 2 +DEAL:1::3.24 2 +DEAL:1::3.25 2 +DEAL:1::3.26 1 +DEAL:1::3.27 0 +DEAL:1::3.28 0 +DEAL:1::3.29 0 +DEAL:1::3.30 0 +DEAL:1::3.31 0 +DEAL:1::3.32 3 +DEAL:1::3.33 3 +DEAL:1::3.34 3 +DEAL:1::3.35 3 +DEAL:1::3.36 3 +DEAL:1::3.37 1 +DEAL:1::3.38 3 +DEAL:1::3.39 1 +DEAL:1::3.40 3 +DEAL:1::3.41 3 +DEAL:1::3.42 3 +DEAL:1::3.43 3 +DEAL:1::3.44 3 +DEAL:1::3.45 1 +DEAL:1::3.46 3 +DEAL:1::3.47 1 +DEAL:1::3.48 1 +DEAL:1::3.49 0 +DEAL:1::3.50 1 +DEAL:1::3.51 1 +DEAL:1::3.52 0 +DEAL:1::3.53 0 +DEAL:1::3.54 0 +DEAL:1::3.55 0 +DEAL:1::3.56 1 +DEAL:1::3.57 1 +DEAL:1::3.58 1 +DEAL:1::3.59 1 +DEAL:1::3.60 0 +DEAL:1::3.61 0 +DEAL:1::3.62 0 +DEAL:1::3.63 0 +DEAL:1::Partitioning +DEAL:1::2.0 4 +DEAL:1::2.1 4 +DEAL:1::2.2 4 +DEAL:1::2.3 4 +DEAL:1::2.4 3 +DEAL:1::2.5 3 +DEAL:1::2.6 3 +DEAL:1::2.7 3 +DEAL:1::2.8 4 +DEAL:1::2.9 4 +DEAL:1::2.10 2 +DEAL:1::2.11 2 +DEAL:1::2.12 4 +DEAL:1::2.13 4 +DEAL:1::2.14 2 +DEAL:1::2.15 2 +DEAL:1::2.16 0 +DEAL:1::2.17 0 +DEAL:1::2.18 0 +DEAL:1::2.19 0 +DEAL:1::2.20 0 +DEAL:1::2.21 0 +DEAL:1::2.22 0 +DEAL:1::2.23 0 +DEAL:1::2.24 2 +DEAL:1::2.25 2 +DEAL:1::2.26 2 +DEAL:1::2.27 2 +DEAL:1::2.28 1 +DEAL:1::2.29 2 +DEAL:1::2.30 1 +DEAL:1::2.31 1 +DEAL:1::2.32 3 +DEAL:1::2.33 3 +DEAL:1::2.34 3 +DEAL:1::2.35 3 +DEAL:1::2.36 3 +DEAL:1::2.37 3 +DEAL:1::2.38 3 +DEAL:1::2.39 3 +DEAL:1::2.40 4 +DEAL:1::2.41 4 +DEAL:1::2.42 2 +DEAL:1::2.43 2 +DEAL:1::2.44 4 +DEAL:1::2.45 4 +DEAL:1::2.46 2 +DEAL:1::2.47 2 +DEAL:1::2.48 0 +DEAL:1::2.49 0 +DEAL:1::2.50 0 +DEAL:1::2.51 0 +DEAL:1::2.52 0 +DEAL:1::2.53 1 +DEAL:1::2.54 0 +DEAL:1::2.55 1 +DEAL:1::2.56 1 +DEAL:1::2.57 1 +DEAL:1::2.58 1 +DEAL:1::2.59 1 +DEAL:1::2.60 1 +DEAL:1::2.61 1 +DEAL:1::2.62 1 +DEAL:1::2.63 1 + diff --git a/tests/zoltan/zoltan_01.output b/tests/zoltan/zoltan_01.output index 079cb44bb4..3a58a34830 100644 --- a/tests/zoltan/zoltan_01.output +++ b/tests/zoltan/zoltan_01.output @@ -1,148 +1,148 @@ -DEAL::Partitioning -DEAL::4.0 4 -DEAL::4.1 4 -DEAL::4.2 4 -DEAL::4.3 3 -DEAL::4.4 3 -DEAL::4.5 3 -DEAL::4.6 2 -DEAL::4.7 2 -DEAL::4.8 2 -DEAL::4.9 1 -DEAL::4.10 1 -DEAL::4.11 1 -DEAL::4.12 1 -DEAL::4.13 0 -DEAL::4.14 0 -DEAL::4.15 0 -DEAL::Partitioning -DEAL::3.0 4 -DEAL::3.1 4 -DEAL::3.2 4 -DEAL::3.3 4 -DEAL::3.4 4 -DEAL::3.5 2 -DEAL::3.6 4 -DEAL::3.7 2 -DEAL::3.8 4 -DEAL::3.9 4 -DEAL::3.10 4 -DEAL::3.11 4 -DEAL::3.12 4 -DEAL::3.13 2 -DEAL::3.14 4 -DEAL::3.15 1 -DEAL::3.16 2 -DEAL::3.17 2 -DEAL::3.18 2 -DEAL::3.19 2 -DEAL::3.20 2 -DEAL::3.21 2 -DEAL::3.22 2 -DEAL::3.23 2 -DEAL::3.24 2 -DEAL::3.25 2 -DEAL::3.26 1 -DEAL::3.27 0 -DEAL::3.28 0 -DEAL::3.29 0 -DEAL::3.30 0 -DEAL::3.31 0 -DEAL::3.32 3 -DEAL::3.33 3 -DEAL::3.34 3 -DEAL::3.35 3 -DEAL::3.36 3 -DEAL::3.37 1 -DEAL::3.38 3 -DEAL::3.39 1 -DEAL::3.40 3 -DEAL::3.41 3 -DEAL::3.42 3 -DEAL::3.43 3 -DEAL::3.44 3 -DEAL::3.45 1 -DEAL::3.46 3 -DEAL::3.47 1 -DEAL::3.48 1 -DEAL::3.49 0 -DEAL::3.50 1 -DEAL::3.51 1 -DEAL::3.52 0 -DEAL::3.53 0 -DEAL::3.54 0 -DEAL::3.55 0 -DEAL::3.56 1 -DEAL::3.57 1 -DEAL::3.58 1 -DEAL::3.59 1 -DEAL::3.60 0 -DEAL::3.61 0 -DEAL::3.62 0 -DEAL::3.63 0 -DEAL::Partitioning -DEAL::2.0 4 -DEAL::2.1 4 -DEAL::2.2 4 -DEAL::2.3 4 -DEAL::2.4 3 -DEAL::2.5 3 -DEAL::2.6 3 -DEAL::2.7 3 -DEAL::2.8 4 -DEAL::2.9 4 -DEAL::2.10 2 -DEAL::2.11 2 -DEAL::2.12 4 -DEAL::2.13 4 -DEAL::2.14 2 -DEAL::2.15 2 -DEAL::2.16 0 -DEAL::2.17 0 -DEAL::2.18 0 -DEAL::2.19 0 -DEAL::2.20 0 -DEAL::2.21 0 -DEAL::2.22 0 -DEAL::2.23 0 -DEAL::2.24 2 -DEAL::2.25 2 -DEAL::2.26 2 -DEAL::2.27 2 -DEAL::2.28 1 -DEAL::2.29 2 -DEAL::2.30 1 -DEAL::2.31 1 -DEAL::2.32 3 -DEAL::2.33 3 -DEAL::2.34 3 -DEAL::2.35 3 -DEAL::2.36 3 -DEAL::2.37 3 -DEAL::2.38 3 -DEAL::2.39 3 -DEAL::2.40 4 -DEAL::2.41 4 -DEAL::2.42 2 -DEAL::2.43 2 -DEAL::2.44 4 -DEAL::2.45 4 -DEAL::2.46 2 -DEAL::2.47 2 -DEAL::2.48 0 -DEAL::2.49 0 -DEAL::2.50 0 -DEAL::2.51 0 -DEAL::2.52 0 -DEAL::2.53 1 -DEAL::2.54 0 -DEAL::2.55 1 -DEAL::2.56 1 -DEAL::2.57 1 -DEAL::2.58 1 -DEAL::2.59 1 -DEAL::2.60 1 -DEAL::2.61 1 -DEAL::2.62 1 -DEAL::2.63 1 +DEAL:0::Partitioning +DEAL:0::4.0 4 +DEAL:0::4.1 4 +DEAL:0::4.2 4 +DEAL:0::4.3 3 +DEAL:0::4.4 3 +DEAL:0::4.5 3 +DEAL:0::4.6 2 +DEAL:0::4.7 2 +DEAL:0::4.8 2 +DEAL:0::4.9 1 +DEAL:0::4.10 1 +DEAL:0::4.11 1 +DEAL:0::4.12 1 +DEAL:0::4.13 0 +DEAL:0::4.14 0 +DEAL:0::4.15 0 +DEAL:0::Partitioning +DEAL:0::3.0 4 +DEAL:0::3.1 4 +DEAL:0::3.2 4 +DEAL:0::3.3 4 +DEAL:0::3.4 4 +DEAL:0::3.5 2 +DEAL:0::3.6 4 +DEAL:0::3.7 2 +DEAL:0::3.8 4 +DEAL:0::3.9 4 +DEAL:0::3.10 4 +DEAL:0::3.11 4 +DEAL:0::3.12 4 +DEAL:0::3.13 2 +DEAL:0::3.14 4 +DEAL:0::3.15 1 +DEAL:0::3.16 2 +DEAL:0::3.17 2 +DEAL:0::3.18 2 +DEAL:0::3.19 2 +DEAL:0::3.20 2 +DEAL:0::3.21 2 +DEAL:0::3.22 2 +DEAL:0::3.23 2 +DEAL:0::3.24 2 +DEAL:0::3.25 2 +DEAL:0::3.26 1 +DEAL:0::3.27 0 +DEAL:0::3.28 0 +DEAL:0::3.29 0 +DEAL:0::3.30 0 +DEAL:0::3.31 0 +DEAL:0::3.32 3 +DEAL:0::3.33 3 +DEAL:0::3.34 3 +DEAL:0::3.35 3 +DEAL:0::3.36 3 +DEAL:0::3.37 1 +DEAL:0::3.38 3 +DEAL:0::3.39 1 +DEAL:0::3.40 3 +DEAL:0::3.41 3 +DEAL:0::3.42 3 +DEAL:0::3.43 3 +DEAL:0::3.44 3 +DEAL:0::3.45 1 +DEAL:0::3.46 3 +DEAL:0::3.47 1 +DEAL:0::3.48 1 +DEAL:0::3.49 0 +DEAL:0::3.50 1 +DEAL:0::3.51 1 +DEAL:0::3.52 0 +DEAL:0::3.53 0 +DEAL:0::3.54 0 +DEAL:0::3.55 0 +DEAL:0::3.56 1 +DEAL:0::3.57 1 +DEAL:0::3.58 1 +DEAL:0::3.59 1 +DEAL:0::3.60 0 +DEAL:0::3.61 0 +DEAL:0::3.62 0 +DEAL:0::3.63 0 +DEAL:0::Partitioning +DEAL:0::2.0 4 +DEAL:0::2.1 4 +DEAL:0::2.2 4 +DEAL:0::2.3 4 +DEAL:0::2.4 3 +DEAL:0::2.5 3 +DEAL:0::2.6 3 +DEAL:0::2.7 3 +DEAL:0::2.8 4 +DEAL:0::2.9 4 +DEAL:0::2.10 2 +DEAL:0::2.11 2 +DEAL:0::2.12 4 +DEAL:0::2.13 4 +DEAL:0::2.14 2 +DEAL:0::2.15 2 +DEAL:0::2.16 0 +DEAL:0::2.17 0 +DEAL:0::2.18 0 +DEAL:0::2.19 0 +DEAL:0::2.20 0 +DEAL:0::2.21 0 +DEAL:0::2.22 0 +DEAL:0::2.23 0 +DEAL:0::2.24 2 +DEAL:0::2.25 2 +DEAL:0::2.26 2 +DEAL:0::2.27 2 +DEAL:0::2.28 1 +DEAL:0::2.29 2 +DEAL:0::2.30 1 +DEAL:0::2.31 1 +DEAL:0::2.32 3 +DEAL:0::2.33 3 +DEAL:0::2.34 3 +DEAL:0::2.35 3 +DEAL:0::2.36 3 +DEAL:0::2.37 3 +DEAL:0::2.38 3 +DEAL:0::2.39 3 +DEAL:0::2.40 4 +DEAL:0::2.41 4 +DEAL:0::2.42 2 +DEAL:0::2.43 2 +DEAL:0::2.44 4 +DEAL:0::2.45 4 +DEAL:0::2.46 2 +DEAL:0::2.47 2 +DEAL:0::2.48 0 +DEAL:0::2.49 0 +DEAL:0::2.50 0 +DEAL:0::2.51 0 +DEAL:0::2.52 0 +DEAL:0::2.53 1 +DEAL:0::2.54 0 +DEAL:0::2.55 1 +DEAL:0::2.56 1 +DEAL:0::2.57 1 +DEAL:0::2.58 1 +DEAL:0::2.59 1 +DEAL:0::2.60 1 +DEAL:0::2.61 1 +DEAL:0::2.62 1 +DEAL:0::2.63 1 diff --git a/tests/zoltan/zoltan_02.cc b/tests/zoltan/zoltan_02.cc new file mode 100644 index 0000000000..585b5840da --- /dev/null +++ b/tests/zoltan/zoltan_02.cc @@ -0,0 +1,90 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2004 - 2015 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 GridTools::color_sparsity_pattern + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +void fill_graph (DynamicSparsityPattern &graph) +{ + //Edges in only one direction + graph.add(0,1); + graph.add(0,2); + graph.add(1,2); + graph.add(1,4); + graph.add(4,3); + graph.add(2,4); + graph.add(3,2); + + //Edges in opposite direction + graph.add(1,0); + graph.add(2,0); + graph.add(2,1); + graph.add(4,1); + graph.add(3,4); + graph.add(4,2); + graph.add(2,3); +} + + +int main (int argc, char **argv) +{ + //Initialize MPI and Zoltan + Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv); + MPILogInitAll all; + + //Number of nodes + unsigned int num_indices = 5; + + //Create temporary object to hold graph connection info. + DynamicSparsityPattern dynamic_sparse_graph; + dynamic_sparse_graph.reinit(num_indices,num_indices); + + //fill dynamic sparsity pattern + fill_graph(dynamic_sparse_graph); + + //Create sparity pattern to hold graph connection info. + SparsityPattern sp_graph; + sp_graph.copy_from(dynamic_sparse_graph); + + Assert( num_indices == sp_graph.n_rows() , ExcInternalError() ); + + std::vector color_indices; + unsigned int num_colors; + + color_indices.resize(num_indices); + num_colors = SparsityTools::color_sparsity_pattern (sp_graph, color_indices); + + //color + deallog << "Coloring" << std::endl; + deallog << "Number of colors used: " << num_colors << std::endl; + for (unsigned int i=0; i