Zoltan2  Version of the Day
XpetraTraits.cpp
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 Karen Devine (kddevin@sandia.gov)
39 // Erik Boman (egboman@sandia.gov)
40 // Siva Rajamanickam (srajama@sandia.gov)
41 //
42 // ***********************************************************************
43 //
44 // @HEADER
45 //
46 // Basic test of the XpetraTraits definitions.
47 //
48 // TODO - a real test would figure out if the migrated objects are
49 // the same as the original, here we just look at them on stdout.
50 // TODO look at number of diagonals and max number of entries in
51 // Tpetra and Xpetra migrated graphs. They're garbage.
52 
53 #include <Zoltan2_XpetraTraits.hpp>
54 #include <Zoltan2_TestHelpers.hpp>
55 
56 #include <string>
57 #include <Teuchos_GlobalMPISession.hpp>
58 #include <Teuchos_DefaultComm.hpp>
59 #include <Teuchos_RCP.hpp>
60 #include <Teuchos_Array.hpp>
61 #include <Teuchos_ArrayRCP.hpp>
62 #include <Teuchos_Comm.hpp>
63 #include <Teuchos_VerboseObject.hpp>
64 #include <Tpetra_CrsMatrix.hpp>
65 #include <Tpetra_Vector.hpp>
66 
67 #include <Xpetra_EpetraUtils.hpp>
68 #ifdef HAVE_ZOLTAN2_MPI
69 #include <Epetra_MpiComm.h>
70 #else
71 #include <Epetra_SerialComm.h>
72 #endif
73 
74 using namespace std;
75 using std::string;
76 using Teuchos::RCP;
77 using Teuchos::ArrayRCP;
78 using Teuchos::ArrayView;
79 using Teuchos::Array;
80 using Teuchos::rcp;
81 using Teuchos::Comm;
82 
83 ArrayRCP<gno_t> roundRobinMap(
84  const RCP<const Xpetra::Map<lno_t, gno_t, node_t> > &m)
85 {
86  const RCP<const Comm<int> > &comm = m->getComm();
87  int proc = comm->getRank();
88  int nprocs = comm->getSize();
89  gno_t base = m->getMinAllGlobalIndex();
90  gno_t max = m->getMaxAllGlobalIndex();
91  size_t globalrows = m->getGlobalNumElements();
92  if (globalrows != size_t(max - base + 1)){
93  TEST_FAIL_AND_EXIT(*comm, 0,
94  string("Map is invalid for test - fix test"), 1);
95  }
96  RCP<Array<gno_t> > mygids = rcp(new Array<gno_t>);
97  gno_t firstgno_t = proc;
98  if (firstgno_t < base){
99  gno_t n = base % proc;
100  if (n>0)
101  firstgno_t = base - n + proc;
102  else
103  firstgno_t = base;
104  }
105  for (gno_t gid=firstgno_t; gid <= max; gid+=nprocs){
106  (*mygids).append(gid);
107  }
108 
109  ArrayRCP<gno_t> newIdArcp = Teuchos::arcp(mygids);
110 
111  return newIdArcp;
112 }
113 
114 int main(int argc, char *argv[])
115 {
116  Teuchos::GlobalMPISession session(&argc, &argv);
117  RCP<const Comm<int> > comm = Teuchos::DefaultComm<int>::getComm();
118  int rank = comm->getRank();
119 
120  Teuchos::RCP<Teuchos::FancyOStream> outStream =
121  Teuchos::VerboseObjectBase::getDefaultOStream();
122  Teuchos::EVerbosityLevel v=Teuchos::VERB_EXTREME;
123 
124  typedef UserInputForTests uinput_t;
125  typedef Tpetra::CrsMatrix<scalar_t,lno_t,gno_t,node_t> tmatrix_t;
126  typedef Tpetra::CrsGraph<lno_t,gno_t,node_t> tgraph_t;
127  typedef Tpetra::Vector<scalar_t,lno_t,gno_t,node_t> tvector_t;
128  typedef Tpetra::MultiVector<scalar_t,lno_t,gno_t,node_t> tmvector_t;
129  typedef Xpetra::CrsMatrix<scalar_t,lno_t,gno_t,node_t> xmatrix_t;
130  typedef Xpetra::CrsGraph<lno_t,gno_t,node_t> xgraph_t;
131  typedef Xpetra::Vector<scalar_t,lno_t,gno_t,node_t> xvector_t;
132  typedef Xpetra::MultiVector<scalar_t,lno_t,gno_t,node_t> xmvector_t;
133  typedef Xpetra::TpetraMap<lno_t,gno_t,node_t> xtmap_t;
134 
135  // Create object that can give us test Tpetra and Xpetra input.
136 
137  RCP<uinput_t> uinput;
138 
139  try{
140  uinput =
141  rcp(new uinput_t(testDataFilePath,std::string("simple"), comm, true));
142  }
143  catch(std::exception &e){
144  TEST_FAIL_AND_EXIT(*comm, 0, string("input ")+e.what(), 1);
145  }
146 
148  // Tpetra::CrsMatrix
149  // Tpetra::CrsGraph
150  // Tpetra::Vector
151  // Tpetra::MultiVector
153 
154  // XpetraTraits<Tpetra::CrsMatrix<scalar_t, lno_t, gno_t, node_t> >
155  {
156  RCP<tmatrix_t> M;
157 
158  try{
159  M = uinput->getTpetraCrsMatrix();
160  }
161  catch(std::exception &e){
162  TEST_FAIL_AND_EXIT(*comm, 0,
163  string("getTpetraCrsMatrix ")+e.what(), 1);
164  }
165 
166  if (rank== 0)
167  std::cout << "Original Tpetra matrix " << M->getGlobalNumRows()
168  << " x " << M->getGlobalNumCols() << std::endl;
169 
170  M->describe(*outStream,v);
171 
172  RCP<const xtmap_t> xmap(new xtmap_t(M->getRowMap()));
173 
174  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
175 
176  gno_t localNumRows = newRowIds.size();
177 
178  RCP<const tmatrix_t> newM;
179  try{
181  rcp_const_cast<const tmatrix_t>(M),
182  localNumRows, newRowIds.getRawPtr());
183  }
184  catch(std::exception &e){
185  TEST_FAIL_AND_EXIT(*comm, 0,
186  string(" Zoltan2::XpetraTraits<tmatrix_t>::doMigration ")+e.what(), 1);
187  }
188 
189  if (rank== 0)
190  std::cout << "Migrated Tpetra matrix" << std::endl;
191 
192  newM->describe(*outStream,v);
193  }
194 
195  // XpetraTraits<Tpetra::CrsGraph<scalar_t, lno_t, gno_t, node_t> >
196  {
197  RCP<tgraph_t> G;
198 
199  try{
200  G = uinput->getTpetraCrsGraph();
201  }
202  catch(std::exception &e){
203  TEST_FAIL_AND_EXIT(*comm, 0,
204  string("getTpetraCrsGraph ")+e.what(), 1);
205  }
206 
207  if (rank== 0)
208  std::cout << "Original Tpetra graph" << std::endl;
209 
210  G->describe(*outStream,v);
211 
212  RCP<const xtmap_t> xmap(new xtmap_t(G->getRowMap()));
213  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
214 
215  gno_t localNumRows = newRowIds.size();
216 
217  RCP<const tgraph_t> newG;
218  try{
220  rcp_const_cast<const tgraph_t>(G),
221  localNumRows, newRowIds.getRawPtr());
222  }
223  catch(std::exception &e){
224  TEST_FAIL_AND_EXIT(*comm, 0,
225  string(" Zoltan2::XpetraTraits<tgraph_t>::doMigration ")+e.what(), 1);
226  }
227 
228  if (rank== 0)
229  std::cout << "Migrated Tpetra graph" << std::endl;
230 
231  newG->describe(*outStream,v);
232  }
233 
234  // XpetraTraits<Tpetra::Vector<scalar_t, lno_t, gno_t, node_t>>
235  {
236  RCP<tvector_t> V;
237 
238  try{
239  V = uinput->getTpetraVector();
240  }
241  catch(std::exception &e){
242  TEST_FAIL_AND_EXIT(*comm, 0,
243  string("getTpetraVector")+e.what(), 1);
244  }
245 
246  if (rank== 0)
247  std::cout << "Original Tpetra vector" << std::endl;
248 
249  V->describe(*outStream,v);
250 
251  RCP<const xtmap_t> xmap(new xtmap_t(V->getMap()));
252  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
253 
254  gno_t localNumRows = newRowIds.size();
255 
256  RCP<const tvector_t> newV;
257  try{
259  rcp_const_cast<const tvector_t>(V),
260  localNumRows, newRowIds.getRawPtr());
261  }
262  catch(std::exception &e){
263  TEST_FAIL_AND_EXIT(*comm, 0,
264  string(" Zoltan2::XpetraTraits<tvector_t>::doMigration ")+e.what(), 1);
265  }
266 
267  if (rank== 0)
268  std::cout << "Migrated Tpetra vector" << std::endl;
269 
270  newV->describe(*outStream,v);
271  }
272 
273  // XpetraTraits<Tpetra::MultiVector<scalar_t, lno_t, gno_t, node_t>>
274  {
275  RCP<tmvector_t> MV;
276 
277  try{
278  MV = uinput->getTpetraMultiVector(3);
279  }
280  catch(std::exception &e){
281  TEST_FAIL_AND_EXIT(*comm, 0,
282  string("getTpetraMultiVector")+e.what(), 1);
283  }
284 
285  if (rank== 0)
286  std::cout << "Original Tpetra multivector" << std::endl;
287 
288  MV->describe(*outStream,v);
289 
290  RCP<const xtmap_t> xmap(new xtmap_t(MV->getMap()));
291  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
292 
293  gno_t localNumRows = newRowIds.size();
294 
295  RCP<const tmvector_t> newMV;
296  try{
298  rcp_const_cast<const tmvector_t>(MV),
299  localNumRows, newRowIds.getRawPtr());
300  }
301  catch(std::exception &e){
302  TEST_FAIL_AND_EXIT(*comm, 0,
303  string(" Zoltan2::XpetraTraits<tmvector_t>::doMigration ")+e.what(), 1);
304  }
305 
306  if (rank== 0)
307  std::cout << "Migrated Tpetra multivector" << std::endl;
308 
309  newMV->describe(*outStream,v);
310  }
311 
313  // Xpetra::CrsMatrix
314  // Xpetra::CrsGraph
315  // Xpetra::Vector
316  // Xpetra::MultiVector
318 
319  // XpetraTraits<Xpetra::CrsMatrix<scalar_t, lno_t, gno_t, node_t> >
320  {
321  RCP<xmatrix_t> M;
322 
323  try{
324  M = uinput->getXpetraCrsMatrix();
325  }
326  catch(std::exception &e){
327  TEST_FAIL_AND_EXIT(*comm, 0,
328  string("getXpetraCrsMatrix ")+e.what(), 1);
329  }
330 
331  if (rank== 0)
332  std::cout << "Original Xpetra matrix" << std::endl;
333 
334  M->describe(*outStream,v);
335 
336  ArrayRCP<gno_t> newRowIds = roundRobinMap(M->getRowMap());
337 
338  gno_t localNumRows = newRowIds.size();
339 
340  RCP<const xmatrix_t> newM;
341  try{
343  rcp_const_cast<const xmatrix_t>(M),
344  localNumRows, newRowIds.getRawPtr());
345  }
346  catch(std::exception &e){
347  TEST_FAIL_AND_EXIT(*comm, 0,
348  string(" Zoltan2::XpetraTraits<xmatrix_t>::doMigration ")+e.what(), 1);
349  }
350 
351  if (rank== 0)
352  std::cout << "Migrated Xpetra matrix" << std::endl;
353 
354  newM->describe(*outStream,v);
355  }
356 
357  // XpetraTraits<Xpetra::CrsGraph<scalar_t, lno_t, gno_t, node_t> >
358  {
359  RCP<xgraph_t> G;
360 
361  try{
362  G = uinput->getXpetraCrsGraph();
363  }
364  catch(std::exception &e){
365  TEST_FAIL_AND_EXIT(*comm, 0,
366  string("getXpetraCrsGraph ")+e.what(), 1);
367  }
368 
369  if (rank== 0)
370  std::cout << "Original Xpetra graph" << std::endl;
371 
372  G->describe(*outStream,v);
373 
374  ArrayRCP<gno_t> newRowIds = roundRobinMap(G->getRowMap());
375 
376  gno_t localNumRows = newRowIds.size();
377 
378  RCP<const xgraph_t> newG;
379  try{
381  rcp_const_cast<const xgraph_t>(G),
382  localNumRows, newRowIds.getRawPtr());
383  }
384  catch(std::exception &e){
385  TEST_FAIL_AND_EXIT(*comm, 0,
386  string(" Zoltan2::XpetraTraits<xgraph_t>::doMigration ")+e.what(), 1);
387  }
388 
389  if (rank== 0)
390  std::cout << "Migrated Xpetra graph" << std::endl;
391 
392  newG->describe(*outStream,v);
393  }
394 
395  // XpetraTraits<Xpetra::Vector<scalar_t, lno_t, gno_t, node_t>>
396  {
397  RCP<xvector_t> V;
398 
399  try{
400  V = uinput->getXpetraVector();
401  }
402  catch(std::exception &e){
403  TEST_FAIL_AND_EXIT(*comm, 0,
404  string("getXpetraVector")+e.what(), 1);
405  }
406 
407  if (rank== 0)
408  std::cout << "Original Xpetra vector" << std::endl;
409 
410  V->describe(*outStream,v);
411 
412  ArrayRCP<gno_t> newRowIds = roundRobinMap(V->getMap());
413 
414  gno_t localNumRows = newRowIds.size();
415 
416  RCP<const xvector_t> newV;
417  try{
419  rcp_const_cast<const xvector_t>(V),
420  localNumRows, newRowIds.getRawPtr());
421  }
422  catch(std::exception &e){
423  TEST_FAIL_AND_EXIT(*comm, 0,
424  string(" Zoltan2::XpetraTraits<xvector_t>::doMigration ")+e.what(), 1);
425  }
426 
427  if (rank== 0)
428  std::cout << "Migrated Xpetra vector" << std::endl;
429 
430  newV->describe(*outStream,v);
431  }
432 
433  // XpetraTraits<Xpetra::MultiVector<scalar_t, lno_t, gno_t, node_t>>
434  {
435  RCP<xmvector_t> MV;
436 
437  try{
438  MV = uinput->getXpetraMultiVector(3);
439  }
440  catch(std::exception &e){
441  TEST_FAIL_AND_EXIT(*comm, 0,
442  string("getXpetraMultiVector")+e.what(), 1);
443  }
444 
445  if (rank== 0)
446  std::cout << "Original Xpetra multivector" << std::endl;
447 
448  MV->describe(*outStream,v);
449 
450  ArrayRCP<gno_t> newRowIds = roundRobinMap(MV->getMap());
451 
452  gno_t localNumRows = newRowIds.size();
453 
454  RCP<const xmvector_t> newMV;
455  try{
457  rcp_const_cast<const xmvector_t>(MV),
458  localNumRows, newRowIds.getRawPtr());
459  }
460  catch(std::exception &e){
461  TEST_FAIL_AND_EXIT(*comm, 0,
462  string(" Zoltan2::XpetraTraits<xmvector_t>::doMigration ")+e.what(), 1);
463  }
464 
465  if (rank== 0)
466  std::cout << "Migrated Xpetra multivector" << std::endl;
467 
468  newMV->describe(*outStream,v);
469  }
470 
471 #ifdef HAVE_EPETRA_DATA_TYPES
472  // Epetra_CrsMatrix
474  // Epetra_CrsGraph
475  // Epetra_Vector
476  // Epetra_MultiVector
478 
479  typedef Epetra_CrsMatrix ematrix_t;
480  typedef Epetra_CrsGraph egraph_t;
481  typedef Epetra_Vector evector_t;
482  typedef Epetra_MultiVector emvector_t;
483  typedef Xpetra::EpetraMap xemap_t;
484  typedef Epetra_BlockMap emap_t;
485 
486  // Create object that can give us test Epetra input.
487 
488  RCP<uinput_t> euinput;
489 
490  try{
491  euinput =
492  rcp(new uinput_t(testDataFilePath,std::string("simple"), comm, true));
493  }
494  catch(std::exception &e){
495  TEST_FAIL_AND_EXIT(*comm, 0, string("epetra input ")+e.what(), 1);
496  }
497 
498  // XpetraTraits<Epetra_CrsMatrix>
499  {
500  RCP<ematrix_t> M;
501 
502  try{
503  M = euinput->getEpetraCrsMatrix();
504  }
505  catch(std::exception &e){
506  TEST_FAIL_AND_EXIT(*comm, 0,
507  string("getEpetraCrsMatrix ")+e.what(), 1);
508  }
509 
510  if (rank== 0)
511  std::cout << "Original Epetra matrix" << std::endl;
512 
513  M->Print(std::cout);
514 
515  RCP<const emap_t> emap = Teuchos::rcpFromRef(M->RowMap());
516  RCP<const xemap_t> xmap(new xemap_t(emap));
517 
518  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
519 
520  gno_t localNumRows = newRowIds.size();
521 
522  RCP<const ematrix_t> newM;
523  try{
525  rcp_const_cast<const ematrix_t>(M),
526  localNumRows, newRowIds.getRawPtr());
527  }
528  catch(std::exception &e){
529  TEST_FAIL_AND_EXIT(*comm, 0,
530  string(" Zoltan2::XpetraTraits<ematrix_t>::doMigration ")+e.what(), 1);
531  }
532 
533  if (rank== 0)
534  std::cout << "Migrated Epetra matrix" << std::endl;
535 
536  newM->Print(std::cout);
537  }
538 
539  // XpetraTraits<Epetra_CrsGraph>
540  {
541  RCP<egraph_t> G;
542 
543  try{
544  G = euinput->getEpetraCrsGraph();
545  }
546  catch(std::exception &e){
547  TEST_FAIL_AND_EXIT(*comm, 0,
548  string("getEpetraCrsGraph ")+e.what(), 1);
549  }
550 
551  if (rank== 0)
552  std::cout << "Original Epetra graph" << std::endl;
553 
554  G->Print(std::cout);
555 
556  RCP<const emap_t> emap = Teuchos::rcpFromRef(G->RowMap());
557  RCP<const xemap_t> xmap(new xemap_t(emap));
558  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
559 
560  gno_t localNumRows = newRowIds.size();
561 
562  RCP<const egraph_t> newG;
563  try{
565  rcp_const_cast<const egraph_t>(G),
566  localNumRows, newRowIds.getRawPtr());
567  }
568  catch(std::exception &e){
569  TEST_FAIL_AND_EXIT(*comm, 0,
570  string(" Zoltan2::XpetraTraits<egraph_t>::doMigration ")+e.what(), 1);
571  }
572 
573  if (rank== 0)
574  std::cout << "Migrated Epetra graph" << std::endl;
575 
576  newG->Print(std::cout);
577  }
578 
579  // XpetraTraits<Epetra_Vector>
580  {
581  RCP<evector_t> V;
582 
583  try{
584  V = euinput->getEpetraVector();
585  }
586  catch(std::exception &e){
587  TEST_FAIL_AND_EXIT(*comm, 0,
588  string("getEpetraVector")+e.what(), 1);
589  }
590 
591  if (rank== 0)
592  std::cout << "Original Epetra vector" << std::endl;
593 
594  V->Print(std::cout);
595 
596  RCP<const emap_t> emap = Teuchos::rcpFromRef(V->Map());
597  RCP<const xemap_t> xmap(new xemap_t(emap));
598  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
599 
600  gno_t localNumRows = newRowIds.size();
601 
602  RCP<const evector_t> newV;
603  try{
605  rcp_const_cast<const evector_t>(V),
606  localNumRows, newRowIds.getRawPtr());
607  }
608  catch(std::exception &e){
609  TEST_FAIL_AND_EXIT(*comm, 0,
610  string(" Zoltan2::XpetraTraits<evector_t>::doMigration ")+e.what(), 1);
611  }
612 
613  if (rank== 0)
614  std::cout << "Migrated Epetra vector" << std::endl;
615 
616  newV->Print(std::cout);
617  }
618 
619  // XpetraTraits<Epetra_MultiVector>
620  {
621  RCP<emvector_t> MV;
622 
623  try{
624  MV = euinput->getEpetraMultiVector(3);
625  }
626  catch(std::exception &e){
627  TEST_FAIL_AND_EXIT(*comm, 0,
628  string("getEpetraMultiVector")+e.what(), 1);
629  }
630 
631  if (rank== 0)
632  std::cout << "Original Epetra multivector" << std::endl;
633 
634  MV->Print(std::cout);
635 
636  RCP<const emap_t> emap = Teuchos::rcpFromRef(MV->Map());
637  RCP<const xemap_t> xmap(new xemap_t(emap));
638  ArrayRCP<gno_t> newRowIds = roundRobinMap(xmap);
639 
640  gno_t localNumRows = newRowIds.size();
641 
642  RCP<const emvector_t> newMV;
643  try{
645  rcp_const_cast<const emvector_t>(MV),
646  localNumRows, newRowIds.getRawPtr());
647  }
648  catch(std::exception &e){
649  TEST_FAIL_AND_EXIT(*comm, 0,
650  string(" Zoltan2::XpetraTraits<emvector_t>::doMigration ")+e.what(), 1);
651  }
652 
653  if (rank== 0)
654  std::cout << "Migrated Epetra multivector" << std::endl;
655 
656  newMV->Print(std::cout);
657  }
658 #endif // have epetra data types (int, int, double)
659 
661  // DONE
663 
664  if (rank==0)
665  std::cout << "PASS" << std::endl;
666 }
667 
Xpetra::CrsGraph< lno_t, gno_t, node_t > xgraph_t
A class that generates typical user input for testing.
#define TEST_FAIL_AND_EXIT(comm, ok, s, code)
Traits of Xpetra classes, including migration method.
common code used by tests
Epetra_CrsGraph egraph_t
int main(int argc, char *argv[])
UserInputForTests uinput_t
Epetra_MultiVector evector_t
Xpetra::MultiVector< scalar_t, lno_t, gno_t, node_t > xvector_t
static RCP< const User > doMigration(const RCP< const User > &from, lno_t numLocalRows, const gno_t *myNewRows)
Migrate the object Given a user object and a new row distribution, create and return a new user objec...
ArrayRCP< gno_t > roundRobinMap(const RCP< const Xpetra::Map< lno_t, gno_t, node_t > > &m)
Tpetra::CrsMatrix< scalar_t, lno_t, gno_t, node_t > tmatrix_t
Tpetra::CrsGraph< lno_t, gno_t, node_t > tgraph_t
Epetra_CrsMatrix ematrix_t
Xpetra::CrsMatrix< scalar_t, lno_t, gno_t, node_t > xmatrix_t
Tpetra::MultiVector< scalar_t, lno_t, gno_t, node_t > tvector_t
std::string testDataFilePath(".")