Skip to content

Commit

Permalink
[bugfix][PolyhedralGrid] use MPIHelper's default communicator for
Browse files Browse the repository at this point in the history
defining the CollectiveCommunication.
  • Loading branch information
Robert Kloefkorn committed Dec 11, 2019
1 parent bcb5166 commit ea9c65f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions opm/grid/polyhedralgrid/grid.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
//- dune-grid includes
#include <dune/grid/common/grid.hh>
#include <dune/common/parallel/collectivecommunication.hh>
#include <dune/common/parallel/mpicollectivecommunication.hh>
#include <dune/common/parallel/mpihelper.hh>

//- polyhedralgrid includes
#include <opm/grid/polyhedralgrid/capabilities.hh>
Expand Down Expand Up @@ -120,7 +122,7 @@ namespace Dune
typedef PolyhedralGridIdSet< dim, dimworld, ctype > GlobalIdSet;
typedef GlobalIdSet LocalIdSet;

typedef Dune::CollectiveCommunication< Grid > CollectiveCommunication;
typedef Dune::CollectiveCommunication< Dune::MPIHelper::MPICommunicator > CollectiveCommunication;

template< PartitionIteratorType pitype >
struct Partition
Expand Down Expand Up @@ -323,7 +325,7 @@ namespace Dune
const std::vector<double>& poreVolumes = std::vector<double> ())
: gridPtr_( createGrid( deck, poreVolumes ) ),
grid_( *gridPtr_ ),
comm_( *this ),
comm_( Dune::MPIHelper::getCommunicator() ),
leafIndexSet_( *this ),
globalIdSet_( *this ),
localIdSet_( *this ),
Expand All @@ -342,7 +344,7 @@ namespace Dune
const std::vector< double >& dx )
: gridPtr_( createGrid( n, dx ) ),
grid_( *gridPtr_ ),
comm_( *this ),
comm_( Dune::MPIHelper::getCommunicator() ),
leafIndexSet_( *this ),
globalIdSet_( *this ),
localIdSet_( *this ),
Expand All @@ -360,7 +362,7 @@ namespace Dune
explicit PolyhedralGrid ( UnstructuredGridPtr &&gridPtr )
: gridPtr_( std::move( gridPtr ) ),
grid_( *gridPtr_ ),
comm_( *this ),
comm_( Dune::MPIHelper::getCommunicator() ),
leafIndexSet_( *this ),
globalIdSet_( *this ),
localIdSet_( *this ),
Expand All @@ -379,7 +381,7 @@ namespace Dune
explicit PolyhedralGrid ( const UnstructuredGridType& grid )
: gridPtr_(),
grid_( grid ),
comm_( *this ),
comm_( Dune::MPIHelper::getCommunicator() ),
leafIndexSet_( *this ),
globalIdSet_( *this ),
localIdSet_( *this ),
Expand Down Expand Up @@ -675,8 +677,8 @@ namespace Dune
* \param[in] direction communication direction (one of
* ForwardCommunication, BackwardCommunication)
*/
template< class DataHandle, class Data >
void communicate ( CommDataHandleIF< DataHandle, Data >& /* dataHandle */,
template< class DataHandle >
void communicate ( DataHandle& /* dataHandle */,
InterfaceType /* interface */,
CommunicationDirection /* direction */ ) const
{
Expand All @@ -698,6 +700,11 @@ namespace Dune

// data handle interface different between geo and interface

template< class DataHandle >
void scatterData ( DataHandle& /* datahandle */ ) const
{
}

/** \brief rebalance the load each process has to handle
*
* A parallel grid is redistributed such that each process has about
Expand Down

0 comments on commit ea9c65f

Please sign in to comment.