Loading...
Searching...
No Matches
partitioners.h
// Copyright (C) 2020-2023 Garth N. Wells and Igor A. Baratta
//
// This file is part of DOLFINx (https://www.fenicsproject.org)
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once
#include "partition.h"
#include <array>
namespace dolfinx::graph
{
template <typename T>
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);
namespace scotch
{
#ifdef HAS_PTSCOTCH
enum class strategy : std::uint8_t
{
none,
balance,
quality,
safety,
speed,
scalability
};
graph::partition_fn partitioner(scotch::strategy strategy = strategy::none,
double imbalance = 0.025, int seed = 0);
#endif
} // namespace scotch
namespace parmetis
{
#ifdef HAS_PARMETIS
graph::partition_fn partitioner(double imbalance = 1.02,
std::array<int, 3> options = {1, 0, 5});
#endif
} // namespace parmetis
namespace kahip
{
#ifdef HAS_KAHIP
graph::partition_fn partitioner(int mode = 1, int seed = 1,
double imbalance = 0.03,
bool suppress_output = true);
#endif
} // namespace kahip
} // namespace dolfinx::graph
dolfinx::graph::kahip
Interfaces to KaHIP parallel partitioner.
Definition partitioners.h:83
dolfinx::graph
Graph data structures and algorithms.
Definition AdjacencyList.h:20
dolfinx::graph::partition_fn
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
dolfinx::graph::compute_destination_ranks
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