DOLFINx 0.10.0.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
partitioners.h
1// Copyright (C) 2020-2023 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#include <array>
11
12namespace dolfinx::graph
13{
14
26template <typename T>
27graph::AdjacencyList<int> compute_destination_ranks(
28 MPI_Comm comm, const graph::AdjacencyList<std::int64_t>& graph,
29 const std::vector<T>& node_disp, const std::vector<T>& part);
30
31namespace scotch
32{
33#ifdef HAS_PTSCOTCH
37enum class strategy : std::uint8_t
38{
40 none,
41 balance,
42 quality,
43 safety,
44 speed,
45 scalability
46};
47
55graph::partition_fn partitioner(scotch::strategy strategy = strategy::none,
56 double imbalance = 0.025, int seed = 0);
57#endif
58
59} // namespace scotch
60
61namespace parmetis
62{
63#ifdef HAS_PARMETIS
75graph::partition_fn partitioner(double imbalance = 1.02,
76 std::array<int, 3> options = {1, 0, 5});
77
78#endif
79} // namespace parmetis
80
82namespace kahip
83{
84#ifdef HAS_KAHIP
94graph::partition_fn partitioner(int mode = 1, int seed = 1,
95 double imbalance = 0.03,
96 bool suppress_output = true);
97#endif
98} // namespace kahip
99
100} // namespace dolfinx::graph
Interfaces to KaHIP parallel partitioner.
Definition partitioners.h:83
Graph data structures and algorithms.
Definition AdjacencyList.h:20
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:31
graph::AdjacencyList< int > compute_destination_ranks(MPI_Comm comm, const graph::AdjacencyList< std::int64_t > &graph, const std::vector< T > &node_disp, const std::vector< T > &part)
Definition partitioners.cpp:39