[Dune-devel] [Dune-Commit] [Commit] dune-grid - f6165ab: [yaspgrid, bugfix] Use canonical communicator type for non-MPI case
Martin Nolte
nolte at mathematik.uni-freiburg.de
Fri Oct 3 12:12:27 CEST 2014
Hi Dominic,
you are right: For ages we have been passing the grid as template argument to
CollectiveCommunication, if MPI was not desired. During that time,
FakeMPIHelper::MPICommunicator was defined as int (which can coincide with MPIComm).
A few years ago, I took the liberty of introducing a type that will never
coincide with MPIComm. This type is called Dune::No_Comm (looking a bit like
MPI_Comm on purpose). It is, of course, an empty class to be used as a tag. This
type is used for FakeMPIHelper::MPICommunicator (so using Dune::No_Comm would
give the same result).
In view of the recent idea to pass the collective communication to the
backup-restore facilities on restore, it might be good if all grids used either
CollectiveCommunication< MPI_Comm > or CollectiveCommunication< No_Comm >.
Best,
Martin
On 10/03/2014 11:54 AM, Dominic Kempf wrote:
> Actually, that is nothing new at all. Its been that way "forever".
>
> In the sequential case, one wants to use the default CollectiveCommunication (as
> defined in collectivecommunication.hh). To get that default implementation, a
> template parameter is to be given, that ensures that there is no specialization,
> that actually does something. Yasp uses its own name to do that. Any other name
> other than MPI_Comm would do.
>
> I will have a look into vtktest to check what is wrong there.
>
>
> On Fri, Oct 3, 2014 at 11:23 AM, Markus Blatt <markus at dr-blatt.de
> <mailto:markus at dr-blatt.de>> wrote:
>
> New commit, appeared at Fri Oct 3 11:23:45 2014 +0200
> as part of the following ref changes:
>
> branch refs/heads/master updated from a3ff58a -> f6165ab
>
> Browsable version:
> http://cgit.dune-project.org/repositories/dune-grid/commit/?id=f6165aba501863dce958719ebbc2103ae8a646da
>
> ======================================================================
>
> commit f6165aba501863dce958719ebbc2103ae8a646da
> Author: Markus Blatt <markus at dr-blatt.de <mailto:markus at dr-blatt.de>>
> Date: Fri Oct 3 11:23:02 2014 +0200
>
> [yaspgrid,bugfix] Use canonical communicator type for non-MPI case
>
> If people write programs the DUNE way then they will end up with
> Dune::FakeMPIHelper::MPICommunicator as their communicator type.
> Unfortunately Yaspgrid uses YaspGrid<dim, Coordinates> which is far
> from being inituitive and broke vtktest. This patch resorts to using
> the canonical choice, Dune::FakeMPIHelper::MPICommunicator, and fixes
> the test.
>
> dune/grid/yaspgrid.hh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>
>
> diff --git a/dune/grid/yaspgrid.hh b/dune/grid/yaspgrid.hh
> index f54fe6f..832ab7c 100644
> --- a/dune/grid/yaspgrid.hh
> +++ b/dune/grid/yaspgrid.hh
> @@ -89,7 +89,7 @@ namespace Dune {
> #if HAVE_MPI
> typedef CollectiveCommunication<MPI_Comm> CCType;
> #else
> - typedef CollectiveCommunication<Dune::YaspGrid<dim, Coordinates> > CCType;
> + typedef CollectiveCommunication<FakeMPIHelper::MPICommunicator> CCType;
> #endif
>
> typedef GridTraits<dim, //
> dimension of the grid
> @@ -167,7 +167,7 @@ namespace Dune {
> #ifdef HAVE_MPI
> typedef CollectiveCommunication<MPI_Comm> CollectiveCommunicationType;
> #else
> - typedef CollectiveCommunication<YaspGrid<dim, Coordinates> >
> CollectiveCommunicationType;
> + typedef CollectiveCommunication<FakeMPIHelper::MPICommunicator>
> CollectiveCommunicationType;
> #endif
>
> #ifndef DOXYGEN
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org <mailto:Dune-Commit at dune-project.org>
> http://lists.dune-project.org/mailman/listinfo/dune-commit
>
>
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
>
--
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>
Universität Freiburg phone: +49-761-203-5630
Abteilung für angewandte Mathematik fax: +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany
More information about the Dune-devel
mailing list