10#if defined(FEAT_HAVE_PARMETIS) || defined(DOXYGEN) 
   11#include <kernel/util/dist.hpp> 
   12#include <kernel/adjacency/graph.hpp> 
   13#include <kernel/adjacency/coloring.hpp> 
   14#include <kernel/geometry/conformal_mesh.hpp> 
   98      template<
int nf_, 
int nv_, 
typename VertexSet_>
 
  100        const VertexSet_& vertices, 
const Index num_parts, 
const std::vector<Real>& weights)
 
  139      template<
int nv_, 
typename VertexSet_>
 
  142        typename VertexSet_::VertexType vx;
 
  144        static constexpr int nc = VertexSet_::num_coords;
 
  150            vx += vertices[verts_at_elem(i,j)];
 
  151          for(
int k(0); k < nc; ++k)
 
Coloring object implementation.
Graph create_partition_graph() const
Creates a color partition graph.
Adjacency Graph implementation.
int size() const
Returns the size of this communicator.
Conformal Index-Set class template.
static constexpr int num_indices
number of indices per entry
ParMETIS mesh/graph partitioner backend.
void _compute_midpoints(const IndexSet< nv_ > &verts_at_elem, const VertexSet_ &vertices)
auxiliary function: compute element midpoints from vertex coordinates
int get_sub_comm_size() const
Returns the size of the internal sub-communicator.
Dist::Comm _sub_comm
a sub-communicator for the partitioner
Index _num_elems
the total number of elements
std::vector< Index > _parts
element partitioning
Adjacency::Graph _subgraph
the adjacency sub-graph for this process
bool _broadcast_coloring(bool metis_ok)
auxiliary function: broadcasts the coloring from the root process
Index _first_elem
first element for this process
bool _execute()
auxiliary function: executes the partitioner
Adjacency::Coloring _coloring
the element coloring
bool execute(const IndexSet< nf_ > &faces_at_elem, const IndexSet< nv_ > &verts_at_elem, const VertexSet_ &vertices, const Index num_parts, const std::vector< Real > &weights)
Executes the ParMETIS graph partitioner.
std::vector< Real > _weights
elements weights; empty if not weighted
Index _num_local_elems
number of elements for this process
bool _gather_coloring()
auxiliary function: gathers the partitioned coloring onto the root process
void _create_subgraph(const Adjacency::Graph &faces_at_elem, const Index num_parts)
auxiliary function: builds a hypergraph from the adjacency graph
Index _min_elems
minimum number of elements per MPI process
int _max_procs
maximum number of MPI processes to use
Index _num_parts
the desired number of partitions
const Dist::Comm & _comm
our main communicator
Adjacency::Graph build_elems_at_rank() const
Builds and returns the elements-at-rank graph representing the partitioning.
std::vector< Real > _midpoints
element midpoints
PartiParMETIS(const Dist::Comm &comm, Index min_elems=1000u, int max_procs=1000)
Constructor.
virtual ~PartiParMETIS()
virtual destructor
bool _apply_parmetis()
auxiliary function: applies the actual ParMETIS call
@ as_is
Render-As-Is mode.
double Real
Real data type.
std::uint64_t Index
Index data type.