13 #include "Zoltan2_config.h"
14 #include "Tpetra_CrsGraph.hpp"
15 #include "Teuchos_ArrayView.hpp"
21 using Teuchos::ArrayView;
23 template <
typename lno_t,
typename gno_t>
25 std::ostream &os,
size_t maxSize,
string info)
27 size_t nrows = graph.getLocalNumRows();
31 const RCP<const typename Tpetra::Map<lno_t, gno_t> > &rowMap=
33 const RCP<const typename Tpetra::Map<lno_t, gno_t> > &colMap=
37 os << info << std::endl;
39 if (graph.isGloballyIndexed()){
40 ArrayView<const gno_t> indices;
41 for (
size_t i=0; i < nrows; i++){
42 gno_t gid = rowMap->getGlobalElement(i);
43 graph.getGlobalRowView(gid, indices);
44 os <<
"Row " << gid <<
": ";
45 for (
typename ArrayView<const gno_t>::size_type j=0; j < indices.size(); j++){
46 os << indices[j] <<
" ";
52 ArrayView<const lno_t> indices;
53 for (
size_t i=0; i < nrows; i++){
54 gno_t gid = rowMap->getGlobalElement(i);
55 graph.getLocalRowView(i, indices);
56 os <<
"Row " << gid <<
": ";
57 for (
typename ArrayView<const lno_t>::size_type j=0; j < indices.size(); j++){
58 os << colMap->getGlobalElement(indices[j]) <<
" ";
65 template <
typename lno_t,
typename gno_t>
67 const Tpetra::CrsGraph<lno_t, gno_t> &graph, std::ostream &os,
68 size_t maxSize,
string info)
70 int rank = comm->getRank();
71 std::ostringstream oss;
72 oss <<
"rank " << rank;
76 os << info << std::endl;
79 for (
int p=0; p < comm->getSize(); p++){
81 printTpetraGraph<lno_t, gno_t>(graph, os, maxSize, oss.str());
map_t::global_ordinal_type gno_t
void printTpetraGraph(const Tpetra::CrsGraph< lno_t, gno_t > &graph, std::ostream &os, size_t maxSize, string info)