Broadcast arbitrary types

30 views
Skip to first unread message

Paras Kumar

unread,
May 21, 2020, 6:55:01 AM5/21/20
to deal.II User Group
Dear Deal.II community,

Could someone please confirm if deal.II offers an analogue of MPI_Bcast(), i.e. a function to broadcast arbitrary types, since there are functions like dealii::Utilities::MPI::gather<T>().
An alternative solution could be to pack the type into a stream using dealii::Utilities::pack<T>() and then call MPI_Bcast() myself on this packaged stream.

Best regards,
Paras

Wolfgang Bangerth

unread,
May 21, 2020, 11:04:19 AM5/21/20
to dea...@googlegroups.com
On 5/21/20 4:55 AM, Paras Kumar wrote:
>
> Could someone please confirm if deal.II offers an analogue of MPI_Bcast(),
> i.e. a function to broadcast arbitrary types, since there are functions like
> dealii::Utilities::MPI::gather<T>().
> An alternative solution could be to pack the type into a stream using
> dealii::Utilities::pack<T>() and then call MPI_Bcast() myself on this packaged
> stream.

There is not currently a function to do that, though if you look at how
gather<T> is written, you'll immediately see how to write a corresponding
broadcast<T> function. We'd be very happy to accept a patch that adds such a
function.

Best
W.


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

Paras Kumar

unread,
May 21, 2020, 11:53:41 AM5/21/20
to deal.II User Group
Dear Wolfgang,

Thank you for the reply. I will try to add it soon.

Best,
Paras
Reply all
Reply to author
Forward
0 new messages