mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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>
|
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 {
|
||||||
|
@ -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
|
||||||
|
@ -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)
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user