From c9b34a2f68fc675d0c7e4f350438e44467867961 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Fri, 13 Dec 2024 14:42:22 +0100 Subject: [PATCH 1/2] Switch default load balancer to Zoltan with vertex = all cells of a well The new loadbalancer approach will create a graph representing the grid where all cells that a well perforates are represented by one vertex. The weight of that cell will be the number of cells it represents. Also the weights of the faces will be added up due to the merging of cells. A cell that is not perforated by any well is still represented by one vertex with weight one. In the old default appoach the number of vertices in the grid was equal to the number of cells. Vertex weights were not used. For each well we added an edge between all its perforated cells for which we did set a very edge weight to force the cells to the same process during partitioning. For realistic cases we have seen improvements across the board due to this. E.g. this resolved convergence issues on hard cases. Because of that this becomes the default with this. --- opm/simulators/flow/FlowGenericVanguard.cpp | 2 +- opm/simulators/flow/FlowGenericVanguard.hpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/opm/simulators/flow/FlowGenericVanguard.cpp b/opm/simulators/flow/FlowGenericVanguard.cpp index c9ced125299..2885b2c666e 100644 --- a/opm/simulators/flow/FlowGenericVanguard.cpp +++ b/opm/simulators/flow/FlowGenericVanguard.cpp @@ -425,7 +425,7 @@ void FlowGenericVanguard::registerParameters_() ("Order cells owned by rank before ghost/overlap cells."); #if HAVE_MPI Parameters::Register - ("Choose partitioning strategy: 0=simple, 1=Zoltan, 2=METIS."); + ("Choose partitioning strategy: 0=simple, 1=Zoltan, 2=METIS, 3=Zoltan with all cells of well represented by one vertex."); Parameters::Register ("Perform partitioning for parallel runs on a single process."); Parameters::Register> diff --git a/opm/simulators/flow/FlowGenericVanguard.hpp b/opm/simulators/flow/FlowGenericVanguard.hpp index 8e4935f80e4..8bca1e02e5a 100644 --- a/opm/simulators/flow/FlowGenericVanguard.hpp +++ b/opm/simulators/flow/FlowGenericVanguard.hpp @@ -71,8 +71,9 @@ struct OwnerCellsFirst { static constexpr bool value = true; }; struct ParsingStrictness { static constexpr auto value = "normal"; }; struct ActionParsingStrictness { static constexpr auto value = "normal"; }; - // 0: simple, 1: Zoltan, 2: METIS, see GridEnums.hpp -struct PartitionMethod { static constexpr int value = 1; }; +/// 0: simple, 1: Zoltan, 2: METIS, 3: Zoltan with a all cells of a well +/// represented by one vertex in the graph, see GridEnums.hpp +struct PartitionMethod { static constexpr int value = 3; }; struct SchedRestart{ static constexpr bool value = false; }; struct SerialPartitioning{ static constexpr bool value = false; }; From 317a54c8d63a713e73e03cb4ed0e85a32e73d46e Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 17 Dec 2024 15:28:44 +0100 Subject: [PATCH 2/2] Relaxed tolerances for parallel test of 3_A_MPI_MULTFLT_SCHED_MOD2 This seems to be needed for the new partitioning with cells of a well merged to one vertex. --- parallelTests.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parallelTests.cmake b/parallelTests.cmake index 422666957b8..0c85acc7195 100644 --- a/parallelTests.cmake +++ b/parallelTests.cmake @@ -233,8 +233,8 @@ add_test_compare_parallel_simulation(CASENAME 3_a_mpi_multflt_mod2 SIMULATOR flow ABS_TOL ${abs_tol_parallel} REL_TOL 1.0e-3 - DIR model2 - TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --newton-max-iterations=30 --enable-drift-compensation=false) + DIR model2 + TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=1.0e-3 --tolerance-mb=1e-8 --tolerance-mb-relaxed=1.0e-8 --newton-max-iterations=30) add_test_compare_parallel_simulation(CASENAME rxft FILENAME TEST_RXFT