From: Wolfgang Bangerth Date: Wed, 19 Aug 2015 20:44:38 +0000 (-0500) Subject: Queue up even more work and do something on the main thread. X-Git-Tag: v8.4.0-rc2~582^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1391%2Fhead;p=dealii.git Queue up even more work and do something on the main thread. --- diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index b944dfffec..bb75e3bc55 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3403,20 +3403,27 @@ FEValues::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::InternalDataBase *> + fe_get_data = Threads::new_task (&FiniteElement::get_data, + *this->fe, + flags, + *this->mapping, + quadrature); Threads::Task::InternalDataBase *> mapping_get_data = Threads::new_task (&Mapping::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::initialize(this->n_quadrature_points, flags); internal::FEValues::FiniteElementRelatedData::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::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::InternalDataBase *> + fe_get_data = Threads::new_task (&FiniteElement::get_face_data, + *this->fe, + flags, + *this->mapping, + this->quadrature); Threads::Task::InternalDataBase *> mapping_get_data = Threads::new_task (&Mapping::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::initialize(this->n_quadrature_points, flags); internal::FEValues::FiniteElementRelatedData::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::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::InternalDataBase *> + fe_get_data = Threads::new_task (&FiniteElement::get_subface_data, + *this->fe, + flags, + *this->mapping, + this->quadrature); Threads::Task::InternalDataBase *> mapping_get_data = Threads::new_task (&Mapping::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::initialize(this->n_quadrature_points, flags); internal::FEValues::FiniteElementRelatedData::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()); }