Zoltan2 Version of the Day
Public Types | Public Member Functions | Static Public Member Functions
UserInputForTests Class Reference

A class that generates typical user input for testing. More...

#include <UserInputForTests.hpp>

List of all members.

Public Types

typedef Tpetra::CrsMatrix
< scalar_t, lno_t, gno_t,
node_t
tcrsMatrix_t
typedef Tpetra::CrsGraph
< lno_t, gno_t, node_t
tcrsGraph_t
typedef Tpetra::Vector
< scalar_t, lno_t, gno_t,
node_t
tVector_t
typedef Tpetra::MultiVector
< scalar_t, lno_t, gno_t,
node_t
tMVector_t
typedef Xpetra::CrsMatrix
< scalar_t, lno_t, gno_t,
node_t
xcrsMatrix_t
typedef Xpetra::CrsGraph
< lno_t, gno_t, node_t
xcrsGraph_t
typedef Xpetra::Vector
< scalar_t, lno_t, gno_t,
node_t
xVector_t
typedef Xpetra::MultiVector
< scalar_t, lno_t, gno_t,
node_t
xMVector_t
typedef Tpetra::Map< lno_t,
gno_t, node_t
map_t
typedef Tpetra::Export< lno_t,
gno_t, node_t
export_t
typedef Tpetra::Import< lno_t,
gno_t, node_t
import_t
typedef
Kokkos::DefaultNode::DefaultNodeType 
default_node_t

Public Member Functions

 UserInputForTests (string path, string testData, const RCP< const Comm< int > > &c, bool debugInfo=false)
 Constructor that reads in a matrix/graph from disk.
 UserInputForTests (int x, int y, int z, string matrixType, const RCP< const Comm< int > > &c, bool debugInfo=false)
 Constructor that generates an arbitrary sized sparse matrix.
RCP< tMVector_tgetCoordinates ()
RCP< tMVector_tgetWeights ()
RCP< tMVector_tgetEdgeWeights ()
RCP< tcrsMatrix_tgetTpetraCrsMatrix ()
RCP< tcrsGraph_tgetTpetraCrsGraph ()
RCP< tVector_tgetTpetraVector ()
RCP< tMVector_tgetTpetraMultiVector (int nvec)
RCP< xcrsMatrix_tgetXpetraCrsMatrix ()
RCP< xcrsGraph_tgetXpetraCrsGraph ()
RCP< xVector_tgetXpetraVector ()
RCP< xMVector_tgetXpetraMultiVector (int nvec)

Static Public Member Functions

static void getRandomData (unsigned int seed, lno_t length, scalar_t min, scalar_t max, ArrayView< ArrayRCP< scalar_t > > data)
 Generate lists of random scalars.

Detailed Description

A class that generates typical user input for testing.

Given:

Retrieve the data in any of the following forms:

Retrieve any of the these with the same map but with random data:

Coordinates and/or weights will be retrieved if they are found. They are provided in a Tpetra::MultiVector.

Random data can also be generated.

Todo:

for very large files, each process reads in part of the file

Zoltan1 mtx and mtxp files

Definition at line 114 of file UserInputForTests.hpp.


Member Typedef Documentation

Definition at line 118 of file UserInputForTests.hpp.

typedef Tpetra::CrsGraph<lno_t, gno_t, node_t> UserInputForTests::tcrsGraph_t

Definition at line 119 of file UserInputForTests.hpp.

Definition at line 120 of file UserInputForTests.hpp.

typedef Tpetra::MultiVector<scalar_t, lno_t, gno_t, node_t> UserInputForTests::tMVector_t

Definition at line 121 of file UserInputForTests.hpp.

Definition at line 123 of file UserInputForTests.hpp.

typedef Xpetra::CrsGraph<lno_t, gno_t, node_t> UserInputForTests::xcrsGraph_t

Definition at line 124 of file UserInputForTests.hpp.

Definition at line 125 of file UserInputForTests.hpp.

typedef Xpetra::MultiVector<scalar_t, lno_t, gno_t, node_t> UserInputForTests::xMVector_t

Definition at line 126 of file UserInputForTests.hpp.

typedef Tpetra::Map<lno_t, gno_t, node_t> UserInputForTests::map_t

Definition at line 128 of file UserInputForTests.hpp.

