From: Timo Heister Date: Tue, 15 Feb 2022 16:43:51 +0000 (-0500) Subject: simplify test X-Git-Tag: v9.4.0-rc1~488^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6791b032fb298d57ff3560b61ea9468a84ae5e2;p=dealii.git simplify test --- diff --git a/tests/mpi/broadcast_02.cc b/tests/mpi/broadcast_02.cc index 0f461da41b..89420da326 100644 --- a/tests/mpi/broadcast_02.cc +++ b/tests/mpi/broadcast_02.cc @@ -13,14 +13,8 @@ // // --------------------------------------------------------------------- - - -// Test Utilities::MPI::broadcast(). - -// If this flag is enabled, messages bigger than 2^32 bytes will be -// transmitted. This takes a while and requires quite a bit of memory, -// so it is disabled by default: -bool big = false; +// Test Utilities::MPI::broadcast() including sending a large message +// with >2^31 elements #include @@ -54,14 +48,14 @@ check2(std::size_t count) std::vector x(count, '?'); if (my_proc == 0) { - for (auto &c : x) - c = 'X'; + // a classical baby shout: + std::fill(x.begin(), x.end(), 'A'); x[count - 1] = '!'; } Utilities::MPI::broadcast(x.data(), count, 0, MPI_COMM_WORLD); - AssertThrow(x[0] == 'X', ExcInternalError()); + AssertThrow(x[0] == 'A', ExcInternalError()); AssertThrow(x[count - 1] == '!', ExcInternalError()); deallog << "OK" << std::endl; } @@ -74,12 +68,6 @@ main(int argc, char *argv[]) check1(); check2(1ULL << 3); - - if (big) - { - check2(1ULL << 31); - check2((1ULL << 31) + 1); - check2(1ULL << 32); - check2((1ULL << 32) + 5); - } + check2(1ULL << 31); + check2((1ULL << 32) + 5); } diff --git a/tests/mpi/broadcast_02.mpirun=3.output b/tests/mpi/broadcast_02.mpirun=3.output index a168662560..f90d9ce0b8 100644 --- a/tests/mpi/broadcast_02.mpirun=3.output +++ b/tests/mpi/broadcast_02.mpirun=3.output @@ -1,11 +1,17 @@ +DEAL:0::OK +DEAL:0::OK DEAL:0::OK DEAL:0::OK DEAL:1::OK DEAL:1::OK +DEAL:1::OK +DEAL:1::OK DEAL:2::OK DEAL:2::OK +DEAL:2::OK +DEAL:2::OK