WorkStream::run error for hp iterator

16 views
Skip to first unread message

Elyn Luo

unread,
Jun 27, 2022, 1:11:09 AM6/27/22
to dea...@googlegroups.com
Hi,

I'm trying to implement multithreading for a fluid-solid interaction problem (and thus I used hp mode). I used workstream for CPU acceleration and the code is below:

WorkStream::run(dof_handler.begin_active(),
                    dof_handler.end(),
                    *this,
                    &ElasticWaveEquation::local_assemble_system,
                    &ElasticWaveEquation::copy_local_to_global,
                    AssemblyBlockScratchData(fe_collection, q_collection, solid_fe, liquid_fe, time_step, lambda, mu, rho, mesh_size, N_mesh),
                    AssemblyBlockCopyData());

However, it looks like the function does not support hp iterators. The error is:

 deduced conflicting types for parameter ‘const Iterator’ (‘dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::hp::DoFHandler<2, 2>, false> >’ and ‘dealii::DoFHandler<2>::active_cell_iterator’ {aka ‘dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::DoFHandler<2>, false> >’})

Is there any workaround for this problem? Thank you!

Regards,
Elyn

Bruno Turcksin

unread,
Jun 27, 2022, 7:54:42 AM6/27/22
to deal.II User Group
Elyn,

hp support has been added a couple of month ago. This means that you need to update deal.ii to 9.4.0 which has just been released.

Best,

Bruno

Wolfgang Bangerth

unread,
Jun 27, 2022, 3:50:17 PM6/27/22
to dea...@googlegroups.com
On 6/27/22 14:10, Elyn Luo wrote:
>
> *deduced conflicting types for parameter ‘const Iterator’
> (‘dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::hp::DoFHandler<2,
> 2>, false> >’ and ‘dealii::DoFHandler<2>::active_cell_iterator’ {aka
> ‘dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::DoFHandler<2>,
> false> >’})*

Somewhere in the list of arguments that you are passing, you are using *both*
DoFHandler::active_cell_iterator and hp::DoFHandler::active_cell_iterator.
These needs to be the same. Which argument is problematic I don't know because
I don't know the code nor the exact error message, but looking at the
signature of the function you are calling, namely

template <typename MainClass,
typename Iterator,
typename ScratchData,
typename CopyData>
void
run(const Iterator & begin,
const typename identity<Iterator>::type &end,
MainClass & main_object,
void (MainClass::*worker)(const Iterator &, ScratchData &, CopyData &),
void (MainClass::*copier)(const CopyData &),
const ScratchData &sample_scratch_data,
const CopyData & sample_copy_data,
const unsigned int queue_length = 2 * MultithreadInfo::n_threads(),
const unsigned int chunk_size = 8)

...the 'Iterator' template argument appears both in the first argument 'begin'
and in 'worker'. What is the function signature for
ElasticWaveEquation::local_assemble_system() in your case? Does it take a
DoFHandler::active_cell_iterator or hp::DoFHandler::active_cell_iterator as
first argument?


Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages