From 3b7284b152c52a0833a60641108abca678f7aadf Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 13 May 2015 14:58:16 -0400 Subject: [PATCH] make tests more interesting --- tests/mpi/collective_max_array.cc | 6 +++--- tests/mpi/collective_max_array.mpirun=1.output | 2 +- tests/mpi/collective_max_array.mpirun=10.output | 2 +- tests/mpi/collective_max_array.mpirun=4.output | 2 +- tests/mpi/collective_max_array_in_place.cc | 6 +++--- tests/mpi/collective_max_array_in_place.mpirun=1.output | 2 +- tests/mpi/collective_max_array_in_place.mpirun=10.output | 2 +- tests/mpi/collective_max_array_in_place.mpirun=4.output | 2 +- tests/mpi/collective_max_vector.cc | 6 +++--- tests/mpi/collective_max_vector.mpirun=1.output | 2 +- tests/mpi/collective_max_vector.mpirun=10.output | 2 +- tests/mpi/collective_max_vector.mpirun=4.output | 2 +- tests/mpi/collective_max_vector_in_place.cc | 6 +++--- tests/mpi/collective_max_vector_in_place.mpirun=1.output | 2 +- tests/mpi/collective_max_vector_in_place.mpirun=10.output | 2 +- tests/mpi/collective_max_vector_in_place.mpirun=4.output | 2 +- tests/mpi/collective_min_array.cc | 4 ++-- tests/mpi/collective_min_array.mpirun=1.output | 2 +- tests/mpi/collective_min_array.mpirun=10.output | 2 +- tests/mpi/collective_min_array.mpirun=4.output | 2 +- tests/mpi/collective_min_array_in_place.cc | 4 ++-- tests/mpi/collective_min_array_in_place.mpirun=1.output | 2 +- tests/mpi/collective_min_array_in_place.mpirun=10.output | 2 +- tests/mpi/collective_min_array_in_place.mpirun=4.output | 2 +- tests/mpi/collective_min_vector.cc | 4 ++-- tests/mpi/collective_min_vector.mpirun=1.output | 2 +- tests/mpi/collective_min_vector.mpirun=10.output | 2 +- tests/mpi/collective_min_vector.mpirun=4.output | 2 +- tests/mpi/collective_min_vector_in_place.cc | 6 +++--- tests/mpi/collective_min_vector_in_place.mpirun=1.output | 2 +- tests/mpi/collective_min_vector_in_place.mpirun=10.output | 2 +- tests/mpi/collective_min_vector_in_place.mpirun=4.output | 2 +- 32 files changed, 45 insertions(+), 45 deletions(-) diff --git a/tests/mpi/collective_max_array.cc b/tests/mpi/collective_max_array.cc index c75a806f89..a9f41e266b 100644 --- a/tests/mpi/collective_max_array.cc +++ b/tests/mpi/collective_max_array.cc @@ -27,13 +27,13 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int values[2] = { 1, 2 }; + unsigned int values[2] = { 1+myid, numprocs+myid }; unsigned int maxima[2]; Utilities::MPI::max (values, MPI_COMM_WORLD, maxima); - Assert (maxima[0] == 1, ExcInternalError()); - Assert (maxima[1] == 2, ExcInternalError()); + Assert (maxima[0] == numprocs, ExcInternalError()); + Assert (maxima[1] == 2*numprocs-1, ExcInternalError()); if (myid==0) deallog << maxima[0] << ' ' << maxima[1] << std::endl; diff --git a/tests/mpi/collective_max_array.mpirun=1.output b/tests/mpi/collective_max_array.mpirun=1.output index 6e10373d77..fe633e16a6 100644 --- a/tests/mpi/collective_max_array.mpirun=1.output +++ b/tests/mpi/collective_max_array.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 1 diff --git a/tests/mpi/collective_max_array.mpirun=10.output b/tests/mpi/collective_max_array.mpirun=10.output index 6e10373d77..4a447c1695 100644 --- a/tests/mpi/collective_max_array.mpirun=10.output +++ b/tests/mpi/collective_max_array.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::10 19 diff --git a/tests/mpi/collective_max_array.mpirun=4.output b/tests/mpi/collective_max_array.mpirun=4.output index 6e10373d77..0aedfbfded 100644 --- a/tests/mpi/collective_max_array.mpirun=4.output +++ b/tests/mpi/collective_max_array.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::4 7 diff --git a/tests/mpi/collective_max_array_in_place.cc b/tests/mpi/collective_max_array_in_place.cc index f40e52bd2a..a04aefcf3d 100644 --- a/tests/mpi/collective_max_array_in_place.cc +++ b/tests/mpi/collective_max_array_in_place.cc @@ -27,12 +27,12 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int maxima[2] = { 1, 2 }; + unsigned int maxima[2] = { 1+myid, numprocs+myid }; Utilities::MPI::max (maxima, MPI_COMM_WORLD, maxima); - Assert (maxima[0] == 1, ExcInternalError()); - Assert (maxima[1] == 2, ExcInternalError()); + Assert (maxima[0] == numprocs, ExcInternalError()); + Assert (maxima[1] == 2*numprocs-1, ExcInternalError()); if (myid==0) deallog << maxima[0] << ' ' << maxima[1] << std::endl; diff --git a/tests/mpi/collective_max_array_in_place.mpirun=1.output b/tests/mpi/collective_max_array_in_place.mpirun=1.output index 6e10373d77..fe633e16a6 100644 --- a/tests/mpi/collective_max_array_in_place.mpirun=1.output +++ b/tests/mpi/collective_max_array_in_place.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 1 diff --git a/tests/mpi/collective_max_array_in_place.mpirun=10.output b/tests/mpi/collective_max_array_in_place.mpirun=10.output index 6e10373d77..4a447c1695 100644 --- a/tests/mpi/collective_max_array_in_place.mpirun=10.output +++ b/tests/mpi/collective_max_array_in_place.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::10 19 diff --git a/tests/mpi/collective_max_array_in_place.mpirun=4.output b/tests/mpi/collective_max_array_in_place.mpirun=4.output index 6e10373d77..0aedfbfded 100644 --- a/tests/mpi/collective_max_array_in_place.mpirun=4.output +++ b/tests/mpi/collective_max_array_in_place.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::4 7 diff --git a/tests/mpi/collective_max_vector.cc b/tests/mpi/collective_max_vector.cc index 2ac4caa07f..9e6773aeda 100644 --- a/tests/mpi/collective_max_vector.cc +++ b/tests/mpi/collective_max_vector.cc @@ -27,14 +27,14 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int values_[2] = { 1, 2 }; + unsigned int values_[2] = { 1+myid, numprocs+myid }; std::vector values(&values_[0], &values_[2]); std::vector maxima(2); Utilities::MPI::max (values, MPI_COMM_WORLD, maxima); - Assert (maxima[0] == 1, ExcInternalError()); - Assert (maxima[1] == 2, ExcInternalError()); + Assert (maxima[0] == numprocs, ExcInternalError()); + Assert (maxima[1] == 2*numprocs-1, ExcInternalError()); if (myid==0) deallog << maxima[0] << ' ' << maxima[1] << std::endl; diff --git a/tests/mpi/collective_max_vector.mpirun=1.output b/tests/mpi/collective_max_vector.mpirun=1.output index 6e10373d77..fe633e16a6 100644 --- a/tests/mpi/collective_max_vector.mpirun=1.output +++ b/tests/mpi/collective_max_vector.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 1 diff --git a/tests/mpi/collective_max_vector.mpirun=10.output b/tests/mpi/collective_max_vector.mpirun=10.output index 6e10373d77..4a447c1695 100644 --- a/tests/mpi/collective_max_vector.mpirun=10.output +++ b/tests/mpi/collective_max_vector.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::10 19 diff --git a/tests/mpi/collective_max_vector.mpirun=4.output b/tests/mpi/collective_max_vector.mpirun=4.output index 6e10373d77..0aedfbfded 100644 --- a/tests/mpi/collective_max_vector.mpirun=4.output +++ b/tests/mpi/collective_max_vector.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::4 7 diff --git a/tests/mpi/collective_max_vector_in_place.cc b/tests/mpi/collective_max_vector_in_place.cc index 6d2f96f314..239200ac0c 100644 --- a/tests/mpi/collective_max_vector_in_place.cc +++ b/tests/mpi/collective_max_vector_in_place.cc @@ -27,13 +27,13 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int values_[2] = { 1, 2 }; + unsigned int values_[2] = { myid, numprocs+myid }; std::vector maxima(&values_[0], &values_[2]); Utilities::MPI::max (maxima, MPI_COMM_WORLD, maxima); - Assert (maxima[0] == 1, ExcInternalError()); - Assert (maxima[1] == 2, ExcInternalError()); + Assert (maxima[0] == numprocs-1, ExcInternalError()); + Assert (maxima[1] == 2*numprocs-1, ExcInternalError()); if (myid==0) deallog << maxima[0] << ' ' << maxima[1] << std::endl; diff --git a/tests/mpi/collective_max_vector_in_place.mpirun=1.output b/tests/mpi/collective_max_vector_in_place.mpirun=1.output index 6e10373d77..0d5d12cfbb 100644 --- a/tests/mpi/collective_max_vector_in_place.mpirun=1.output +++ b/tests/mpi/collective_max_vector_in_place.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::0 1 diff --git a/tests/mpi/collective_max_vector_in_place.mpirun=10.output b/tests/mpi/collective_max_vector_in_place.mpirun=10.output index 6e10373d77..a1a6b132cb 100644 --- a/tests/mpi/collective_max_vector_in_place.mpirun=10.output +++ b/tests/mpi/collective_max_vector_in_place.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::9 19 diff --git a/tests/mpi/collective_max_vector_in_place.mpirun=4.output b/tests/mpi/collective_max_vector_in_place.mpirun=4.output index 6e10373d77..7794f4476b 100644 --- a/tests/mpi/collective_max_vector_in_place.mpirun=4.output +++ b/tests/mpi/collective_max_vector_in_place.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::3 7 diff --git a/tests/mpi/collective_min_array.cc b/tests/mpi/collective_min_array.cc index 0c51e6b70d..0c2255853b 100644 --- a/tests/mpi/collective_min_array.cc +++ b/tests/mpi/collective_min_array.cc @@ -27,13 +27,13 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int values[2] = { 1, 2 }; + unsigned int values[2] = { 1+myid, numprocs+myid }; unsigned int minima[2]; Utilities::MPI::min (values, MPI_COMM_WORLD, minima); Assert (minima[0] == 1, ExcInternalError()); - Assert (minima[1] == 2, ExcInternalError()); + Assert (minima[1] == numprocs, ExcInternalError()); if (myid==0) deallog << minima[0] << ' ' << minima[1] << std::endl; diff --git a/tests/mpi/collective_min_array.mpirun=1.output b/tests/mpi/collective_min_array.mpirun=1.output index 6e10373d77..fe633e16a6 100644 --- a/tests/mpi/collective_min_array.mpirun=1.output +++ b/tests/mpi/collective_min_array.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 1 diff --git a/tests/mpi/collective_min_array.mpirun=10.output b/tests/mpi/collective_min_array.mpirun=10.output index 6e10373d77..4a54bd444c 100644 --- a/tests/mpi/collective_min_array.mpirun=10.output +++ b/tests/mpi/collective_min_array.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 10 diff --git a/tests/mpi/collective_min_array.mpirun=4.output b/tests/mpi/collective_min_array.mpirun=4.output index 6e10373d77..d768b1a787 100644 --- a/tests/mpi/collective_min_array.mpirun=4.output +++ b/tests/mpi/collective_min_array.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 4 diff --git a/tests/mpi/collective_min_array_in_place.cc b/tests/mpi/collective_min_array_in_place.cc index ce893afb15..e52cd4c9f9 100644 --- a/tests/mpi/collective_min_array_in_place.cc +++ b/tests/mpi/collective_min_array_in_place.cc @@ -27,12 +27,12 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int minima[2] = { 1, 2 }; + unsigned int minima[2] = { 1+myid, numprocs+myid }; Utilities::MPI::min (minima, MPI_COMM_WORLD, minima); Assert (minima[0] == 1, ExcInternalError()); - Assert (minima[1] == 2, ExcInternalError()); + Assert (minima[1] == numprocs, ExcInternalError()); if (myid==0) deallog << minima[0] << ' ' << minima[1] << std::endl; diff --git a/tests/mpi/collective_min_array_in_place.mpirun=1.output b/tests/mpi/collective_min_array_in_place.mpirun=1.output index 6e10373d77..fe633e16a6 100644 --- a/tests/mpi/collective_min_array_in_place.mpirun=1.output +++ b/tests/mpi/collective_min_array_in_place.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 1 diff --git a/tests/mpi/collective_min_array_in_place.mpirun=10.output b/tests/mpi/collective_min_array_in_place.mpirun=10.output index 6e10373d77..4a54bd444c 100644 --- a/tests/mpi/collective_min_array_in_place.mpirun=10.output +++ b/tests/mpi/collective_min_array_in_place.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 10 diff --git a/tests/mpi/collective_min_array_in_place.mpirun=4.output b/tests/mpi/collective_min_array_in_place.mpirun=4.output index 6e10373d77..d768b1a787 100644 --- a/tests/mpi/collective_min_array_in_place.mpirun=4.output +++ b/tests/mpi/collective_min_array_in_place.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 4 diff --git a/tests/mpi/collective_min_vector.cc b/tests/mpi/collective_min_vector.cc index f32bc2f700..9cc73d99ba 100644 --- a/tests/mpi/collective_min_vector.cc +++ b/tests/mpi/collective_min_vector.cc @@ -27,14 +27,14 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int values_[2] = { 1, 2 }; + unsigned int values_[2] = { 1+myid, numprocs+myid }; std::vector values(&values_[0], &values_[2]); std::vector output(2); Utilities::MPI::min (values, MPI_COMM_WORLD, output); Assert (output[0] == 1, ExcInternalError()); - Assert (output[1] == 2, ExcInternalError()); + Assert (output[1] == numprocs, ExcInternalError()); if (myid==0) deallog << output[0] << ' ' << output[1] << std::endl; diff --git a/tests/mpi/collective_min_vector.mpirun=1.output b/tests/mpi/collective_min_vector.mpirun=1.output index 6e10373d77..fe633e16a6 100644 --- a/tests/mpi/collective_min_vector.mpirun=1.output +++ b/tests/mpi/collective_min_vector.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 1 diff --git a/tests/mpi/collective_min_vector.mpirun=10.output b/tests/mpi/collective_min_vector.mpirun=10.output index 6e10373d77..4a54bd444c 100644 --- a/tests/mpi/collective_min_vector.mpirun=10.output +++ b/tests/mpi/collective_min_vector.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 10 diff --git a/tests/mpi/collective_min_vector.mpirun=4.output b/tests/mpi/collective_min_vector.mpirun=4.output index 6e10373d77..d768b1a787 100644 --- a/tests/mpi/collective_min_vector.mpirun=4.output +++ b/tests/mpi/collective_min_vector.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::1 4 diff --git a/tests/mpi/collective_min_vector_in_place.cc b/tests/mpi/collective_min_vector_in_place.cc index c87c80b9d4..5dce2fd1ce 100644 --- a/tests/mpi/collective_min_vector_in_place.cc +++ b/tests/mpi/collective_min_vector_in_place.cc @@ -27,13 +27,13 @@ void test() unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - unsigned int values_[2] = { 1, 2 }; + unsigned int values_[2] = { myid, numprocs+myid }; std::vector inout(&values_[0], &values_[2]); Utilities::MPI::min (inout, MPI_COMM_WORLD, inout); - Assert (inout[0] == 1, ExcInternalError()); - Assert (inout[1] == 2, ExcInternalError()); + Assert (inout[0] == 0, ExcInternalError()); + Assert (inout[1] == numprocs, ExcInternalError()); if (myid==0) deallog << inout[0] << ' ' << inout[1] << std::endl; diff --git a/tests/mpi/collective_min_vector_in_place.mpirun=1.output b/tests/mpi/collective_min_vector_in_place.mpirun=1.output index 6e10373d77..0d5d12cfbb 100644 --- a/tests/mpi/collective_min_vector_in_place.mpirun=1.output +++ b/tests/mpi/collective_min_vector_in_place.mpirun=1.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::0 1 diff --git a/tests/mpi/collective_min_vector_in_place.mpirun=10.output b/tests/mpi/collective_min_vector_in_place.mpirun=10.output index 6e10373d77..7e451b43ad 100644 --- a/tests/mpi/collective_min_vector_in_place.mpirun=10.output +++ b/tests/mpi/collective_min_vector_in_place.mpirun=10.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::0 10 diff --git a/tests/mpi/collective_min_vector_in_place.mpirun=4.output b/tests/mpi/collective_min_vector_in_place.mpirun=4.output index 6e10373d77..e4d80026b4 100644 --- a/tests/mpi/collective_min_vector_in_place.mpirun=4.output +++ b/tests/mpi/collective_min_vector_in_place.mpirun=4.output @@ -1,2 +1,2 @@ -DEAL:mpi::1 2 +DEAL:mpi::0 4 -- 2.39.5