Switch of collecting data in non-parallel run.

Might save some time, space, and suprises.
This commit is contained in:
Markus Blatt
2017-01-18 12:10:12 +01:00
parent b61ff14eb0
commit 35c13de342

View File

@@ -177,8 +177,14 @@ namespace Ewoms
CollectDataToIORank( const GridManager& gridManager ) CollectDataToIORank( const GridManager& gridManager )
: toIORankComm_( ), : toIORankComm_( ),
isIORank_( gridManager.grid().comm().rank() == ioRank ) isIORank_( gridManager.grid().comm().rank() == ioRank ),
isParallel_( gridManager.grid().comm().size() > 1 )
{ {
if ( !isParallel_ )
{
// no need to collect anything.
return;
}
typedef typename GridManager::GridView GridView; typedef typename GridManager::GridView GridView;
typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>
ElementMapper; ElementMapper;
@@ -384,6 +390,11 @@ namespace Ewoms
template <class BufferList> template <class BufferList>
void collect( BufferList& bufferList ) const void collect( BufferList& bufferList ) const
{ {
if ( !isParallel_ )
{
// no need to collect anything.
return;
}
PackUnPackOutputBuffers< BufferList > PackUnPackOutputBuffers< BufferList >
packUnpack( bufferList, packUnpack( bufferList,
localIndexMap_, localIndexMap_,
@@ -418,6 +429,8 @@ namespace Ewoms
IndexMapStorageType indexMaps_; IndexMapStorageType indexMaps_;
// true if we are on I/O rank // true if we are on I/O rank
bool isIORank_; bool isIORank_;
/// \brief True if there is more than one MPI process
bool isParallel_;
}; };
} // end namespace Opm } // end namespace Opm