Skip to content

Commit

Permalink
Changes for more resonable partitioning:
Browse files Browse the repository at this point in the history
- option to not remove anything from partitioning graph
- added possibility for setting overlap
- changed export list: need testing in particular in parallel (if it is intended to work there)
  • Loading branch information
hnil authored and bska committed Dec 4, 2024
1 parent b7ef2ef commit 50cf43d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions opm/grid/CpGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,10 +1219,10 @@ namespace Dune
/// \param overlapLayers The number of layers of cells of the overlap region (default: 1).
/// \param partitionMethod The method used to partition the grid, one of Dune::PartitionMethod
/// \warning May only be called once.
bool loadBalance(int overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltan, double imbalanceTol = 1.1)
bool loadBalance(int overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltan, double imbalanceTol = 1.1, bool addCorners = true)
{
using std::get;
return get<0>(scatterGrid(defaultTransEdgeWgt, false, nullptr, {}, false, nullptr, true, overlapLayers, partitionMethod, imbalanceTol));
return get<0>(scatterGrid(defaultTransEdgeWgt, false, nullptr, {}, false, nullptr, addCorners, overlapLayers, partitionMethod, imbalanceTol));
}

// loadbalance is not part of the grid interface therefore we skip it.
Expand Down
3 changes: 2 additions & 1 deletion opm/grid/common/GridPartitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ void addOverlapLayer(const CpGrid& grid, int index, const CpGrid::Codim<0>::Enti
{
// Note: multiple adds for same process are possible
exportList.emplace_back(nb_index, owner, AttributeSet::copy);
exportList.emplace_back(index, cell_part[nb_index], AttributeSet::copy);
// not need or check if
//exportList.emplace_back(index, cell_part[nb_index], AttributeSet::copy);
if ( recursion_deps>0 )
{
// Add another layer
Expand Down
2 changes: 1 addition & 1 deletion opm/grid/common/ZoltanPartition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void setDefaultZoltanParameters(Zoltan_Struct* zz) {
Zoltan_Set_Param(zz, "CHECK_GRAPH", "2");
Zoltan_Set_Param(zz,"EDGE_WEIGHT_DIM","0");
Zoltan_Set_Param(zz, "OBJ_WEIGHT_DIM", "0");
Zoltan_Set_Param(zz, "PHG_EDGE_SIZE_THRESHOLD", ".35"); /* 0-remove all, 1-remove none */
Zoltan_Set_Param(zz, "PHG_EDGE_SIZE_THRESHOLD", "1"); /* 0-remove all, 1-remove none */
}


Expand Down
4 changes: 2 additions & 2 deletions opm/grid/cpgrid/CpGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ CpGrid::scatterGrid(EdgeWeightMethod method,
// Silence any unused argument warnings that could occur with various configurations.
static_cast<void>(wells);
static_cast<void>(transmissibilities);
static_cast<void>(overlapLayers);
//static_cast<void>(overlapLayers);
static_cast<void>(method);
static_cast<void>(imbalanceTol);

Expand Down Expand Up @@ -373,7 +373,7 @@ CpGrid::scatterGrid(EdgeWeightMethod method,

// first create the overlap
auto noImportedOwner = addOverlapLayer(*this, computedCellPart, exportList, importList, cc, addCornerCells,
transmissibilities);
transmissibilities, overlapLayers);
// importList contains all the indices that will be here.
auto compareImport = [](const std::tuple<int,int,char,int>& t1,
const std::tuple<int,int,char,int>&t2)
Expand Down

0 comments on commit 50cf43d

Please sign in to comment.