Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
readMatrixFromBinaryFile.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Zoltan2: A package of combinatorial algorithms for scientific computing
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Seher Acer (sacer@sandia.gov)
39 // Erik Boman (egboman@sandia.gov)
40 // Siva Rajamanickam (srajama@sandia.gov)
41 // ***********************************************************************
42 //
43 // @HEADER
44 
45 #ifndef __READMATRIXFROMBINARYFILE_HPP
46 #define __READMATRIXFROMBINARYFILE_HPP
47 
49 // These utilities read a sparse matrix from a binary file that was
50 // created with the corresponding "largestComponent2Binary.cpp" code.
51 // Specific structure may be assumed.
52 // Note: This is research code. We do not guarantee it works in all cases.
54 #include <climits>
55 #include "Tpetra_Details_makeColMap.hpp"
56 
57 template <typename global_ordinal_type, typename local_ordinal_type, typename scalar_type, typename map_type>
58 void
59 distribute (Teuchos::ArrayRCP<size_t>& myNumEntriesPerRow,
60  Teuchos::ArrayRCP<size_t>& myRowPtr,
61  Teuchos::ArrayRCP<global_ordinal_type>& myColInd,
62  Teuchos::ArrayRCP<scalar_type>& myValues,
63  const Teuchos::RCP<const map_type>& pRowMap,
64  global_ordinal_type *rowPtr,
65  global_ordinal_type *colInd,
66  const bool debug=false)
67 {
68 
69  int maxNumEnt = INT_MAX/sizeof(global_ordinal_type);
70 
71  Teuchos::RCP<const Teuchos::Comm<int>> pComm = pRowMap->getComm ();
72  const int numProcs = pComm->getSize ();
73  const int myRank = pComm->getRank ();
74  const int rootRank = 0;
75 
76  Teuchos::ArrayView<const global_ordinal_type> myRows = pRowMap->getLocalElementList();
77  const size_t myNumRows = myRows.size();
78 
79  myNumEntriesPerRow = Teuchos::ArrayRCP<size_t> (myNumRows);
80 
81  if (myRank != rootRank) {
82 
83  Teuchos::send (*pComm, myNumRows, rootRank);
84 
85  if (myNumRows != 0) {
86 
87  Teuchos::send (*pComm, static_cast<int> (myNumRows), myRows.getRawPtr(), rootRank);
88  Teuchos::receive (*pComm, rootRank, static_cast<int> (myNumRows), myNumEntriesPerRow.getRawPtr());
89 
90  const global_ordinal_type myNumEntries =
91  std::accumulate (myNumEntriesPerRow.begin(),
92  myNumEntriesPerRow.end(), 0);
93 
94  myColInd = Teuchos::ArrayRCP<global_ordinal_type> (myNumEntries);
95  myValues = Teuchos::ArrayRCP<scalar_type> (myNumEntries, 1.0);
96  if (myNumEntries > 0) {
97 
98  if(myNumEntries < maxNumEnt)
99  Teuchos::receive (*pComm, rootRank, static_cast<int> (myNumEntries), &myColInd[0]);
100  else {
101  int nchunks = myNumEntries/maxNumEnt;
102  if(myNumEntries % maxNumEnt != 0)
103  nchunks ++;
104  for(int i = 0; i < nchunks-1; i++) {
105  Teuchos::receive (*pComm, rootRank, maxNumEnt, &myColInd[maxNumEnt*i]);
106  std::cout << "Chunk " << i << " received by myRank "<< myRank << ", size: " << maxNumEnt << "\n";
107  }
108  int lastsize = (int)(myNumEntries - (nchunks-1)*maxNumEnt);
109  Teuchos::receive (*pComm, rootRank, lastsize, &myColInd[maxNumEnt*(nchunks-1)]);
110  std::cout << "Chunk " << nchunks-1 << " received by myRank " << myRank << ", size: " << lastsize << "\n";
111  }
112 
113  }
114 
115  } // If I own at least one row
116 
117  } // If I am not the root processor
118  else { // I _am_ the root processor
119  if (debug) {
120  std::cout << "-- Proc 0: Copying my data from global arrays" << std::endl;
121  }
122 
123  for (size_t k = 0; k < myNumRows; ++k) {
124  const global_ordinal_type myCurRow = myRows[k];
125  const global_ordinal_type numEntriesInThisRow = rowPtr[myCurRow+1] - rowPtr[myCurRow];
126  myNumEntriesPerRow[k] = numEntriesInThisRow;
127 
128  }
129 
130  size_t myNumEntries = std::accumulate (myNumEntriesPerRow.begin(),
131  myNumEntriesPerRow.end(), 0);
132  if (debug) {
133  std::cout << "-- Proc 0: I own " << myNumRows << " rows and "
134  << myNumEntries << " entries" << std::endl;
135  }
136  myColInd = Teuchos::ArrayRCP<global_ordinal_type> (myNumEntries);
137  myValues = Teuchos::ArrayRCP<scalar_type> (myNumEntries, 1.0);
138 
139  global_ordinal_type myCurPos = 0;
140  for (size_t k = 0; k < myNumRows; ++k) {
141  const global_ordinal_type curNumEntries = myNumEntriesPerRow[k];
142  const global_ordinal_type myRow = myRows[k];
143  global_ordinal_type curPos = rowPtr[myRow];
144 
145  if (curNumEntries > 0) {
146  for(global_ordinal_type ii = 0; ii < curNumEntries; ++ii) {
147  myColInd[myCurPos++] = colInd[curPos++];
148  }
149  }
150  }
151 
152  for (int p = 1; p < numProcs; ++p) {
153  if (debug) {
154  std::cout << "-- Proc 0: Processing proc " << p << std::endl;
155  }
156 
157  size_t theirNumRows = 0;
158  Teuchos::receive (*pComm, p, &theirNumRows);
159  if (debug) {
160  std::cout << "-- Proc 0: Proc " << p << " owns "
161  << theirNumRows << " rows" << std::endl;
162  }
163 
164  if (theirNumRows != 0) {
165  Teuchos::ArrayRCP<global_ordinal_type> theirRows(theirNumRows);
166  Teuchos::receive (*pComm, p, Teuchos::as<int> (theirNumRows), theirRows.getRawPtr ());
167 
168  Teuchos::ArrayRCP<size_t> theirNumEntriesPerRow = Teuchos::ArrayRCP<size_t> (theirNumRows);
169  for (size_t k = 0; k < theirNumRows; ++k) {
170  theirNumEntriesPerRow[k] = rowPtr[theirRows[k]+1] - rowPtr[theirRows[k]];
171  }
172 
173  Teuchos::send (*pComm, static_cast<int> (theirNumRows), theirNumEntriesPerRow.getRawPtr(), p);
174 
175  const global_ordinal_type theirNumEntries =
176  std::accumulate (theirNumEntriesPerRow.begin(),
177  theirNumEntriesPerRow.end(), 0);
178 
179  if (debug) {
180  std::cout << "-- Proc 0: Proc " << p << " owns "
181  << theirNumEntries << " entries" << std::endl;
182  }
183 
184  if (theirNumEntries == 0) {
185  continue;
186  }
187 
188  Teuchos::ArrayRCP<global_ordinal_type> theirColInd (theirNumEntries);
189 
190  global_ordinal_type theirCurPos = 0;
191  for (size_t k = 0; k < theirNumRows; k++) {
192  const global_ordinal_type curNumEntries = theirNumEntriesPerRow[k];
193  const global_ordinal_type theirRow = theirRows[k];
194  global_ordinal_type curPos = rowPtr[theirRow];
195 
196  if (curNumEntries > 0) {
197 
198  for(global_ordinal_type ii = 0; ii < curNumEntries; ++ii) {
199  theirColInd[theirCurPos++] = colInd[curPos++];
200  }
201 
202  }
203  }
204 
205  if(theirNumEntries < maxNumEnt)
206  Teuchos::send (*pComm, static_cast<int> (theirNumEntries), &theirColInd[0], p);
207  else {
208  int nchunks = theirNumEntries/maxNumEnt;
209  if(theirNumEntries % maxNumEnt != 0)
210  nchunks ++;
211  for(int i = 0; i < nchunks-1; i++) {
212  Teuchos::send (*pComm, maxNumEnt, &theirColInd[maxNumEnt*i], p);
213  std::cout << "Chunk " << i << " sent to Rank "<< p << ", size: " << maxNumEnt << "\n";
214  }
215  int lastsize = (int)(theirNumEntries - (nchunks-1)*maxNumEnt);
216  Teuchos::send (*pComm, lastsize, &theirColInd[maxNumEnt*(nchunks-1)], p);
217  std::cout << "Chunk " << nchunks-1 << " sent to Rank "<< p << ", size: " << lastsize << "\n";
218  }
219 
220  if (debug) {
221  std::cout << "-- Proc 0: Finished with proc " << p << std::endl;
222  }
223 
224  } // If proc p owns at least one row
225  } // For each proc p not the root proc 0
226  } // If I'm (not) the root proc 0
227 
228  if (debug && myRank == 0) {
229  std::cout << "-- Proc 0: About to fill in myRowPtr" << std::endl;
230  }
231 
232  myRowPtr = Teuchos::ArrayRCP<size_t> (myNumRows+1);
233  myRowPtr[0] = 0;
234  for (size_t k = 1; k < myNumRows+1; ++k) {
235  myRowPtr[k] = myRowPtr[k-1] + myNumEntriesPerRow[k-1];
236  }
237  if (debug && myRank == 0) {
238  std::cout << "-- Proc 0: Done with distribute" << std::endl;
239  }
240 }
241 
242 template <typename crs_matrix_type>
243 Teuchos::RCP<crs_matrix_type>
244 readBinaryFile(std::string filename, const Teuchos::RCP<const Teuchos::Comm<int>> pComm, bool callFillComplete=true, bool debug=false)
245 {
246  typedef typename crs_matrix_type::global_ordinal_type global_ordinal_type;
247  typedef typename crs_matrix_type::local_ordinal_type local_ordinal_type;
248  typedef typename crs_matrix_type::scalar_type scalar_type;
249  typedef typename crs_matrix_type::node_type node_type;
250 
251  typedef typename Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
252 
253  const int myRank = pComm->getRank();
254  const int rootRank = 0;
255 
256  if (debug && myRank == rootRank) {
257  std::cout << "Binary CRS reader: readSparse:" << std::endl
258  << "-- Reading started" << std::endl;
259  }
260 
261  Teuchos::RCP<std::ifstream> in;
262  global_ordinal_type globalNumRows;
263  global_ordinal_type globalNumNonzeros;
264 
265  if (myRank == rootRank) {
266 
267  // Open the file
268  in = Teuchos::RCP<std::ifstream>(new std::ifstream(filename, std::ios::in | std::ios::binary));
269 
270  // Read number of vertices and number of edges
271  in->read((char *)&globalNumRows, sizeof(global_ordinal_type));
272  in->read((char *)&globalNumNonzeros, sizeof(global_ordinal_type));
273 
274  TEUCHOS_TEST_FOR_EXCEPTION(globalNumRows <= 0 || globalNumNonzeros <= 0, std::invalid_argument,
275  "Global number of rows or nonzeros have nonpositive value." << globalNumRows << " " << globalNumNonzeros << " " << sizeof(global_ordinal_type) );
276  }
277 
278  broadcast (*pComm, rootRank, 1, &globalNumRows);
279  broadcast (*pComm, rootRank, 1, &globalNumNonzeros);
280 
281  global_ordinal_type *rowPtr = 0;
282  global_ordinal_type *colInd = 0;
283 
284  if (myRank == rootRank) {
285 
286  rowPtr = new global_ordinal_type[globalNumRows+1];
287  colInd = new global_ordinal_type[globalNumNonzeros];
288 
289  in->read((char*)rowPtr, sizeof(global_ordinal_type)*(globalNumRows+1));
290  in->read((char*)colInd, sizeof(global_ordinal_type)*(globalNumNonzeros));
291  }
292 
293  Teuchos::RCP<const map_type> pRowMap = Teuchos::rcp (new map_type (static_cast<Tpetra::global_size_t> (globalNumRows),
294  static_cast<global_ordinal_type> (0),
295  pComm, Tpetra::GloballyDistributed));
296 
297  Teuchos::RCP<const map_type> pRangeMap = Teuchos::rcp (new map_type (static_cast<Tpetra::global_size_t> (globalNumRows),
298  static_cast<global_ordinal_type> (0),
299  pComm, Tpetra::GloballyDistributed));
300 
301  Teuchos::RCP<const map_type> pDomainMap = pRangeMap;
302 
303  Teuchos::ArrayView<const global_ordinal_type> myRows = pRowMap->getLocalElementList ();
304  const size_t myNumRows = myRows.size ();
305 
306  Teuchos::ArrayRCP<size_t> myNumEntriesPerRow(myNumRows);
307  Teuchos::ArrayRCP<size_t> myRowPtr;
308  Teuchos::ArrayRCP<global_ordinal_type> myColInd;
309  Teuchos::ArrayRCP<scalar_type> myValues;
310 
311  distribute<global_ordinal_type, local_ordinal_type, scalar_type, map_type>(myNumEntriesPerRow, myRowPtr, myColInd, myValues, pRowMap, rowPtr, colInd, debug);
312  pComm->barrier();
313 
314  if (debug && myRank == rootRank) {
315  std::cout << "-- Inserting matrix entries on each processor";
316  if (callFillComplete) {
317  std::cout << " and calling fillComplete()";
318  }
319  std::cout << std::endl;
320  }
321 
322  Teuchos::RCP<crs_matrix_type> pMatrix = Teuchos::rcp (new crs_matrix_type (pRowMap, myNumEntriesPerRow()));
323 
324  const global_ordinal_type indexBase = pRowMap->getIndexBase ();
325  for (size_t i = 0; i < myNumRows; ++i) {
326  const size_t myCurPos = myRowPtr[i];
327  const local_ordinal_type curNumEntries = myNumEntriesPerRow[i];
328  Teuchos::ArrayView<global_ordinal_type> curColInd = myColInd.view (myCurPos, curNumEntries);
329  Teuchos::ArrayView<scalar_type> curValues = myValues.view (myCurPos, curNumEntries);
330 
331  for (size_t k = 0; k < curNumEntries; ++k) {
332  curColInd[k] += indexBase;
333  }
334 
335  if (curNumEntries > 0) {
336  pMatrix->insertGlobalValues (myRows[i], curColInd, curValues);
337  }
338  }
339  pComm->barrier();
340  if (debug && myRank == rootRank) {
341  std::cout << "-- Done with inserting." << std::endl;
342  }
343 
344  myNumEntriesPerRow = Teuchos::null;
345  myRowPtr = Teuchos::null;
346  myColInd = Teuchos::null;
347  myValues = Teuchos::null;
348 
349  if (callFillComplete) {
350  pMatrix->fillComplete (pDomainMap, pRangeMap);
351  }
352  pComm->barrier();
353  if (debug && myRank == rootRank) {
354  std::cout << "-- Done with fill complete." << std::endl;
355  }
356 
357 
358  if(myRank == rootRank) {
359  delete [] rowPtr;
360  delete [] colInd;
361  }
362 
363  return pMatrix;
364 }
365 
366 template <typename crs_matrix_type>
367 Teuchos::RCP<crs_matrix_type>
368 readBinaryFileFast(std::string filename, const Teuchos::RCP<const Teuchos::Comm<int>> pComm, bool callFillComplete=true, bool debug=false)
369 {
370  typedef typename crs_matrix_type::global_ordinal_type global_ordinal_type;
371  typedef typename crs_matrix_type::local_ordinal_type local_ordinal_type;
372  typedef typename crs_matrix_type::scalar_type scalar_type;
373  typedef typename crs_matrix_type::node_type node_type;
374  typedef typename crs_matrix_type::crs_graph_type crs_graph_type;
375 
376  typedef typename Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
377 
378  const int myRank = pComm->getRank();
379  const int rootRank = 0;
380 
381  if (debug && myRank == rootRank) {
382  std::cout << "Binary CRS reader: readSparse:" << std::endl
383  << "-- Reading started" << std::endl;
384  }
385 
386  Teuchos::RCP<std::ifstream> in;
387  global_ordinal_type globalNumRows;
388  global_ordinal_type globalNumNonzeros;
389 
390  if (myRank == rootRank) {
391 
392  // Open the file
393  in = Teuchos::RCP<std::ifstream>(new std::ifstream(filename, std::ios::in | std::ios::binary));
394 
395  // Read number of vertices and number of edges
396  in->read((char *)&globalNumRows, sizeof(global_ordinal_type));
397  in->read((char *)&globalNumNonzeros, sizeof(global_ordinal_type));
398 
399  TEUCHOS_TEST_FOR_EXCEPTION(globalNumRows <= 0 || globalNumNonzeros <= 0, std::invalid_argument,
400  "Global number of rows or nonzeros have nonpositive value." << globalNumRows << " " << globalNumNonzeros << " " << sizeof(global_ordinal_type) );
401  }
402 
403  broadcast (*pComm, rootRank, 1, &globalNumRows);
404  broadcast (*pComm, rootRank, 1, &globalNumNonzeros);
405 
406  global_ordinal_type *rowPtr = 0;
407  global_ordinal_type *colInd = 0;
408 
409  if (myRank == rootRank) {
410 
411  rowPtr = new global_ordinal_type[globalNumRows+1];
412  colInd = new global_ordinal_type[globalNumNonzeros];
413 
414  in->read((char*)rowPtr, sizeof(global_ordinal_type)*(globalNumRows+1));
415  in->read((char*)colInd, sizeof(global_ordinal_type)*(globalNumNonzeros));
416 
417  }
418 
419 
420  Teuchos::RCP<const map_type> pRowMap = Teuchos::rcp (new map_type (static_cast<Tpetra::global_size_t> (globalNumRows),
421  static_cast<global_ordinal_type> (0),
422  pComm, Tpetra::GloballyDistributed));
423 
424  Teuchos::RCP<const map_type> pRangeMap = Teuchos::rcp (new map_type (static_cast<Tpetra::global_size_t> (globalNumRows),
425  static_cast<global_ordinal_type> (0),
426  pComm, Tpetra::GloballyDistributed));
427 
428  Teuchos::RCP<const map_type> pDomainMap = pRangeMap;
429 
430  Teuchos::ArrayView<const global_ordinal_type> myRows = pRowMap->getLocalElementList ();
431  const size_t myNumRows = myRows.size ();
432 
433  Teuchos::ArrayRCP<size_t> myNumEntriesPerRow(myNumRows);
434  Teuchos::ArrayRCP<size_t> myRowPtr;
435  Teuchos::ArrayRCP<global_ordinal_type> myColInd;
436  Teuchos::ArrayRCP<scalar_type> myValues;
437 
438 
439  distribute<global_ordinal_type, local_ordinal_type, scalar_type, map_type>(myNumEntriesPerRow, myRowPtr, myColInd, myValues, pRowMap, rowPtr, colInd, debug);
440  pComm->barrier();
441 
442  if (debug && myRank == rootRank) {
443  std::cout << "-- Inserting matrix entries on each processor";
444  if (callFillComplete) {
445  std::cout << " and calling fillComplete()";
446  }
447  std::cout << std::endl;
448  }
449 
450  // get the colIds
451  std::vector<bool> mark(globalNumRows, false);
452  size_t myNumEntries = myRowPtr[myNumRows];
453  for(size_t i = 0; i < myNumEntries; i++)
454  mark[myColInd[i]] = true;
455 
456  local_ordinal_type myNumCols = 0;
457  for(global_ordinal_type i = 0; i < globalNumRows; i++)
458  if(mark[i] == true)
459  myNumCols++;
460 
461  Kokkos::View<global_ordinal_type*, typename node_type::memory_space> myColGIDs("myColGIDs", myNumCols);
462  auto myColGIDs_host = Kokkos::create_mirror_view(Kokkos::HostSpace(), myColGIDs);
463 
464  myNumCols = 0;
465  for(global_ordinal_type i = 0; i < globalNumRows; i++)
466  if(mark[i] == true) {
467  myColGIDs_host(myNumCols)= i;
468  myNumCols++;
469  };
470 
471  Kokkos::deep_copy(myColGIDs, myColGIDs_host);
472 
473  Teuchos::RCP<const map_type> pColumnMap;
474  Tpetra::Details::makeColMap(pColumnMap, pDomainMap, myColGIDs);
475 
476  std::vector<local_ordinal_type> map(globalNumRows);
477  for(global_ordinal_type i = 0; i < globalNumRows; i++) {
478  if(mark[i] == true)
479  map[i] = pColumnMap->getLocalElement(i);
480  }
481 
482  Teuchos::ArrayRCP<local_ordinal_type> myLclColInd(myNumEntries);
483  for(size_t i = 0; i < myNumEntries; i++)
484  myLclColInd[i] = map[myColInd[i]];
485 
486  local_ordinal_type *cur = myLclColInd.getRawPtr();
487 
488  for(size_t i = 0; i < myNumRows; i++) {
489  size_t start = myRowPtr[i];
490  size_t end = myRowPtr[i+1];
491 
492  std::sort(&cur[start], &cur[end]);
493  }
494 
495  Teuchos::RCP<crs_graph_type> graph(new crs_graph_type(pRowMap, pColumnMap, myRowPtr, myLclColInd));
496  graph->fillComplete(pDomainMap, pRangeMap);
497 
498  Kokkos::View<scalar_type*, typename node_type::memory_space> values("values", myNumEntries);
499  Kokkos::deep_copy(values, 1.0);
500 
501  Teuchos::RCP<crs_matrix_type> pMatrix (new crs_matrix_type(graph, values));
502  pMatrix->fillComplete(pDomainMap, pRangeMap);
503 
504  pComm->barrier();
505  if (debug && myRank == rootRank) {
506  std::cout << "-- Done with fill complete." << std::endl;
507  }
508 
509  if(myRank == rootRank) {
510  delete [] rowPtr;
511  delete [] colInd;
512  }
513 
514  return pMatrix;
515 }
516 
517 template <typename crs_matrix_type>
518 Teuchos::RCP<crs_matrix_type>
519 readMatrixFromBinaryFile(std::string filename, const Teuchos::RCP<const Teuchos::Comm<int>> pComm, bool binary=true, bool debug=false)
520 {
521  return readBinaryFileFast<crs_matrix_type>(filename, pComm, true, debug);
522 }
523 
524 #endif
525 
void distribute(Teuchos::ArrayRCP< size_t > &myNumEntriesPerRow, Teuchos::ArrayRCP< size_t > &myRowPtr, Teuchos::ArrayRCP< global_ordinal_type > &myColInd, Teuchos::ArrayRCP< scalar_type > &myValues, const Teuchos::RCP< const map_type > &pRowMap, global_ordinal_type *rowPtr, global_ordinal_type *colInd, const bool debug=false)
Teuchos::RCP< crs_matrix_type > readBinaryFileFast(std::string filename, const Teuchos::RCP< const Teuchos::Comm< int >> pComm, bool callFillComplete=true, bool debug=false)
Teuchos::RCP< crs_matrix_type > readMatrixFromBinaryFile(std::string filename, const Teuchos::RCP< const Teuchos::Comm< int >> pComm, bool binary=true, bool debug=false)
Teuchos::RCP< crs_matrix_type > readBinaryFile(std::string filename, const Teuchos::RCP< const Teuchos::Comm< int >> pComm, bool callFillComplete=true, bool debug=false)