Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/dd/d07/partitioners_8h_source.html
DOLFINx  0.5.1
DOLFINx C++ interface
partitioners.h
1 // Copyright (C) 2020 Garth N. Wells and Igor A. Baratta
2 //
3 // This file is part of DOLFINx (https://www.fenicsproject.org)
4 //
5 // SPDX-License-Identifier: LGPL-3.0-or-later
6 
7 #pragma once
8 
9 #include "partition.h"
10 
11 namespace dolfinx::graph
12 {
13 
14 namespace scotch
15 {
16 #ifdef HAS_PTSCOTCH
17 
21 enum class strategy
22 {
24  none,
25  balance,
26  quality,
27  safety,
28  speed,
29  scalability
30 };
31 
39 graph::partition_fn partitioner(scotch::strategy strategy = strategy::none,
40  double imbalance = 0.025, int seed = 0);
41 
42 #endif
43 
44 } // namespace scotch
45 
46 namespace parmetis
47 {
48 #ifdef HAS_PARMETIS
49 
56 graph::partition_fn partitioner(double imbalance = 1.02,
57  std::array<int, 3> options = {1, 0, 5});
58 
59 #endif
60 } // namespace parmetis
61 
63 namespace kahip
64 {
65 #ifdef HAS_KAHIP
75 graph::partition_fn partitioner(int mode = 1, int seed = 1,
76  double imbalance = 0.03,
77  bool suppress_output = true);
78 
79 #endif
80 } // namespace kahip
81 
82 } // namespace dolfinx::graph
graph::partition_fn partitioner(int mode=1, int seed=1, double imbalance=0.03, bool suppress_output=true)
Create a graph partitioning function that uses KaHIP.
Definition: partitioners.cpp:602
Graph data structures and algorithms.
Definition: dofmapbuilder.h:25
std::function< graph::AdjacencyList< std::int32_t >(MPI_Comm, int, const AdjacencyList< std::int64_t > &, bool)> partition_fn
Signature of functions for computing the parallel partitioning of a distributed graph.
Definition: partition.h:34