From 35c13de342845fd5d2459d42ebc39d1022b70ae4 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 18 Jan 2017 12:10:12 +0100 Subject: [PATCH] Switch of collecting data in non-parallel run. Might save some time, space, and suprises. --- ebos/collecttoiorank.hh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ebos/collecttoiorank.hh b/ebos/collecttoiorank.hh index c9ff5d5c6..697411135 100644 --- a/ebos/collecttoiorank.hh +++ b/ebos/collecttoiorank.hh @@ -177,8 +177,14 @@ namespace Ewoms CollectDataToIORank( const GridManager& gridManager ) : 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 Dune::MultipleCodimMultipleGeomTypeMapper ElementMapper; @@ -384,6 +390,11 @@ namespace Ewoms template void collect( BufferList& bufferList ) const { + if ( !isParallel_ ) + { + // no need to collect anything. + return; + } PackUnPackOutputBuffers< BufferList > packUnpack( bufferList, localIndexMap_, @@ -418,6 +429,8 @@ namespace Ewoms IndexMapStorageType indexMaps_; // true if we are on I/O rank bool isIORank_; + /// \brief True if there is more than one MPI process + bool isParallel_; }; } // end namespace Opm