move ThreadsPerProcess to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving 2024-07-05 17:49:51 +02:00
parent a2cbb8cb02
commit f6abb4671e
4 changed files with 5 additions and 10 deletions

View File

@ -366,11 +366,6 @@ template<class TypeTag>
struct OutputDir<TypeTag, Properties::TTag::FvBaseDiscretization> struct OutputDir<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr auto value = "."; }; { static constexpr auto value = "."; };
template<class TypeTag>
struct ThreadsPerProcess<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr int value = 1; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
namespace Opm { namespace Opm {

View File

@ -34,8 +34,8 @@
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag> //! \brief Number of threads per process.
struct ThreadsPerProcess { using type = Properties::UndefinedProperty; }; struct ThreadsPerProcess { static constexpr int value = 1; };
/*! /*!
* \brief Determines if the VTK output is written to disk asynchronously * \brief Determines if the VTK output is written to disk asynchronously

View File

@ -60,7 +60,7 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::ThreadsPerProcess> Parameters::Register<Parameters::ThreadsPerProcess>
("The maximum number of threads to be instantiated per process " ("The maximum number of threads to be instantiated per process "
"('-1' means 'automatic')"); "('-1' means 'automatic')");
} }
@ -78,7 +78,7 @@ public:
{ {
if (queryCommandLineParameter) 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? // some safety checks. This is pretty ugly macro-magic, but so what?
#if !defined(_OPENMP) #if !defined(_OPENMP)

View File

@ -84,8 +84,8 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
("Print the values of the run-time parameters at the " ("Print the values of the run-time parameters at the "
"start of the simulation"); "start of the simulation");
Simulator::registerParameters();
ThreadManager::registerParameters(); ThreadManager::registerParameters();
Simulator::registerParameters();
if (finalizeRegistration) { if (finalizeRegistration) {
Parameters::endRegistration(); Parameters::endRegistration();