]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
implementation of multithread support
authorrichter <richter@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Feb 2000 13:28:51 +0000 (13:28 +0000)
committerrichter <richter@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Feb 2000 13:28:51 +0000 (13:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@2389 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_out.h

index f4e3cb57a23491c34604812d1a1c10054940704c..0fbe8386aa9b94a9e1f2b4f594ce80e74731879a 100644 (file)
@@ -383,10 +383,14 @@ class DataOut : public DataOut_DoFData<dim>
                                      * functions of the base class. See the
                                      * general documentation of this class
                                      * for further information.
+                                     *
+                                     * The functions supports multithreading.
                                      */
-    virtual void build_patches (const unsigned int n_subdivisions = 1);
+    virtual void build_patches (const unsigned int n_subdivisions = 1,
+                               const unsigned int n_threads_     = 1);
+    
 
-                                    /**
+                                    /**
                                      * Return the first cell which we
                                      * want output for. The default
                                      * implementation returns the first
@@ -408,6 +412,7 @@ class DataOut : public DataOut_DoFData<dim>
                                      * active cell, but you might want
                                      * to return other cells in a derived
                                      * class. Note that the default
+
                                      * implementation assumes that
                                      * the given #cell# is active, which
                                      * is guaranteed as long as #first_cell#
@@ -418,6 +423,37 @@ class DataOut : public DataOut_DoFData<dim>
                                      */
     virtual typename DoFHandler<dim>::cell_iterator
     next_cell (const typename DoFHandler<dim>::cell_iterator &cell);
+
+  private:
+                                    /**
+                                     * All data needed in one thread
+                                     * is gathered in the struct
+                                     * Data.
+                                     * The data is handled globally
+                                     * to avoid allocation of memory
+                                     * in the threads.
+                                     */
+    struct Data 
+    {
+       unsigned int n_threads;
+       unsigned int this_thread;
+       unsigned int n_components;
+       unsigned int n_datasets;
+       unsigned int n_subdivisions;
+       vector<double>          patch_values;
+       vector<Vector<double> > patch_values_system;
+       Data ()
+         {}
+    };
+                                    /**
+                                     * Builds every #n_threads's#
+                                     * patch. This function may be
+                                     * called parallel.
+                                     * If multithreading is not
+                                     * used, the function is called
+                                     * once and generates all patches.
+                                     */
+    void * DataOut<dim>::build_some_patches (Data data);
 };
 
 

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.