[Dune] example for mpicollectivecommunication
Christian Engwer
christian.engwer at uni-muenster.de
Sun Oct 5 16:56:11 CEST 2014
On Wed, Oct 01, 2014 at 12:02:48PM +0200, Aleksejs Fomins wrote:
> Thank you for your replies.
>
> So I write it like this
>
> ------------------------------------
> Dune::CollectiveCommunication comm =
> mpihelper_.getCollectiveCommunication();
You do not instatiate CollectiveCommunication by hand, but retrieve it
from your mash (in your case from the host grid)
Christian
> int parallel_sum_elem = comm.sum(internal_elements.size());
> ------------------------------------
>
> and get error
>
> error: missing template arguments before ‘comm’
> Dune::CollectiveCommunication comm =
> mpihelper_.getCollectiveCommunication();
>
> How do how do I get the correct template argument.
>
> I am sorry if this question is trivial, I am just not very familiar with
> the structure yet.
>
> Regards,
> Aleksejs
>
>
>
> On 10/01/2014 11:27 AM, Tobias Malkmus wrote:
> > Hi Aleksejs
> >
> > You can use the Dune::CollectiveCommunication from
> > dune-common/dune/common/parallel/mpicollectivecommunication.hh.
> > It contains a method called sum, which does what you need.
> >
> > Of cousre you will have to initialize the MPI communicator using:
> >
> > MPIHelper::instance( argc, argv )
> >
> > from dune-common/dune/common/parallel/mpihelper.hh at the beginning of
> > your main routine.
> >
> > Don't forget to configure dune with parallel support(
> > --enable-parallel, MPICC=/.../mpicc )
> >
> >
> > Best Tobias
> >
> > On 10/01/2014 11:00 AM, Aleksejs Fomins wrote:
> >> Dear Dune,
> >
> >> I would like to sum up a variable over all processes.
> >
> >> Could you suggest an example program I can take inspiration from?
> >
> >> Thank you, Aleksejs
> >
> >
> >
> >> _______________________________________________ Dune mailing list
> >> Dune at dune-project.org
> >> http://lists.dune-project.org/mailman/listinfo/dune
> >
> >
> >
> >
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
--
Prof. Dr. Christian Engwer
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster
E-Mail christian.engwer at uni-muenster.de
Telefon +49 251 83-35067
FAX +49 251 83-32729
More information about the Dune
mailing list