49 #include "Zoltan2_config.h"
50 #include "Tpetra_CrsGraph.hpp"
51 #include "Teuchos_ArrayView.hpp"
57 using Teuchos::ArrayView;
59 template <
typename lno_t,
typename gno_t>
61 std::ostream &os,
size_t maxSize,
string info)
63 size_t nrows = graph.getNodeNumRows();
67 const RCP<const typename Tpetra::Map<lno_t, gno_t> > &rowMap=
69 const RCP<const typename Tpetra::Map<lno_t, gno_t> > &colMap=
73 os << info << std::endl;
75 if (graph.isGloballyIndexed()){
76 ArrayView<const gno_t> indices;
77 for (
size_t i=0; i < nrows; i++){
78 gno_t gid = rowMap->getGlobalElement(i);
79 graph.getGlobalRowView(gid, indices);
80 os <<
"Row " << gid <<
": ";
81 for (
typename ArrayView<const gno_t>::size_type j=0; j < indices.size(); j++){
82 os << indices[j] <<
" ";
88 ArrayView<const lno_t> indices;
89 for (
size_t i=0; i < nrows; i++){
90 gno_t gid = rowMap->getGlobalElement(i);
91 graph.getLocalRowView(i, indices);
92 os <<
"Row " << gid <<
": ";
93 for (
typename ArrayView<const lno_t>::size_type j=0; j < indices.size(); j++){
94 os << colMap->getGlobalElement(indices[j]) <<
" ";
101 template <
typename lno_t,
typename gno_t>
103 const Tpetra::CrsGraph<lno_t, gno_t> &graph, std::ostream &os,
104 size_t maxSize,
string info)
106 int rank = comm->getRank();
107 std::ostringstream oss;
108 oss <<
"rank " << rank;
112 os << info << std::endl;
115 for (
int p=0; p < comm->getSize(); p++){
117 printTpetraGraph<lno_t, gno_t>(graph, os, maxSize, oss.str());
void printTpetraGraph(const Tpetra::CrsGraph< lno_t, gno_t > &graph, std::ostream &os, size_t maxSize, string info)