mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
[bugfix] Only create asyncOutput when output is enabled globally.
This commit is contained in:
parent
9a32e2baca
commit
46f66e34b9
@ -378,24 +378,24 @@ namespace Opm
|
|||||||
backupfile_.open( backupfilename.c_str() );
|
backupfile_.open( backupfilename.c_str() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// create output thread if enabled and rank is I/O rank
|
// create output thread if enabled and rank is I/O rank
|
||||||
// async output is enabled by default if pthread are enabled
|
// async output is enabled by default if pthread are enabled
|
||||||
#if HAVE_PTHREAD
|
#if HAVE_PTHREAD
|
||||||
const bool asyncOutputDefault = true;
|
const bool asyncOutputDefault = true;
|
||||||
#else
|
#else
|
||||||
const bool asyncOutputDefault = false;
|
const bool asyncOutputDefault = false;
|
||||||
#endif
|
#endif
|
||||||
if( param.getDefault("async_output", asyncOutputDefault ) )
|
if( param.getDefault("async_output", asyncOutputDefault ) )
|
||||||
{
|
{
|
||||||
|
const bool isIORank = parallelOutput_ ? parallelOutput_->isIORank() : true;
|
||||||
#if HAVE_PTHREAD
|
#if HAVE_PTHREAD
|
||||||
asyncOutput_.reset( new ThreadHandle( parallelOutput_->isIORank() ) );
|
asyncOutput_.reset( new ThreadHandle( isIORank ) );
|
||||||
#else
|
#else
|
||||||
OPM_THROW(std::runtime_error,"Pthreads were not found, cannot enable async_output");
|
OPM_THROW(std::runtime_error,"Pthreads were not found, cannot enable async_output");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user