39 Teuchos::ParameterList &coloring_params,
58 this->matrix->setAllToScalar(1.0);
60 if (!this->matrix->isFillComplete())
61 this->matrix->fillComplete();
63 const size_t nzpr = this->matrix->getGlobalMaxNumRowEntries();
64 matrix_t C(this->matrix->getRowMap(), nzpr * nzpr);
66 Tpetra::MatrixMatrix::Multiply(*(this->matrix),
true,
67 *(this->matrix),
false, C);
71 Z2Adapter_t z2_adapter(rcp(&C,
false));
73 Teuchos::ParameterList z2_params = coloring_params.sublist(
"Zoltan2");
79 z2_problem.getSolution();
82 Teuchos::ArrayRCP<int> local_list_of_colors = z2_solution->getColorsRCP();
83 const size_t len = local_list_of_colors.size();
85 TEUCHOS_TEST_FOR_EXCEPTION(
86 len != this->graph->getColMap()->getLocalNumElements(), std::logic_error,
87 "Incorrect length of color list!");
90 local_list_of_colors.getRawPtr(), len);
93 list_of_colors_host = Kokkos::create_mirror_view(list_of_colors);
95 Kokkos::deep_copy(list_of_colors_host, list_of_colors_tmp);
96 Kokkos::deep_copy(list_of_colors, list_of_colors_host);
99 Teuchos::RCP<const Teuchos::Comm<int>> comm =
100 this->graph->getRowMap()->getComm();
101 Teuchos::reduceAll(*comm, Teuchos::REDUCE_MAX, 1,
102 &local_num_colors, &num_colors);