49 #include <Zoltan2_config.h> 50 #include <Tpetra_CrsGraph.hpp> 58 template <
typename lno_t,
typename gno_t>
60 ostream &os,
size_t maxSize,
string info)
62 size_t nrows = graph.getNodeNumRows();
66 const RCP<const typename Tpetra::Map<lno_t, gno_t> > &rowMap=
68 const RCP<const typename Tpetra::Map<lno_t, gno_t> > &colMap=
74 if (graph.isGloballyIndexed()){
75 ArrayView<const gno_t> indices;
76 for (
size_t i=0; i < nrows; i++){
77 gno_t gid = rowMap->getGlobalElement(i);
78 graph.getGlobalRowView(gid, indices);
79 os <<
"Row " << gid <<
": ";
80 for (
gno_t j=0; j < indices.size(); j++){
81 os << indices[j] <<
" ";
87 ArrayView<const lno_t> indices;
88 for (
size_t i=0; i < nrows; i++){
89 gno_t gid = rowMap->getGlobalElement(i);
90 graph.getLocalRowView(i, indices);
91 os <<
"Row " << gid <<
": ";
92 for (
lno_t j=0; j < indices.size(); j++){
93 os << colMap->getGlobalElement(indices[j]) <<
" ";
100 template <
typename lno_t,
typename gno_t>
102 const Tpetra::CrsGraph<lno_t, gno_t> &graph, ostream &os,
103 size_t maxSize,
string info)
105 int rank = comm->getRank();
106 std::ostringstream oss;
107 oss <<
"rank " << rank;
114 for (
int p=0; p < comm->getSize(); p++){
116 printTpetraGraph<lno_t, gno_t>(graph, os, maxSize, oss.str());
void printTpetraGraph(const Tpetra::CrsGraph< lno_t, gno_t > &graph, ostream &os, size_t maxSize, string info)