]> https://gitweb.dealii.org/ - dealii.git/commitdiff
simplify test 13368/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 15 Feb 2022 16:43:51 +0000 (11:43 -0500)
committerTimo Heister <timo.heister@gmail.com>
Tue, 15 Feb 2022 16:45:05 +0000 (11:45 -0500)
tests/mpi/broadcast_02.cc
tests/mpi/broadcast_02.mpirun=3.output

index 0f461da41b1959cab3af4117e8de9a9ce8314c37..89420da326490cfdc0ac14e3362c4ae49df7acf0 100644 (file)
 //
 // ---------------------------------------------------------------------
 
-
-
-// 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 <deal.II/base/mpi.h>
 
@@ -54,14 +48,14 @@ check2(std::size_t count)
   std::vector<char> 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);
 }
index a1686625606e594b24348f857c923e082fafe429..f90d9ce0b8fcee1a50575deae7547741b58b2f79 100644 (file)
@@ -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
 

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.