mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add command line parameter --serial-partitioning.
This commit is contained in:
parent
5985dee574
commit
c6203e9bec
@ -111,6 +111,11 @@ struct OwnerCellsFirst {
|
|||||||
using type = UndefinedProperty;
|
using type = UndefinedProperty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
struct SerialPartitioning {
|
||||||
|
using type = UndefinedProperty;
|
||||||
|
};
|
||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct IgnoreKeywords<TypeTag, TTag::EclBaseVanguard> {
|
struct IgnoreKeywords<TypeTag, TTag::EclBaseVanguard> {
|
||||||
static constexpr auto value = "";
|
static constexpr auto value = "";
|
||||||
@ -143,6 +148,10 @@ template<class TypeTag>
|
|||||||
struct OwnerCellsFirst<TypeTag, TTag::EclBaseVanguard> {
|
struct OwnerCellsFirst<TypeTag, TTag::EclBaseVanguard> {
|
||||||
static constexpr bool value = true;
|
static constexpr bool value = true;
|
||||||
};
|
};
|
||||||
|
template<class TypeTag>
|
||||||
|
struct SerialPartitioning<TypeTag, TTag::EclBaseVanguard> {
|
||||||
|
static constexpr bool value = false;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
@ -192,6 +201,8 @@ public:
|
|||||||
"Choose edge-weighing strategy: 0=uniform, 1=trans, 2=log(trans).");
|
"Choose edge-weighing strategy: 0=uniform, 1=trans, 2=log(trans).");
|
||||||
EWOMS_REGISTER_PARAM(TypeTag, bool, OwnerCellsFirst,
|
EWOMS_REGISTER_PARAM(TypeTag, bool, OwnerCellsFirst,
|
||||||
"Order cells owned by rank before ghost/overlap cells.");
|
"Order cells owned by rank before ghost/overlap cells.");
|
||||||
|
EWOMS_REGISTER_PARAM(TypeTag, bool, SerialPartitioning,
|
||||||
|
"Perform partitioning for parallel runs on a single process.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -324,6 +335,7 @@ public:
|
|||||||
std::string fileName = EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName);
|
std::string fileName = EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName);
|
||||||
edgeWeightsMethod_ = Dune::EdgeWeightMethod(EWOMS_GET_PARAM(TypeTag, int, EdgeWeightsMethod));
|
edgeWeightsMethod_ = Dune::EdgeWeightMethod(EWOMS_GET_PARAM(TypeTag, int, EdgeWeightsMethod));
|
||||||
ownersFirst_ = EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst);
|
ownersFirst_ = EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst);
|
||||||
|
serialPartitioning_ = EWOMS_GET_PARAM(TypeTag, bool, SerialPartitioning);
|
||||||
|
|
||||||
// Make proper case name.
|
// Make proper case name.
|
||||||
{
|
{
|
||||||
@ -507,6 +519,13 @@ public:
|
|||||||
bool ownersFirst() const
|
bool ownersFirst() const
|
||||||
{ return ownersFirst_; }
|
{ return ownersFirst_; }
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Parameter that decides if partitioning for parallel runs
|
||||||
|
* should be performed on a single process only.
|
||||||
|
*/
|
||||||
|
bool serialPartitioning() const
|
||||||
|
{ return serialPartitioning_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the name of the case.
|
* \brief Returns the name of the case.
|
||||||
*
|
*
|
||||||
@ -677,6 +696,7 @@ private:
|
|||||||
|
|
||||||
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
||||||
bool ownersFirst_;
|
bool ownersFirst_;
|
||||||
|
bool serialPartitioning_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*! \brief The cell centroids after loadbalance was called.
|
/*! \brief The cell centroids after loadbalance was called.
|
||||||
|
@ -173,6 +173,7 @@ public:
|
|||||||
|
|
||||||
Dune::EdgeWeightMethod edgeWeightsMethod = this->edgeWeightsMethod();
|
Dune::EdgeWeightMethod edgeWeightsMethod = this->edgeWeightsMethod();
|
||||||
bool ownersFirst = this->ownersFirst();
|
bool ownersFirst = this->ownersFirst();
|
||||||
|
bool serialPartitioning = this->serialPartitioning();
|
||||||
|
|
||||||
// convert to transmissibility for faces
|
// convert to transmissibility for faces
|
||||||
// TODO: grid_->numFaces() is not generic. use grid_->size(1) instead? (might
|
// TODO: grid_->numFaces() is not generic. use grid_->size(1) instead? (might
|
||||||
@ -218,7 +219,7 @@ public:
|
|||||||
|
|
||||||
PropsCentroidsDataHandle<Dune::CpGrid> handle(*grid_, eclState, eclGrid, this->centroids_,
|
PropsCentroidsDataHandle<Dune::CpGrid> handle(*grid_, eclState, eclGrid, this->centroids_,
|
||||||
cartesianIndexMapper());
|
cartesianIndexMapper());
|
||||||
this->parallelWells_ = std::get<1>(grid_->loadBalance(handle, edgeWeightsMethod, &wells, faceTrans.data(), ownersFirst));
|
this->parallelWells_ = std::get<1>(grid_->loadBalance(handle, edgeWeightsMethod, &wells, serialPartitioning, faceTrans.data(), ownersFirst));
|
||||||
}
|
}
|
||||||
catch(const std::bad_cast& e)
|
catch(const std::bad_cast& e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user