SimulatorFullyImplicitOutput: added flag for async output.

This commit is contained in:
Robert Kloefkorn 2016-03-29 10:48:24 +02:00
parent 29053dc18d
commit d5c375f297
2 changed files with 12 additions and 4 deletions

View File

@ -307,9 +307,15 @@ namespace Opm
// serial output is only done on I/O rank
if( isIORank )
{
// spawn write thread that calls eclWriter.writeTimeStepSerial
WriterCall call( *this, timer, state, wellState, substep );
std::async( std::move( call ) );
if( asyncOutput_ ) {
// spawn write thread that calls eclWriter.writeTimeStepSerial
WriterCall call( *this, timer, state, wellState, substep );
std::async( std::move( call ) );
}
else {
// just write the data to disk
writeTimeStepSerial( timer, state, wellState, substep );
}
}
}

View File

@ -261,6 +261,7 @@ namespace Opm
std::unique_ptr< OutputWriter > matlabWriter_;
std::unique_ptr< EclipseWriter > eclWriter_;
EclipseStateConstPtr eclipseState_;
const bool asyncOutput_ ;
};
@ -293,7 +294,8 @@ namespace Opm
parallelOutput_->numCells(),
parallelOutput_->globalCell() )
: 0 ),
eclipseState_(eclipseState)
eclipseState_(eclipseState),
asyncOutput_( output_ ? param.getDefault("async_output", bool( false ) ) : false )
{
// For output.
if (output_ && parallelOutput_->isIORank() ) {