typedef Tpetra::Export<lno_t, gno_t, node_t> UserInputForTests::export_t

Definition at line 129 of file UserInputForTests.hpp.

typedef Tpetra::Import<lno_t, gno_t, node_t> UserInputForTests::import_t

Definition at line 130 of file UserInputForTests.hpp.

typedef Kokkos::DefaultNode::DefaultNodeType UserInputForTests::default_node_t

Definition at line 131 of file UserInputForTests.hpp.


Constructor & Destructor Documentation

UserInputForTests::UserInputForTests ( string  path,
string  testData,
const RCP< const Comm< int > > &  c,
bool  debugInfo = false 
)

Constructor that reads in a matrix/graph from disk.

Parameters:
pathis the path to the test data. In the case of Zoltan2 test data it is the path to the "data" directory. In the case of Zoltan1 test data, it is the path to the "test" directory.
testDatais the root name of the data file or files of interest.
cis the communicator for the processes that share the data.
debugInfoif true process zero will print out status.

For example, if path is the path to the Zoltan1 test directory and testData is brack2_3, then we'll read in ch_brack2_3/brack2_3.graph and ch_brack2_3/brack2_3.coords.

Definition at line 253 of file UserInputForTests.hpp.

UserInputForTests::UserInputForTests ( int  x,
int  y,
int  z,
string  matrixType,
const RCP< const Comm< int > > &  c,
bool  debugInfo = false 
)

Constructor that generates an arbitrary sized sparse matrix.

Parameters:
xthe x dimension of the mesh that generates the matrix.
ythe y dimension of the mesh that generates the matrix.
zthe z dimension of the mesh that generates the matrix.
problemTypethe type of problem that will generate a sparse matrix from the mesh. If the problemType is empty we'll pick a default.
cis the communicator for the processes that share the data.
debugInfoif true process zero will print out status.

Problems can be "Laplace1D", "Laplace2D", "Star2D", "BigStar2D", "Laplace3D", "Brick3D" and "Identity". See Galeri::Xpetra::BuildProblem() for more information about problem types.

Definition at line 276 of file UserInputForTests.hpp.


Member Function Documentation

void UserInputForTests::getRandomData ( unsigned int  seed,
lno_t  length,
scalar_t  min,
scalar_t  max,
ArrayView< ArrayRCP< scalar_t > >  data 
) [static]

Generate lists of random scalars.

Definition at line 473 of file UserInputForTests.hpp.

RCP< UserInputForTests::tMVector_t > UserInputForTests::getCoordinates ( )

Definition at line 309 of file UserInputForTests.hpp.

RCP< UserInputForTests::tMVector_t > UserInputForTests::getWeights ( )

Definition at line 316 of file UserInputForTests.hpp.

RCP< UserInputForTests::tMVector_t > UserInputForTests::getEdgeWeights ( )

Definition at line 321 of file UserInputForTests.hpp.

RCP< UserInputForTests::tcrsMatrix_t > UserInputForTests::getTpetraCrsMatrix ( )

Definition at line 326 of file UserInputForTests.hpp.

RCP< UserInputForTests::tcrsGraph_t > UserInputForTests::getTpetraCrsGraph ( )

Definition at line 333 of file UserInputForTests.hpp.

RCP< UserInputForTests::tVector_t > UserInputForTests::getTpetraVector ( )

Definition at line 340 of file UserInputForTests.hpp.

RCP< UserInputForTests::tMVector_t > UserInputForTests::getTpetraMultiVector ( int  nvec)

Definition at line 348 of file UserInputForTests.hpp.

RCP< UserInputForTests::xcrsMatrix_t > UserInputForTests::getXpetraCrsMatrix ( )

Definition at line 356 of file UserInputForTests.hpp.

RCP< UserInputForTests::xcrsGraph_t > UserInputForTests::getXpetraCrsGraph ( )

Definition at line 363 of file UserInputForTests.hpp.

RCP< UserInputForTests::xVector_t > UserInputForTests::getXpetraVector ( )

Definition at line 370 of file UserInputForTests.hpp.

RCP< UserInputForTests::xMVector_t > UserInputForTests::getXpetraMultiVector ( int  nvec)

Definition at line 378 of file UserInputForTests.hpp.


The documentation for this class was generated from the following file: