From b3dbc2c2794c40f393aed059322676b80b30d97b Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Sat, 1 Jul 2023 12:43:23 -0400 Subject: [PATCH] Finalize test output --- source/distributed/fully_distributed_tria.cc | 4 +- source/particles/particle_handler.cc | 8 +- ...particle_handler_03.with_p4est=true.output | 103 ------------------ tests/serialization/particle_handler_04.cc | 18 +-- .../particle_handler_04.mpirun=1.output | 99 ++--------------- 5 files changed, 25 insertions(+), 207 deletions(-) delete mode 100644 tests/serialization/particle_handler_03.with_p4est=true.output diff --git a/source/distributed/fully_distributed_tria.cc b/source/distributed/fully_distributed_tria.cc index 06fe3ce08f..9f42320873 100644 --- a/source/distributed/fully_distributed_tria.cc +++ b/source/distributed/fully_distributed_tria.cc @@ -456,8 +456,8 @@ namespace parallel void Triangulation::save(const std::string &filename) const { #ifdef DEAL_II_WITH_MPI - AssertThrow(this->cell_attached_data.pack_callbacks_variable.size() == 0, - ExcNotImplemented()); + //AssertThrow(this->cell_attached_data.pack_callbacks_variable.size() == 0, + // ExcNotImplemented()); Assert( this->cell_attached_data.n_attached_deserialize == 0, diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index dbb13dd41a..6a9e0fa354 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -2261,7 +2261,7 @@ namespace Particles // First prepare container for insertion clear(); -#ifdef DEAL_II_WITH_P4EST +//#ifdef DEAL_II_WITH_P4EST // If we are resuming from a checkpoint, we first have to register the // store function again, to set the triangulation to the same state as // before the serialization. Only afterwards we know how to deserialize the @@ -2289,9 +2289,9 @@ namespace Particles handle = numbers::invalid_unsigned_int; update_cached_numbers(); } -#else - (void)serialization; -#endif +//#else +// (void)serialization; +//#endif } diff --git a/tests/serialization/particle_handler_03.with_p4est=true.output b/tests/serialization/particle_handler_03.with_p4est=true.output deleted file mode 100644 index a97ab8fe8f..0000000000 --- a/tests/serialization/particle_handler_03.with_p4est=true.output +++ /dev/null @@ -1,103 +0,0 @@ - -DEAL:0:2d/2d::Before serialization particle id 0 is in cell 2.0 -DEAL:0:2d/2d::Before serialization particle id 3 is in cell 2.1 -DEAL:0:2d/2d::Before serialization particle id 1 is in cell 2.2 -DEAL:0:2d/2d::Before serialization particle id 4 is in cell 2.3 -DEAL:0:2d/2d::Before serialization particle id 6 is in cell 2.5 -DEAL:0:2d/2d::Before serialization particle id 7 is in cell 2.7 -DEAL:0:2d/2d::Before serialization particle id 2 is in cell 2.10 -DEAL:0:2d/2d::Before serialization particle id 5 is in cell 2.11 -DEAL:0:2d/2d::Before serialization particle id 8 is in cell 2.15 -DEAL:0:2d/2d::0 0 9 1 9 - -DEAL:0:2d/2d::After serialization particle id 0 is in cell 2.0 -DEAL:0:2d/2d::After serialization particle id 3 is in cell 2.1 -DEAL:0:2d/2d::After serialization particle id 1 is in cell 2.2 -DEAL:0:2d/2d::After serialization particle id 4 is in cell 2.3 -DEAL:0:2d/2d::After serialization particle id 6 is in cell 2.5 -DEAL:0:2d/2d::After serialization particle id 7 is in cell 2.7 -DEAL:0:2d/2d::After serialization particle id 2 is in cell 2.10 -DEAL:0:2d/2d::After serialization particle id 5 is in cell 2.11 -DEAL:0:2d/2d::After serialization particle id 8 is in cell 2.15 -DEAL:0:2d/2d::OK -DEAL:0:2d/2d:: -DEAL:0:2d/3d::Before serialization particle id 0 is in cell 2.0 -DEAL:0:2d/3d::Before serialization particle id 3 is in cell 2.1 -DEAL:0:2d/3d::Before serialization particle id 1 is in cell 2.2 -DEAL:0:2d/3d::Before serialization particle id 4 is in cell 2.3 -DEAL:0:2d/3d::Before serialization particle id 6 is in cell 2.5 -DEAL:0:2d/3d::Before serialization particle id 7 is in cell 2.7 -DEAL:0:2d/3d::Before serialization particle id 2 is in cell 2.10 -DEAL:0:2d/3d::Before serialization particle id 5 is in cell 2.11 -DEAL:0:2d/3d::Before serialization particle id 8 is in cell 2.15 -DEAL:0:2d/3d::0 0 9 1 9 - -DEAL:0:2d/3d::After serialization particle id 0 is in cell 2.0 -DEAL:0:2d/3d::After serialization particle id 3 is in cell 2.1 -DEAL:0:2d/3d::After serialization particle id 1 is in cell 2.2 -DEAL:0:2d/3d::After serialization particle id 4 is in cell 2.3 -DEAL:0:2d/3d::After serialization particle id 6 is in cell 2.5 -DEAL:0:2d/3d::After serialization particle id 7 is in cell 2.7 -DEAL:0:2d/3d::After serialization particle id 2 is in cell 2.10 -DEAL:0:2d/3d::After serialization particle id 5 is in cell 2.11 -DEAL:0:2d/3d::After serialization particle id 8 is in cell 2.15 -DEAL:0:2d/3d::OK -DEAL:0:2d/3d:: -DEAL:0:3d/3d::Before serialization particle id 0 is in cell 2.0 -DEAL:0:3d/3d::Before serialization particle id 1 is in cell 2.0 -DEAL:0:3d/3d::Before serialization particle id 2 is in cell 2.0 -DEAL:0:3d/3d::Before serialization particle id 9 is in cell 2.1 -DEAL:0:3d/3d::Before serialization particle id 10 is in cell 2.1 -DEAL:0:3d/3d::Before serialization particle id 11 is in cell 2.1 -DEAL:0:3d/3d::Before serialization particle id 3 is in cell 2.6 -DEAL:0:3d/3d::Before serialization particle id 4 is in cell 2.6 -DEAL:0:3d/3d::Before serialization particle id 5 is in cell 2.6 -DEAL:0:3d/3d::Before serialization particle id 12 is in cell 2.7 -DEAL:0:3d/3d::Before serialization particle id 13 is in cell 2.7 -DEAL:0:3d/3d::Before serialization particle id 14 is in cell 2.7 -DEAL:0:3d/3d::Before serialization particle id 18 is in cell 2.9 -DEAL:0:3d/3d::Before serialization particle id 19 is in cell 2.9 -DEAL:0:3d/3d::Before serialization particle id 20 is in cell 2.9 -DEAL:0:3d/3d::Before serialization particle id 21 is in cell 2.15 -DEAL:0:3d/3d::Before serialization particle id 22 is in cell 2.15 -DEAL:0:3d/3d::Before serialization particle id 23 is in cell 2.15 -DEAL:0:3d/3d::Before serialization particle id 6 is in cell 2.54 -DEAL:0:3d/3d::Before serialization particle id 7 is in cell 2.54 -DEAL:0:3d/3d::Before serialization particle id 8 is in cell 2.54 -DEAL:0:3d/3d::Before serialization particle id 15 is in cell 2.55 -DEAL:0:3d/3d::Before serialization particle id 16 is in cell 2.55 -DEAL:0:3d/3d::Before serialization particle id 17 is in cell 2.55 -DEAL:0:3d/3d::Before serialization particle id 24 is in cell 2.63 -DEAL:0:3d/3d::Before serialization particle id 25 is in cell 2.63 -DEAL:0:3d/3d::Before serialization particle id 26 is in cell 2.63 -DEAL:0:3d/3d::0 0 27 3 27 - -DEAL:0:3d/3d::After serialization particle id 0 is in cell 2.0 -DEAL:0:3d/3d::After serialization particle id 1 is in cell 2.0 -DEAL:0:3d/3d::After serialization particle id 2 is in cell 2.0 -DEAL:0:3d/3d::After serialization particle id 9 is in cell 2.1 -DEAL:0:3d/3d::After serialization particle id 10 is in cell 2.1 -DEAL:0:3d/3d::After serialization particle id 11 is in cell 2.1 -DEAL:0:3d/3d::After serialization particle id 3 is in cell 2.6 -DEAL:0:3d/3d::After serialization particle id 4 is in cell 2.6 -DEAL:0:3d/3d::After serialization particle id 5 is in cell 2.6 -DEAL:0:3d/3d::After serialization particle id 12 is in cell 2.7 -DEAL:0:3d/3d::After serialization particle id 13 is in cell 2.7 -DEAL:0:3d/3d::After serialization particle id 14 is in cell 2.7 -DEAL:0:3d/3d::After serialization particle id 18 is in cell 2.9 -DEAL:0:3d/3d::After serialization particle id 19 is in cell 2.9 -DEAL:0:3d/3d::After serialization particle id 20 is in cell 2.9 -DEAL:0:3d/3d::After serialization particle id 21 is in cell 2.15 -DEAL:0:3d/3d::After serialization particle id 22 is in cell 2.15 -DEAL:0:3d/3d::After serialization particle id 23 is in cell 2.15 -DEAL:0:3d/3d::After serialization particle id 6 is in cell 2.54 -DEAL:0:3d/3d::After serialization particle id 7 is in cell 2.54 -DEAL:0:3d/3d::After serialization particle id 8 is in cell 2.54 -DEAL:0:3d/3d::After serialization particle id 15 is in cell 2.55 -DEAL:0:3d/3d::After serialization particle id 16 is in cell 2.55 -DEAL:0:3d/3d::After serialization particle id 17 is in cell 2.55 -DEAL:0:3d/3d::After serialization particle id 24 is in cell 2.63 -DEAL:0:3d/3d::After serialization particle id 25 is in cell 2.63 -DEAL:0:3d/3d::After serialization particle id 26 is in cell 2.63 -DEAL:0:3d/3d::OK -DEAL:0:3d/3d:: diff --git a/tests/serialization/particle_handler_04.cc b/tests/serialization/particle_handler_04.cc index 6ec77fa87b..3f035603f7 100644 --- a/tests/serialization/particle_handler_04.cc +++ b/tests/serialization/particle_handler_04.cc @@ -135,19 +135,21 @@ test() << " is in cell " << particle->get_surrounding_cell(tr) << std::endl; + particle_handler.prepare_for_serialization(); + // save data to archive - std::ostringstream oss; + std::ofstream oss("data.particles"); { - //boost::archive::text_oarchive oa(oss, boost::archive::no_header); + boost::archive::text_oarchive oa(oss, boost::archive::no_header); - //oa << particle_handler; - particle_handler.prepare_for_serialization(); + oa << particle_handler; tr.save("checkpoint"); // archive and stream closed when // destructors are called } - deallog << oss.str() << std::endl; + oss.close(); + //deallog << oss.str() << std::endl; // Now remove all information in tr and particle_handler, // this is like creating new objects after a restart @@ -169,10 +171,10 @@ test() // does not know if something was stored in the user data of the // triangulation). { - // std::istringstream iss(oss.str()); - // boost::archive::text_iarchive ia(iss, boost::archive::no_header); + std::ifstream iss("data.particles"); + boost::archive::text_iarchive ia(iss, boost::archive::no_header); - // ia >> particle_handler; + ia >> particle_handler; tr.load("checkpoint"); particle_handler.deserialize(); } diff --git a/tests/serialization/particle_handler_04.mpirun=1.output b/tests/serialization/particle_handler_04.mpirun=1.output index a97ab8fe8f..db908b1579 100644 --- a/tests/serialization/particle_handler_04.mpirun=1.output +++ b/tests/serialization/particle_handler_04.mpirun=1.output @@ -1,103 +1,22 @@ DEAL:0:2d/2d::Before serialization particle id 0 is in cell 2.0 -DEAL:0:2d/2d::Before serialization particle id 3 is in cell 2.1 -DEAL:0:2d/2d::Before serialization particle id 1 is in cell 2.2 -DEAL:0:2d/2d::Before serialization particle id 4 is in cell 2.3 -DEAL:0:2d/2d::Before serialization particle id 6 is in cell 2.5 -DEAL:0:2d/2d::Before serialization particle id 7 is in cell 2.7 -DEAL:0:2d/2d::Before serialization particle id 2 is in cell 2.10 -DEAL:0:2d/2d::Before serialization particle id 5 is in cell 2.11 -DEAL:0:2d/2d::Before serialization particle id 8 is in cell 2.15 -DEAL:0:2d/2d::0 0 9 1 9 - +DEAL:0:2d/2d::Before serialization particle id 1 is in cell 2.12 +DEAL:0:2d/2d::After deserialization global number of particles is: 2 DEAL:0:2d/2d::After serialization particle id 0 is in cell 2.0 -DEAL:0:2d/2d::After serialization particle id 3 is in cell 2.1 -DEAL:0:2d/2d::After serialization particle id 1 is in cell 2.2 -DEAL:0:2d/2d::After serialization particle id 4 is in cell 2.3 -DEAL:0:2d/2d::After serialization particle id 6 is in cell 2.5 -DEAL:0:2d/2d::After serialization particle id 7 is in cell 2.7 -DEAL:0:2d/2d::After serialization particle id 2 is in cell 2.10 -DEAL:0:2d/2d::After serialization particle id 5 is in cell 2.11 -DEAL:0:2d/2d::After serialization particle id 8 is in cell 2.15 +DEAL:0:2d/2d::After serialization particle id 1 is in cell 2.12 DEAL:0:2d/2d::OK DEAL:0:2d/2d:: DEAL:0:2d/3d::Before serialization particle id 0 is in cell 2.0 -DEAL:0:2d/3d::Before serialization particle id 3 is in cell 2.1 -DEAL:0:2d/3d::Before serialization particle id 1 is in cell 2.2 -DEAL:0:2d/3d::Before serialization particle id 4 is in cell 2.3 -DEAL:0:2d/3d::Before serialization particle id 6 is in cell 2.5 -DEAL:0:2d/3d::Before serialization particle id 7 is in cell 2.7 -DEAL:0:2d/3d::Before serialization particle id 2 is in cell 2.10 -DEAL:0:2d/3d::Before serialization particle id 5 is in cell 2.11 -DEAL:0:2d/3d::Before serialization particle id 8 is in cell 2.15 -DEAL:0:2d/3d::0 0 9 1 9 - +DEAL:0:2d/3d::Before serialization particle id 1 is in cell 2.12 +DEAL:0:2d/3d::After deserialization global number of particles is: 2 DEAL:0:2d/3d::After serialization particle id 0 is in cell 2.0 -DEAL:0:2d/3d::After serialization particle id 3 is in cell 2.1 -DEAL:0:2d/3d::After serialization particle id 1 is in cell 2.2 -DEAL:0:2d/3d::After serialization particle id 4 is in cell 2.3 -DEAL:0:2d/3d::After serialization particle id 6 is in cell 2.5 -DEAL:0:2d/3d::After serialization particle id 7 is in cell 2.7 -DEAL:0:2d/3d::After serialization particle id 2 is in cell 2.10 -DEAL:0:2d/3d::After serialization particle id 5 is in cell 2.11 -DEAL:0:2d/3d::After serialization particle id 8 is in cell 2.15 +DEAL:0:2d/3d::After serialization particle id 1 is in cell 2.12 DEAL:0:2d/3d::OK DEAL:0:2d/3d:: DEAL:0:3d/3d::Before serialization particle id 0 is in cell 2.0 -DEAL:0:3d/3d::Before serialization particle id 1 is in cell 2.0 -DEAL:0:3d/3d::Before serialization particle id 2 is in cell 2.0 -DEAL:0:3d/3d::Before serialization particle id 9 is in cell 2.1 -DEAL:0:3d/3d::Before serialization particle id 10 is in cell 2.1 -DEAL:0:3d/3d::Before serialization particle id 11 is in cell 2.1 -DEAL:0:3d/3d::Before serialization particle id 3 is in cell 2.6 -DEAL:0:3d/3d::Before serialization particle id 4 is in cell 2.6 -DEAL:0:3d/3d::Before serialization particle id 5 is in cell 2.6 -DEAL:0:3d/3d::Before serialization particle id 12 is in cell 2.7 -DEAL:0:3d/3d::Before serialization particle id 13 is in cell 2.7 -DEAL:0:3d/3d::Before serialization particle id 14 is in cell 2.7 -DEAL:0:3d/3d::Before serialization particle id 18 is in cell 2.9 -DEAL:0:3d/3d::Before serialization particle id 19 is in cell 2.9 -DEAL:0:3d/3d::Before serialization particle id 20 is in cell 2.9 -DEAL:0:3d/3d::Before serialization particle id 21 is in cell 2.15 -DEAL:0:3d/3d::Before serialization particle id 22 is in cell 2.15 -DEAL:0:3d/3d::Before serialization particle id 23 is in cell 2.15 -DEAL:0:3d/3d::Before serialization particle id 6 is in cell 2.54 -DEAL:0:3d/3d::Before serialization particle id 7 is in cell 2.54 -DEAL:0:3d/3d::Before serialization particle id 8 is in cell 2.54 -DEAL:0:3d/3d::Before serialization particle id 15 is in cell 2.55 -DEAL:0:3d/3d::Before serialization particle id 16 is in cell 2.55 -DEAL:0:3d/3d::Before serialization particle id 17 is in cell 2.55 -DEAL:0:3d/3d::Before serialization particle id 24 is in cell 2.63 -DEAL:0:3d/3d::Before serialization particle id 25 is in cell 2.63 -DEAL:0:3d/3d::Before serialization particle id 26 is in cell 2.63 -DEAL:0:3d/3d::0 0 27 3 27 - +DEAL:0:3d/3d::Before serialization particle id 1 is in cell 2.56 +DEAL:0:3d/3d::After deserialization global number of particles is: 2 DEAL:0:3d/3d::After serialization particle id 0 is in cell 2.0 -DEAL:0:3d/3d::After serialization particle id 1 is in cell 2.0 -DEAL:0:3d/3d::After serialization particle id 2 is in cell 2.0 -DEAL:0:3d/3d::After serialization particle id 9 is in cell 2.1 -DEAL:0:3d/3d::After serialization particle id 10 is in cell 2.1 -DEAL:0:3d/3d::After serialization particle id 11 is in cell 2.1 -DEAL:0:3d/3d::After serialization particle id 3 is in cell 2.6 -DEAL:0:3d/3d::After serialization particle id 4 is in cell 2.6 -DEAL:0:3d/3d::After serialization particle id 5 is in cell 2.6 -DEAL:0:3d/3d::After serialization particle id 12 is in cell 2.7 -DEAL:0:3d/3d::After serialization particle id 13 is in cell 2.7 -DEAL:0:3d/3d::After serialization particle id 14 is in cell 2.7 -DEAL:0:3d/3d::After serialization particle id 18 is in cell 2.9 -DEAL:0:3d/3d::After serialization particle id 19 is in cell 2.9 -DEAL:0:3d/3d::After serialization particle id 20 is in cell 2.9 -DEAL:0:3d/3d::After serialization particle id 21 is in cell 2.15 -DEAL:0:3d/3d::After serialization particle id 22 is in cell 2.15 -DEAL:0:3d/3d::After serialization particle id 23 is in cell 2.15 -DEAL:0:3d/3d::After serialization particle id 6 is in cell 2.54 -DEAL:0:3d/3d::After serialization particle id 7 is in cell 2.54 -DEAL:0:3d/3d::After serialization particle id 8 is in cell 2.54 -DEAL:0:3d/3d::After serialization particle id 15 is in cell 2.55 -DEAL:0:3d/3d::After serialization particle id 16 is in cell 2.55 -DEAL:0:3d/3d::After serialization particle id 17 is in cell 2.55 -DEAL:0:3d/3d::After serialization particle id 24 is in cell 2.63 -DEAL:0:3d/3d::After serialization particle id 25 is in cell 2.63 -DEAL:0:3d/3d::After serialization particle id 26 is in cell 2.63 +DEAL:0:3d/3d::After serialization particle id 1 is in cell 2.56 DEAL:0:3d/3d::OK DEAL:0:3d/3d:: -- 2.39.5