]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Queue up even more work and do something on the main thread. 1391/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 19 Aug 2015 20:44:38 +0000 (15:44 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 19 Aug 2015 20:44:38 +0000 (15:44 -0500)
source/fe/fe_values.cc

index b944dfffec5500adfc2abc31c114ccafee72cd13..bb75e3bc5535e266fc4930f6bb736120953482de 100644 (file)
@@ -3403,20 +3403,27 @@ FEValues<dim,spacedim>::initialize (const UpdateFlags update_flags)
 
   // then get objects into which the FE and the Mapping can store
   // intermediate data used across calls to reinit. we can do this in parallel
+  Threads::Task<typename FiniteElement<dim,spacedim>::InternalDataBase *>
+  fe_get_data = Threads::new_task (&FiniteElement<dim,spacedim>::get_data,
+                                   *this->fe,
+                                   flags,
+                                   *this->mapping,
+                                   quadrature);
   Threads::Task<typename Mapping<dim,spacedim>::InternalDataBase *>
   mapping_get_data = Threads::new_task (&Mapping<dim,spacedim>::get_data,
                                         *this->mapping,
                                         flags,
                                         quadrature);
 
-  this->fe_data.reset (this->fe->get_data(flags, *this->mapping, quadrature));
-  this->mapping_data.reset (mapping_get_data.return_value());
-
   // initialize the base classes
   internal::FEValues::MappingRelatedData<dim,spacedim>::initialize(this->n_quadrature_points, flags);
   internal::FEValues::FiniteElementRelatedData<dim,spacedim>::initialize(this->n_quadrature_points, *this->fe, flags);
 
   this->update_flags = flags;
+
+  // then collect answers from the two task above
+  this->fe_data.reset (fe_get_data.return_value());
+  this->mapping_data.reset (mapping_get_data.return_value());
 }
 
 
@@ -3636,20 +3643,27 @@ FEFaceValues<dim,spacedim>::initialize (const UpdateFlags update_flags)
 
   // then get objects into which the FE and the Mapping can store
   // intermediate data used across calls to reinit. this can be done in parallel
+  Threads::Task<typename FiniteElement<dim,spacedim>::InternalDataBase *>
+  fe_get_data = Threads::new_task (&FiniteElement<dim,spacedim>::get_face_data,
+                                   *this->fe,
+                                   flags,
+                                   *this->mapping,
+                                   this->quadrature);
   Threads::Task<typename Mapping<dim,spacedim>::InternalDataBase *>
   mapping_get_data = Threads::new_task (&Mapping<dim,spacedim>::get_face_data,
                                         *this->mapping,
                                         flags,
                                         this->quadrature);
 
-  this->fe_data.reset (this->fe->get_face_data(flags, *this->mapping, this->quadrature));
-  this->mapping_data.reset (mapping_get_data.return_value());
-
   // initialize the base classes
   internal::FEValues::MappingRelatedData<dim,spacedim>::initialize(this->n_quadrature_points, flags);
   internal::FEValues::FiniteElementRelatedData<dim,spacedim>::initialize(this->n_quadrature_points, *this->fe, flags);
 
   this->update_flags = flags;
+
+  // then collect answers from the two task above
+  this->fe_data.reset (fe_get_data.return_value());
+  this->mapping_data.reset (mapping_get_data.return_value());
 }
 
 
@@ -3786,22 +3800,27 @@ FESubfaceValues<dim,spacedim>::initialize (const UpdateFlags update_flags)
   // then get objects into which the FE and the Mapping can store
   // intermediate data used across calls to reinit. this can be done
   // in parallel
+  Threads::Task<typename FiniteElement<dim,spacedim>::InternalDataBase *>
+  fe_get_data = Threads::new_task (&FiniteElement<dim,spacedim>::get_subface_data,
+                                   *this->fe,
+                                   flags,
+                                   *this->mapping,
+                                   this->quadrature);
   Threads::Task<typename Mapping<dim,spacedim>::InternalDataBase *>
   mapping_get_data = Threads::new_task (&Mapping<dim,spacedim>::get_subface_data,
                                         *this->mapping,
                                         flags,
                                         this->quadrature);
 
-  this->fe_data.reset (this->fe->get_subface_data(flags,
-                                                  *this->mapping,
-                                                  this->quadrature));
-  this->mapping_data.reset (mapping_get_data.return_value());
-
   // initialize the base classes
   internal::FEValues::MappingRelatedData<dim,spacedim>::initialize(this->n_quadrature_points, flags);
   internal::FEValues::FiniteElementRelatedData<dim,spacedim>::initialize(this->n_quadrature_points, *this->fe, flags);
 
   this->update_flags = flags;
+
+  // then collect answers from the two task above
+  this->fe_data.reset (fe_get_data.return_value());
+  this->mapping_data.reset (mapping_get_data.return_value());
 }
 
 

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.