FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
parti_scotch.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
9
10#if defined(FEAT_HAVE_SCOTCH) || defined(DOXYGEN)
11
12#include <kernel/adjacency/coloring.hpp>
13#include <kernel/adjacency/graph.hpp>
14#include <kernel/geometry/index_set.hpp>
15#include <kernel/util/dist.hpp>
16
17namespace FEAT::Geometry
18{
20 {
23
26
29
32
35
38
41
44
47
49 std::vector<Index> _parts;
50
53
54
55 public:
56 explicit PartiScotch(const Dist::Comm& comm, Index min_elems = 1000U, int max_work_procs = 1000) :
57 _comm(comm),
58 _work_comm(Dist::Comm::null()),
59 _min_elems(min_elems),
60 _max_work_procs(max_work_procs)
61 {
62 XASSERT(max_work_procs >= 0);
63 XASSERT(min_elems > 0U);
64 }
65
66 template<int nf_>
67 bool execute(
68 const IndexSet<nf_>& faces_at_elem,
69 Index num_parts,
70 const std::vector<Real>& weights)
71 {
73 _create_subgraph(graph, num_parts);
74 return _execute(weights);
75 }
76
77 Adjacency::Graph build_elems_at_rank() const
78 {
80 }
81
82 protected:
83 void _create_subgraph(const Adjacency::Graph& faces_at_elem, Index num_parts);
84 bool _execute(const std::vector<Real>& weights);
85 bool _gather_coloring();
86 bool _broadcast_coloring(bool ok);
87 }; // class PartiScotch
88} // namespace FEAT::Geometry
89
90#endif
#define XASSERT(expr)
Assertion macro definition.
Definition: assertion.hpp:262
FEAT Kernel base header.
Coloring object implementation.
Definition: coloring.hpp:30
Graph create_partition_graph() const
Creates a color partition graph.
Definition: coloring.cpp:292
Adjacency Graph implementation.
Definition: graph.hpp:34
Communicator class.
Definition: dist.hpp:1657
Conformal Index-Set class template.
Definition: index_set.hpp:82
Index _min_elems
Mininum number of elements on each rank.
Index _local_num_elements
Local number of elements.
Dist::Comm _work_comm
Communicator for performing partitioning.
Adjacency::Coloring _coloring
Elements-at-rank coloring.
Adjacency::Graph _subgraph
Subgraph for this rank.
Index _first_elem
First element of this process.
int _max_work_procs
Maximum number of ranks to use for partitioning
Index _global_num_elements
Global number of elements.
std::vector< Index > _parts
Element partitioning.
Index _num_parts
Desired number of partitions.
const Dist::Comm & _comm
Main communicator.
@ as_is
Render-As-Is mode.
Geometry namespace.
std::uint64_t Index
Index data type.