]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add distributed refinement signal 5150/head
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Fri, 22 Sep 2017 20:31:19 +0000 (14:31 -0600)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Wed, 27 Sep 2017 15:49:04 +0000 (09:49 -0600)
doc/news/changes/minor/20170925ReneGassmoeller [new file with mode: 0644]
include/deal.II/grid/tria.h
source/distributed/tria.cc

diff --git a/doc/news/changes/minor/20170925ReneGassmoeller b/doc/news/changes/minor/20170925ReneGassmoeller
new file mode 100644 (file)
index 0000000..7b660e4
--- /dev/null
@@ -0,0 +1,9 @@
+New: There are new signals in the Triangulation class
+that signal the beginning and end of a parallel::distributed
+refinement and serialization. This allows to connect functions
+that should be called uniquely once before and after
+refinement and serialization for parallel distributed
+Triangulations (something not possible with the existing
+signals).
+<br>
+(Rene Gassmoeller, 2017/09/25)
index 88eff749b9d37576e8219dff61526c2dd5a069e6..00764f4761b4c76c5b893ed4b9071a2e350d6a40 100644 (file)
@@ -2197,6 +2197,44 @@ public:
     boost::signals2::signal<unsigned int (const cell_iterator &,
                                           const CellStatus),
                                                 CellWeightSum<unsigned int> > cell_weight;
+
+    /**
+     * This signal is triggered at the beginning of execution of the
+     * parallel::distributed::Triangulation::execute_coarsening_and_refinement()
+     * function (which is
+     * itself called by other functions such as Triangulation::refine_global()
+     * ). At the time this signal is triggered, the triangulation is still
+     * unchanged. This signal
+     * is different from the pre_refinement signal, because in the parallel distributed
+     * case the pre_refinement signal is triggered multiple times without a way to
+     * distinguish the last signal call.
+     */
+    boost::signals2::signal<void ()> pre_distributed_refinement;
+
+    /**
+     * This signal is triggered at the end of execution of the
+     * parallel::distributed::Triangulation::execute_coarsening_and_refinement()
+     * function when the triangulation has reached its final state. This signal
+     * is different from the post_refinement signal, because in the parallel distributed
+     * case the post_refinement signal is triggered multiple times without a way to
+     * distinguish the last signal call.
+     */
+    boost::signals2::signal<void ()> post_distributed_refinement;
+
+    /**
+     * This signal is triggered at the beginning of execution of the
+     * parallel::distributed::Triangulation::save()
+     * function. At the time this signal is triggered, the triangulation
+     * is still unchanged.
+     */
+    boost::signals2::signal<void ()> pre_distributed_save;
+
+    /**
+     * This signal is triggered at the end of execution of the
+     * parallel::distributed::Triangulation::load()
+     * function when the triangulation has reached its final state.
+     */
+    boost::signals2::signal<void ()> post_distributed_load;
   };
 
   /**
index 0812303743bbed667ac8dae53355cf6e1ed31039..7b21633eebb8b2c54e410b0f95f1221730ba57a3 100644 (file)
@@ -1765,6 +1765,10 @@ namespace parallel
     {
       Assert(n_attached_deserialize==0,
              ExcMessage ("not all SolutionTransfer's got deserialized after the last load()"));
+
+      // signal that serialization is going to happen
+      this->signals.pre_distributed_save();
+
       int real_data_size = 0;
       if (attached_data_size>0)
         real_data_size = attached_data_size+sizeof(CellStatus);
@@ -1887,6 +1891,10 @@ namespace parallel
         }
 
       this->update_number_cache ();
+
+      // signal that de-serialization is finished
+      this->signals.post_distributed_load();
+
       this->update_periodic_face_map();
     }
 
@@ -2865,6 +2873,9 @@ namespace parallel
             }
         }
 
+      // signal that refinement is going to happen
+      this->signals.pre_distributed_refinement();
+
       // now do the work we're supposed to do when we are in charge
       refinement_in_progress = true;
       this->prepare_coarsening_and_refinement ();
@@ -3038,6 +3049,12 @@ namespace parallel
 
       refinement_in_progress = false;
       this->update_number_cache ();
+
+      // signal that refinement is finished,
+      // this is triggered before update_periodic_face_map
+      // to be consistent with the serial triangulation class
+      this->signals.post_distributed_refinement();
+
       this->update_periodic_face_map();
     }
 

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.