28#ifdef DEAL_II_WITH_MPI
36#ifdef DEAL_II_WITH_METIS
43#ifdef DEAL_II_TRILINOS_WITH_ZOLTAN
44# include <zoltan_cpp.h>
64#ifndef DEAL_II_WITH_METIS
65 (void)sparsity_pattern;
76 idx_t n =
static_cast<signed int>(sparsity_pattern.
n_rows());
104 col < sparsity_pattern.
end(row);
118 sparsity_pattern.
n_rows()));
181#ifdef DEAL_II_TRILINOS_WITH_ZOLTAN
211 auto n_dofs = graph->
n_rows();
213 for (
unsigned int i = 0; i < n_dofs; ++i)
237 for (
int i = 0; i <
num_obj; ++i)
278 if (i != col->column())
299#ifndef DEAL_II_TRILINOS_WITH_ZOLTAN
300 (void)sparsity_pattern;
310 "The cell weighting functionality for Zoltan has not yet been implemented."));
318 zz->Set_Param(
"DEBUG_LEVEL",
"0");
322 zz->Set_Param(
"NUM_LOCAL_PARTS",
338 zz->Set_Param(
"PHG_EDGE_SIZE_THRESHOLD",
"0.5");
430 sparsity_pattern.
n_rows()));
440 partition_metis(sparsity_pattern,
445 partition_zoltan(sparsity_pattern,
460#ifndef DEAL_II_TRILINOS_WITH_ZOLTAN
461 (void)sparsity_pattern;
471 zz->Set_Param(
"DEBUG_LEVEL",
"0");
472 zz->Set_Param(
"COLORING_PROBLEM",
"DISTANCE-1");
473 zz->Set_Param(
"NUM_GID_ENTRIES",
"1");
474 zz->Set_Param(
"NUM_LID_ENTRIES",
"1");
475 zz->Set_Param(
"OBJ_WEIGHT_DIM",
"0");
476 zz->Set_Param(
"RECOLORING_NUM_OF_ITERATIONS",
"0");
517 unsigned int n_colors =
534 const std::vector<DynamicSparsityPattern::size_type> &
new_indices)
581 std::vector<DynamicSparsityPattern::size_type> &
new_indices,
590 "You can't specify more starting indices than there are rows"));
594 "Only valid for sparsity patterns which store all rows."));
599 ExcMessage(
"Invalid starting index: All starting indices need "
600 "to be between zero and the number of rows in the "
601 "sparsity pattern."));
636 j < sparsity.
end(dof);
644 std::vector<DynamicSparsityPattern::size_type>::iterator
end_sorted;
672 ExcMessage(
"The input graph appears to have more than one "
673 "component, but as stated in the documentation "
674 "we only want to reorder such graphs if no "
675 "starting indices are given. The function was "
676 "called with starting indices, however."))
687 std::multimap<DynamicSparsityPattern::size_type, int>
697 const std::pair<const DynamicSparsityPattern::size_type, int>
703 std::multimap<DynamicSparsityPattern::size_type, int>::iterator i;
729 std::vector<DynamicSparsityPattern::size_type> &
renumbering)
736 "Only valid for sparsity patterns which store all rows."));
742 std::vector<std::vector<types::global_dof_index>>
groups;
768 std::pair<types::global_dof_index, types::global_dof_index>
841 connectivity.
begin(index);
842 it != connectivity.
end(index);
901 std::vector<DynamicSparsityPattern::size_type> &
renumbering)
912#ifdef DEAL_II_WITH_MPI
921 std::map<unsigned int, std::vector<DynamicSparsityPattern::size_type>>;
955 for (
const auto &row : data.second)
957 const auto rlen =
dsp.row_length(row);
964 send_data[data.first].push_back(row);
965 send_data[data.first].push_back(
rlen);
967 send_data[data.first].push_back(
968 dsp.column_number(row, c));
984 const auto row = *(ptr++);
1009 const std::vector<DynamicSparsityPattern::size_type> &
rows_per_cpu,
1014 std::vector<DynamicSparsityPattern::size_type>
start_index(
1043 std::map<unsigned int, std::vector<DynamicSparsityPattern::size_type>>;
1054 const auto rlen =
dsp.row_length(row);
1066 const auto column =
dsp.column_number(row, c);
1076 const auto &
recv_buf = data.second;
1081 const auto row = *(ptr++);
1118 std::vector<BlockDynamicSparsityPattern::size_type>>;
1143 std::vector<BlockDynamicSparsityPattern::size_type> &dst =
1146 dst.push_back(
rlen);
1152 dsp.column_number(row, c);
1153 dst.push_back(column);
1159 std::vector<unsigned int>
send_to;
1169 std::vector<MPI_Request> requests(send_data.
size());
1181 unsigned int idx = 0;
1197 std::vector<BlockDynamicSparsityPattern::size_type>
recv_buf;
1198 for (
unsigned int index = 0; index <
num_receive; ++index)
1218 std::vector<BlockDynamicSparsityPattern::size_type>::const_iterator
1220 std::vector<BlockDynamicSparsityPattern::size_type>::const_iterator
1227 for (
unsigned int c = 0; c <
num; ++c)
1239 if (requests.size() > 0)
value_type * data() const noexcept
const IndexSet & row_index_set() const
size_type row_length(const size_type row) const
types::global_dof_index size_type
bool is_compressed() const
std::size_t n_nonzero_elements() const
bool exists(const size_type i, const size_type j) const
void copy_from(const size_type n_rows, const size_type n_cols, const ForwardIterator begin, const ForwardIterator end)
unsigned int row_length(const size_type row) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcMETISNotInstalled()
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
static ::ExceptionBase & ExcMETISError(int arg1)
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
static ::ExceptionBase & ExcInvalidArraySize(int arg1, int arg2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotQuadratic()
static ::ExceptionBase & ExcZOLTANNotInstalled()
static ::ExceptionBase & ExcNotCompressed()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
std::map< unsigned int, T > some_to_some(const MPI_Comm comm, const std::map< unsigned int, T > &objects_to_send)
std::vector< unsigned int > compute_index_owner(const IndexSet &owned_indices, const IndexSet &indices_to_look_up, const MPI_Comm comm)
unsigned int this_mpi_process(const MPI_Comm mpi_communicator)
unsigned int compute_n_point_to_point_communications(const MPI_Comm mpi_comm, const std::vector< unsigned int > &destinations)
std::vector< Integer > invert_permutation(const std::vector< Integer > &permutation)
const types::global_dof_index invalid_dof_index
const types::global_dof_index invalid_size_type
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
#define DEAL_II_DOF_INDEX_MPI_TYPE