From: vishalkenchan Date: Wed, 10 Jan 2018 10:42:45 +0000 (+0100) Subject: suppress PHG warning saying: PHG_EDGE_SIZE_THRESHOLD is low X-Git-Tag: v9.0.0-rc1~587^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2972eae04cdab1bbc7ab19cb502a5589d1a9016;p=dealii.git suppress PHG warning saying: PHG_EDGE_SIZE_THRESHOLD is low --- diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index 5bf24eb8a2..ffadb21f64 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -245,6 +245,21 @@ namespace SparsityTools zz->Set_Param( "LB_METHOD", "GRAPH" ); //graph based partition method (LB-load balancing) zz->Set_Param( "NUM_LOCAL_PARTS", std::to_string(n_partitions) ); //set number of partitions + // The PHG partitioner is a hypergraph partitioner that Zoltan could use + // for graph partitioning. + // If number of vertices in hyperedge divided by total vertices in + // hypergraph exceeds PHG_EDGE_SIZE_THRESHOLD, + // then the hyperedge will be omitted as such (dense) edges will likely + // incur high communication costs regardless of the partition. + // PHG_EDGE_SIZE_THRESHOLD value is raised to 0.5 from the default + // value of 0.25 so that the PHG partitioner doesn't throw warning saying + // "PHG_EDGE_SIZE_THRESHOLD is low ..." after removing all dense edges. + // For instance, in two dimensions if the triangulation being partitioned + // is two quadrilaterals sharing an edge and if PHG_EDGE_SIZE_THRESHOLD + // value is set to 0.25, PHG will remove all the edges throwing the + // above warning. + zz->Set_Param( "PHG_EDGE_SIZE_THRESHOLD", "0.5" ); + //Need a non-const object equal to sparsity_pattern SparsityPattern graph; graph.copy_from(sparsity_pattern); diff --git a/tests/zoltan/tria_zoltan_01.cc b/tests/zoltan/tria_zoltan_01.cc new file mode 100644 index 0000000000..ece6ffd777 --- /dev/null +++ b/tests/zoltan/tria_zoltan_01.cc @@ -0,0 +1,70 @@ + +#include "../tests.h" + +#include +#include +#include + +#include + +using namespace dealii; + +// Test to check whether Zoltan PHG throws warning because +// PHG_EDGE_SIZE_THRESHOLD value is low. + +template +void test (const MPI_Comm &mpi_communicator) +{ + parallel::shared::Triangulation + triangulation (mpi_communicator, + Triangulation::limit_level_difference_at_vertices); + + GridGenerator::subdivided_hyper_cube (triangulation, 2, 0, 1); + + // Some dummy output. + if (Utilities::MPI::this_mpi_process(mpi_communicator)==0) + std::cout << "Number of vertices: " + << triangulation.n_vertices() + << std::endl; +} + +int main (int argc, char *argv[]) +{ + try + { + dealii::Utilities::MPI::MPI_InitFinalize + mpi_initialization (argc, + argv, + dealii::numbers::invalid_unsigned_int); + + test<1>(MPI_COMM_WORLD); + test<2>(MPI_COMM_WORLD); + test<3>(MPI_COMM_WORLD); + + } + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + throw; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + throw; + } + + return 0; +} diff --git a/tests/zoltan/tria_zoltan_01.mpirun=2.output b/tests/zoltan/tria_zoltan_01.mpirun=2.output new file mode 100644 index 0000000000..744ee60e56 --- /dev/null +++ b/tests/zoltan/tria_zoltan_01.mpirun=2.output @@ -0,0 +1,3 @@ +Number of vertices: 3 +Number of vertices: 9 +Number of vertices: 27 diff --git a/tests/zoltan/tria_zoltan_01.output b/tests/zoltan/tria_zoltan_01.output new file mode 100644 index 0000000000..744ee60e56 --- /dev/null +++ b/tests/zoltan/tria_zoltan_01.output @@ -0,0 +1,3 @@ +Number of vertices: 3 +Number of vertices: 9 +Number of vertices: 27