Skip to content

Commit

Permalink
Merge pull request #28355 from GiudGiud/PR_parm
Browse files Browse the repository at this point in the history
Fix message for automatic switch from parMETIS to PTscotch
  • Loading branch information
GiudGiud authored Aug 13, 2024
2 parents 63a4daa + a115244 commit ced5120
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
6 changes: 3 additions & 3 deletions framework/src/partitioner/PetscExternalPartitioner.C
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ PetscExternalPartitioner::partition(MeshBase & mesh, const unsigned int n_parts)
{
// We want to use a parallel partitioner that requires a distributed graph
// Simply calling a linear partitioner provides us the distributed graph
// We shold not do anything when using a distributed mesh since the mesh itself
// We should not do anything when using a distributed mesh since the mesh itself
// is already distributed
// When n_parts=1, we do not need to run any partitioner, instead, let libmesh
// handle this
Expand All @@ -96,8 +96,8 @@ PetscExternalPartitioner::partition(MeshBase & mesh, const unsigned int n_parts)
if ((mesh.n_elem() / n_parts < 28) && _part_package == "parmetis")
{
Moose::out
<< "Number of elements per compute node must be less than 28, otherwise we switch to "
"PTScotch"
<< "Average number of elements per partition (" << mesh.n_elem() / n_parts
<< ") is less than 28. We are switching from ParMETIS to PTScotch for the partitioning."
<< std::endl;
_part_package = "ptscotch";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
time,max_elems,min_elems,sum_sides
2,103,99,86
2,201,199,130
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
time,max_elems,min_elems,sum_sides
2,152,146,86
2,303,297,114
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
time,max_elems,min_elems,sum_sides
2,154,148,88
2,300,300,110
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
time,max_elems,min_elems,sum_sides
2,102,99,88
2,202,199,124
28 changes: 24 additions & 4 deletions test/tests/partitioners/petsc_partitioner/tests
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@
type = 'CSVDiff'
input = 'petsc_partitioner.i'
csvdiff = 'petsc_partitioner_parmetis_out.csv'
cli_args = 'Mesh/Partitioner/part_package=parmetis Outputs/file_base=petsc_partitioner_parmetis_out Outputs/exodus=false'
# Make the mesh big enough to use parmetis (ptscotch is used for <28 elems per processor)
cli_args = "Mesh/nx=20
Mesh/Partitioner/part_package=parmetis
Outputs/file_base=petsc_partitioner_parmetis_out
Outputs/exodus=false"
# Want to insure the partitioned mesh can be used by solver
expect_out = 'Solve Converged!'
parmetis = true
Expand All @@ -97,7 +101,12 @@
type = 'CSVDiff'
input = 'petsc_partitioner.i'
csvdiff = 'petsc_partitioner_parmetis_weight_element_out.csv'
cli_args = 'Mesh/Partitioner/part_package=parmetis Mesh/Partitioner/type=PartitionerWeightTest Outputs/file_base=petsc_partitioner_parmetis_weight_element_out Mesh/Partitioner/apply_element_weight=true Outputs/exodus=false'
cli_args = "Mesh/nx=20
Mesh/Partitioner/part_package=parmetis
Mesh/Partitioner/type=PartitionerWeightTest
Mesh/Partitioner/apply_element_weight=true
Outputs/file_base=petsc_partitioner_parmetis_weight_element_out
Outputs/exodus=false"
parmetis = true
# Want to insure the partitioned mesh can be used by solver
expect_out = 'Solve Converged!'
Expand All @@ -113,7 +122,12 @@
type = 'CSVDiff'
input = 'petsc_partitioner.i'
csvdiff = 'petsc_partitioner_parmetis_weight_side_out.csv'
cli_args = 'Mesh/Partitioner/part_package=parmetis Mesh/Partitioner/type=PartitionerWeightTest Outputs/file_base=petsc_partitioner_parmetis_weight_side_out Mesh/Partitioner/apply_side_weight=true Outputs/exodus=false'
cli_args = "Mesh/nx=20
Mesh/Partitioner/part_package=parmetis
Mesh/Partitioner/type=PartitionerWeightTest
Mesh/Partitioner/apply_side_weight=true
Outputs/file_base=petsc_partitioner_parmetis_weight_side_out
Outputs/exodus=false"
parmetis = true
# Want to insure the partitioned mesh can be used by solver
expect_out = 'Solve Converged!'
Expand All @@ -129,7 +143,13 @@
type = 'CSVDiff'
input = 'petsc_partitioner.i'
csvdiff = 'petsc_partitioner_parmetis_weight_both_out.csv'
cli_args = 'Mesh/Partitioner/part_package=parmetis Mesh/Partitioner/type=PartitionerWeightTest Outputs/file_base=petsc_partitioner_parmetis_weight_both_out Mesh/Partitioner/apply_side_weight=true Mesh/Partitioner/apply_element_weight=true Outputs/exodus=false'
cli_args = "Mesh/nx=20
Mesh/Partitioner/part_package=parmetis
Mesh/Partitioner/type=PartitionerWeightTest
Mesh/Partitioner/apply_element_weight=true
Mesh/Partitioner/apply_side_weight=true
Outputs/file_base=petsc_partitioner_parmetis_weight_both_out
Outputs/exodus=false"
parmetis = true
# Want to insure the partitioned mesh can be used by solver
expect_out = 'Solve Converged!'
Expand Down

0 comments on commit ced5120

Please sign in to comment.