mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
dynamically set zoltan imbalance tolerance
This commit is contained in:
@@ -116,6 +116,11 @@ struct SerialPartitioning {
|
|||||||
using type = UndefinedProperty;
|
using type = UndefinedProperty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
struct ZoltanImbalanceTol {
|
||||||
|
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 = "";
|
||||||
@@ -153,6 +158,12 @@ struct SerialPartitioning<TypeTag, TTag::EclBaseVanguard> {
|
|||||||
static constexpr bool value = false;
|
static constexpr bool value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class TypeTag>
|
||||||
|
struct ZoltanImbalanceTol<TypeTag, TTag::EclBaseVanguard> {
|
||||||
|
using type = GetPropType<TypeTag, Scalar>;
|
||||||
|
static constexpr type value = 1.1;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
@@ -206,6 +217,9 @@ public:
|
|||||||
"Order cells owned by rank before ghost/overlap cells.");
|
"Order cells owned by rank before ghost/overlap cells.");
|
||||||
EWOMS_REGISTER_PARAM(TypeTag, bool, SerialPartitioning,
|
EWOMS_REGISTER_PARAM(TypeTag, bool, SerialPartitioning,
|
||||||
"Perform partitioning for parallel runs on a single process.");
|
"Perform partitioning for parallel runs on a single process.");
|
||||||
|
EWOMS_REGISTER_PARAM(TypeTag, Scalar, ZoltanImbalanceTol,
|
||||||
|
"Perform partitioning for parallel runs on a single process.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -339,6 +353,7 @@ public:
|
|||||||
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);
|
serialPartitioning_ = EWOMS_GET_PARAM(TypeTag, bool, SerialPartitioning);
|
||||||
|
zoltanImbalanceTol_ = EWOMS_GET_PARAM(TypeTag, Scalar, ZoltanImbalanceTol);
|
||||||
|
|
||||||
// Make proper case name.
|
// Make proper case name.
|
||||||
{
|
{
|
||||||
@@ -539,6 +554,12 @@ public:
|
|||||||
bool serialPartitioning() const
|
bool serialPartitioning() const
|
||||||
{ return serialPartitioning_; }
|
{ return serialPartitioning_; }
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Parameter that sets the zoltan imbalance tolarance.
|
||||||
|
*/
|
||||||
|
Scalar zoltanImbalanceTol() const
|
||||||
|
{ return zoltanImbalanceTol_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the name of the case.
|
* \brief Returns the name of the case.
|
||||||
*
|
*
|
||||||
@@ -791,6 +812,7 @@ private:
|
|||||||
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
||||||
bool ownersFirst_;
|
bool ownersFirst_;
|
||||||
bool serialPartitioning_;
|
bool serialPartitioning_;
|
||||||
|
Scalar zoltanImbalanceTol_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*! \brief The cell centroids after loadbalance was called.
|
/*! \brief The cell centroids after loadbalance was called.
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ public:
|
|||||||
Dune::EdgeWeightMethod edgeWeightsMethod = this->edgeWeightsMethod();
|
Dune::EdgeWeightMethod edgeWeightsMethod = this->edgeWeightsMethod();
|
||||||
bool ownersFirst = this->ownersFirst();
|
bool ownersFirst = this->ownersFirst();
|
||||||
bool serialPartitioning = this->serialPartitioning();
|
bool serialPartitioning = this->serialPartitioning();
|
||||||
|
Scalar zoltanImbalanceTol = this->zoltanImbalanceTol();
|
||||||
|
|
||||||
// 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
|
||||||
@@ -220,7 +221,8 @@ 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, serialPartitioning, faceTrans.data(), ownersFirst));
|
this->parallelWells_ = std::get<1>(grid_->loadBalance(handle, edgeWeightsMethod, &wells, serialPartitioning,
|
||||||
|
faceTrans.data(), ownersFirst, false, 1, true, zoltanImbalanceTol));
|
||||||
}
|
}
|
||||||
catch(const std::bad_cast& e)
|
catch(const std::bad_cast& e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user