mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-15 02:53:26 -06:00
move ThreadsPerProcess to TypeTag-free parameter system
This commit is contained in:
parent
a2cbb8cb02
commit
f6abb4671e
@ -366,11 +366,6 @@ template<class TypeTag>
|
||||
struct OutputDir<TypeTag, Properties::TTag::FvBaseDiscretization>
|
||||
{ static constexpr auto value = "."; };
|
||||
|
||||
|
||||
template<class TypeTag>
|
||||
struct ThreadsPerProcess<TypeTag, Properties::TTag::FvBaseDiscretization>
|
||||
{ static constexpr int value = 1; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
@ -34,8 +34,8 @@
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ThreadsPerProcess { using type = Properties::UndefinedProperty; };
|
||||
//! \brief Number of threads per process.
|
||||
struct ThreadsPerProcess { static constexpr int value = 1; };
|
||||
|
||||
/*!
|
||||
* \brief Determines if the VTK output is written to disk asynchronously
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
*/
|
||||
static void registerParameters()
|
||||
{
|
||||
Parameters::registerParam<TypeTag, Parameters::ThreadsPerProcess>
|
||||
Parameters::Register<Parameters::ThreadsPerProcess>
|
||||
("The maximum number of threads to be instantiated per process "
|
||||
"('-1' means 'automatic')");
|
||||
}
|
||||
@ -78,7 +78,7 @@ public:
|
||||
{
|
||||
if (queryCommandLineParameter)
|
||||
{
|
||||
numThreads_ = Parameters::get<TypeTag, Parameters::ThreadsPerProcess>();
|
||||
numThreads_ = Parameters::Get<Parameters::ThreadsPerProcess>();
|
||||
|
||||
// some safety checks. This is pretty ugly macro-magic, but so what?
|
||||
#if !defined(_OPENMP)
|
||||
|
@ -84,8 +84,8 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
|
||||
("Print the values of the run-time parameters at the "
|
||||
"start of the simulation");
|
||||
|
||||
Simulator::registerParameters();
|
||||
ThreadManager::registerParameters();
|
||||
Simulator::registerParameters();
|
||||
|
||||
if (finalizeRegistration) {
|
||||
Parameters::endRegistration();
|
||||
|
Loading…
Reference in New Issue
Block a user