From: heister Date: Sat, 3 Nov 2012 03:58:21 +0000 (+0000) Subject: test for GrowingVectorMemory and PETSc X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98b1463057466df0996d51081c9c1518cf381264;p=dealii-svn.git test for GrowingVectorMemory and PETSc git-svn-id: https://svn.dealii.org/trunk@27332 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/mpi/petsc_03.cc b/tests/mpi/petsc_03.cc new file mode 100644 index 0000000000..3ae6c7e581 --- /dev/null +++ b/tests/mpi/petsc_03.cc @@ -0,0 +1,73 @@ +//--------------------------------------------------------------------------- +// $Id: petsc_02.cc 25686 2012-07-04 14:18:43Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 2009, 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. +// +//--------------------------------------------------------------------------- + + +// PETScWrappers: document bug when using GrowingVectorMemory +// at the end of a run. + +#include "../tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +//#include + +template +void testit() +{ + GrowingVectorMemory m; + m.free(m.alloc()); +} + + + +void test() +{ + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); + + if (myid==0) + deallog << "Running on " << numprocs << " CPU(s)." << std::endl; + + testit(); + testit(); + testit(); + testit(); + + if (myid==0) + deallog << "done" << std::endl; +} + + +int main(int argc, char *argv[]) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv); + + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) + { + std::ofstream logfile(output_file_for_mpi(JobIdentifier::base_name(__FILE__)).c_str()); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test(); + } + else + test(); +} diff --git a/tests/mpi/petsc_03/ncpu_1/cmp/generic b/tests/mpi/petsc_03/ncpu_1/cmp/generic new file mode 100644 index 0000000000..721906ea79 --- /dev/null +++ b/tests/mpi/petsc_03/ncpu_1/cmp/generic @@ -0,0 +1,3 @@ + +DEAL::Running on 1 CPU(s). +DEAL::done diff --git a/tests/mpi/petsc_03/ncpu_10/cmp/generic b/tests/mpi/petsc_03/ncpu_10/cmp/generic new file mode 100644 index 0000000000..7430da6964 --- /dev/null +++ b/tests/mpi/petsc_03/ncpu_10/cmp/generic @@ -0,0 +1,3 @@ + +DEAL::Running on 10 CPU(s). +DEAL::done diff --git a/tests/mpi/petsc_03/ncpu_4/cmp/generic b/tests/mpi/petsc_03/ncpu_4/cmp/generic new file mode 100644 index 0000000000..befd397045 --- /dev/null +++ b/tests/mpi/petsc_03/ncpu_4/cmp/generic @@ -0,0 +1,3 @@ + +DEAL::Running on 4 CPU(s). +DEAL::done