]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add test 3489/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 7 Nov 2016 21:04:38 +0000 (22:04 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 7 Nov 2016 21:05:18 +0000 (22:05 +0100)
tests/mpi/parallel_block_vector_03.cc [new file with mode: 0644]
tests/mpi/parallel_block_vector_03.with_64bit_indices=off.mpirun=2.output [new file with mode: 0644]
tests/mpi/parallel_block_vector_03.with_64bit_indices=on.mpirun=2.output [new file with mode: 0644]
tests/mpi/parallel_block_vector_03.with_64bit_indices=on.mpirun=2.output.2 [new file with mode: 0644]

diff --git a/tests/mpi/parallel_block_vector_03.cc b/tests/mpi/parallel_block_vector_03.cc
new file mode 100644 (file)
index 0000000..9fdd893
--- /dev/null
@@ -0,0 +1,71 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2016 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 memory consumption parallel vector
+
+#include "../tests.h"
+#include <deal.II/base/utilities.h>
+#include <deal.II/base/index_set.h>
+#include <deal.II/lac/la_parallel_block_vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+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;
+
+
+  // each processor from processor 1 to 8 owns 2 indices (the other processors
+  // do not own any dof), and all processors are ghosting element 1
+  IndexSet local_owned(30);
+  if (myid == 0)
+    local_owned.add_range(0,20);
+  else
+    local_owned.add_range(std::min(20U,20*myid),30U);
+  IndexSet local_relevant(30);
+  local_relevant = local_owned;
+  local_relevant.add_range(19,20);
+
+  LinearAlgebra::distributed::Vector<double> v(local_owned, local_relevant,
+                                               MPI_COMM_WORLD);
+
+  deallog << v.memory_consumption() << std::endl;
+
+  LinearAlgebra::distributed::BlockVector<double> w(3);
+  for (unsigned int i=0; i<3; ++i)
+    {
+      w.block(i) = v;
+      w.block(i) *= (i+1);
+    }
+  w.collect_sizes();
+
+  deallog << w.memory_consumption() << std::endl;
+}
+
+
+
+int main (int argc, char **argv)
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
+
+  MPILogInitAll log;
+  test();
+}
diff --git a/tests/mpi/parallel_block_vector_03.with_64bit_indices=off.mpirun=2.output b/tests/mpi/parallel_block_vector_03.with_64bit_indices=off.mpirun=2.output
new file mode 100644 (file)
index 0000000..b9dc03e
--- /dev/null
@@ -0,0 +1,8 @@
+
+DEAL:0::numproc=2
+DEAL:0::599
+DEAL:0::1476
+
+DEAL:1::519
+DEAL:1::1254
+
diff --git a/tests/mpi/parallel_block_vector_03.with_64bit_indices=on.mpirun=2.output b/tests/mpi/parallel_block_vector_03.with_64bit_indices=on.mpirun=2.output
new file mode 100644 (file)
index 0000000..8b07f9e
--- /dev/null
@@ -0,0 +1,8 @@
+
+DEAL:0::numproc=2
+DEAL:0::643
+DEAL:0::1501
+
+DEAL:1::563
+DEAL:1::1279
+
diff --git a/tests/mpi/parallel_block_vector_03.with_64bit_indices=on.mpirun=2.output.2 b/tests/mpi/parallel_block_vector_03.with_64bit_indices=on.mpirun=2.output.2
new file mode 100644 (file)
index 0000000..e252434
--- /dev/null
@@ -0,0 +1,8 @@
+
+DEAL:0::numproc=2
+DEAL:0::643
+DEAL:0::1525
+
+DEAL:1::563
+DEAL:1::1303
+

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.