43 #ifndef IFPACK2_ZOLTAN2_PARTITIONER_DEF_HPP
44 #define IFPACK2_ZOLTAN2_PARTITIONER_DEF_HPP
46 #if defined(HAVE_IFPACK2_ZOLTAN2)
47 #include "Ifpack2_ConfigDefs.hpp"
48 #include "Ifpack2_Zoltan2Partitioner_decl.hpp"
54 template<
class GraphType>
55 Zoltan2Partitioner<GraphType>::
57 OverlappingPartitioner<GraphType> (graph), zoltan2AlgoName_ (
"phg")
61 template<
class GraphType>
62 Zoltan2Partitioner<GraphType>::~Zoltan2Partitioner() {}
65 template<
class GraphType>
67 Zoltan2Partitioner<GraphType>::
70 zoltan2AlgoName_ = List.
get<std::string>(
"zoltan2: algorithm", zoltan2AlgoName_);
73 template<
class GraphType>
74 void Zoltan2Partitioner<GraphType>::computePartitions()
77 Zoltan2GraphAdapterType zoltan2_graph(this->Graph_);
81 zoltan2_params.
set(
"partitioning_approach",
"partition");
82 zoltan2_params.
set(
"num_local_parts", this->NumLocalParts_);
83 if (zoltan2AlgoName_ ==
"parmetis") {
84 zoltan2_params.
set(
"algorithm",
"parmetis");
85 zoltan2_params.
set(
"symmetrize_input",
"transpose");
86 zoltan2_params.
set(
"partitioning_objective",
"minimize_cut_edge_weight");
88 zoltan2_params.
set(
"algorithm", zoltan2AlgoName_);
92 Zoltan2::PartitioningProblem<Zoltan2GraphAdapterType>
93 problem(&zoltan2_graph, &zoltan2_params, this->Graph_->getComm());
97 auto parts = problem.getSolution().getPartListView();
98 for (
size_t i = 0; i < this->Graph_->getLocalNumRows (); ++i) {
99 this->Partition_[i] = parts[i];
106 #define IFPACK2_ZOLTAN2PARTITIONER_INSTANT(LO,GO,N) \
107 template class Ifpack2::Zoltan2Partitioner<Tpetra::CrsGraph< LO, GO, N > >; \
108 template class Ifpack2::Zoltan2Partitioner<Tpetra::RowGraph< LO, GO, N > >;
110 #endif // HAVE_IFPACK2_ZOLTAN2
111 #endif // IFPACK2_ZOLTAN2PARTITIONER_DEF_HPP
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)