From: heister Date: Wed, 5 Jun 2013 22:56:39 +0000 (+0000) Subject: add failing test X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88a192de6c2911298ab4ed43bd90ad1b23fdaf3c;p=dealii-svn.git add failing test git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29772 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/gla/block_mat_01.cc b/tests/gla/block_mat_01.cc new file mode 100644 index 0000000000..0ccaa16fc1 --- /dev/null +++ b/tests/gla/block_mat_01.cc @@ -0,0 +1,102 @@ +//--------------------------------------------------------------------------- +// $Id: ghost_01.cc 28440 2013-02-17 14:35:08Z heister $ +// Version: $Name$ +// +// Copyright (C) 2004, 2005, 2010 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. +// +//--------------------------------------------------------------------------- + + +// LA::MPI::BlockSparseMatrix + +#include "../tests.h" +#include +#include +#include +#include +#include +#include + +#include "gla.h" + +template +void test () +{ + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); + + if (myid==0) + deallog << "numproc=" << numproc << std::endl; + + IndexSet block1(10); + if (numproc==1) + block1.add_range(0,10); + + if (myid==0) + block1.add_range(0,7); + if (myid==1) + block1.add_range(7,10); + + IndexSet block2(5); + if (numproc==1) + block2.add_range(0,5); + + if (myid==0) + block2.add_range(0,2); + if (myid==1) + block2.add_range(2,5); + + + std::vector partitioning; + partitioning.push_back(block1); + partitioning.push_back(block2); + + //LA::MPI::CompressedBlockSparsityPattern sp(partitioning); + BlockCompressedSimpleSparsityPattern sp(partitioning); + for (unsigned int i=0;i<15;++i) + { + sp.add(i,i); + sp.add(i,1); + } + sp.compress(); + + typename LA::MPI::BlockSparseMatrix matrix; + matrix.reinit (partitioning, sp, MPI_COMM_WORLD); + + matrix.add(1,1,1.3); + + matrix.compress(); + + + // done + if (myid==0) + deallog << "OK" << std::endl; +} + + + +int main (int argc, char **argv) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + MPILogInitAll log(__FILE__); + + { + deallog.push("PETSc"); + test(); + deallog.pop(); + deallog.push("Trilinos"); + test(); + deallog.pop(); + } + + // compile, don't run + //if (myid==9999) + // test(); + + +} diff --git a/tests/gla/block_mat_01/ncpu_10/cmp/generic b/tests/gla/block_mat_01/ncpu_10/cmp/generic new file mode 100644 index 0000000000..a748da52cc --- /dev/null +++ b/tests/gla/block_mat_01/ncpu_10/cmp/generic @@ -0,0 +1,11 @@ + +DEAL:0:PETSc::numproc=10 +DEAL:0:PETSc::0: 0 +DEAL:0:PETSc::1: 1.000 +DEAL:0:PETSc::0,1 : 10.00 +DEAL:0:PETSc::OK +DEAL:0:Trilinos::numproc=10 +DEAL:0:Trilinos::0: 0 +DEAL:0:Trilinos::1: 1.000 +DEAL:0:Trilinos::0,1 : 10.00 +DEAL:0:Trilinos::OK diff --git a/tests/gla/block_mat_01/ncpu_4/cmp/generic b/tests/gla/block_mat_01/ncpu_4/cmp/generic new file mode 100644 index 0000000000..88d363c606 --- /dev/null +++ b/tests/gla/block_mat_01/ncpu_4/cmp/generic @@ -0,0 +1,11 @@ + +DEAL:0:PETSc::numproc=4 +DEAL:0:PETSc::0: 0 +DEAL:0:PETSc::1: 1.000 +DEAL:0:PETSc::0,1 : 4.000 +DEAL:0:PETSc::OK +DEAL:0:Trilinos::numproc=4 +DEAL:0:Trilinos::0: 0 +DEAL:0:Trilinos::1: 1.000 +DEAL:0:Trilinos::0,1 : 4.000 +DEAL:0:Trilinos::OK diff --git a/tests/gla/gla.h b/tests/gla/gla.h index 8c82ee7783..512eaf8d03 100644 --- a/tests/gla/gla.h +++ b/tests/gla/gla.h @@ -9,6 +9,7 @@ class LA_PETSc public: typedef LinearAlgebraPETSc::MPI::Vector Vector; typedef LinearAlgebraPETSc::MPI::SparseMatrix SparseMatrix; + typedef LinearAlgebraPETSc::MPI::BlockSparseMatrix BlockSparseMatrix; }; }; @@ -20,6 +21,7 @@ class LA_Trilinos public: typedef LinearAlgebraTrilinos::MPI::Vector Vector; typedef LinearAlgebraTrilinos::MPI::SparseMatrix SparseMatrix; + typedef LinearAlgebraTrilinos::MPI::BlockSparseMatrix BlockSparseMatrix; }; };