Zoltan 2 Version 0.5

A simple class that can be the User template argument for an InputAdapter. More...
#include <Zoltan2_InputTraits.hpp>
A simple class that can be the User template argument for an InputAdapter.
BasicUserTypes is a convenience class that provides a simple way to supply the template argument when constructing an InputAdapter.
Typically, a C++ user will have a templated or nontemplated class that represents his or her input data. He or she will create an InputTraits specialization for this class, and then supply that as the template argument of the InputAdapter class. (Commonly used Trilinos classes that represent vectors, graphs and matrices already have InputTraits specializations.)
This makes sense if you are a C++ programmer who uses templates, but is a great deal of trouble if you are not. In this case you can construct your InputAdapter as follows.
Suppose you want to construct a Zoltan2::BasicVectorInput object and you use float
for vector values in your application, long
for global identifiers, and int
for local indices.
You need to determine an integral data type that Zoltan2 can use internally for global identifiers. Often this is the same data type that you use for this purpose, but if you have nonintegral global identifiers (such as pair<int, int>) then Zoltan2 needs you to supply an integral data type that is large enough to globally enumerate your objects. In this example let's say that you want Zoltan2 to use unsigned
long
for its global Identifiers. Then you would do the following:
typedef BasicUserTypes<float, long, int, unsigned long> myTypes; Zoltan2::BasicVectorInput<myTypes> myInput({constructor arguments})
In particular, the BasicUserTypes template parameters are:
scalar
is the data type for element values, weights and coordinates. gid
(global id) is the data type used by the application for global Ids. If the application's global Id data type is a Teuchos Ordinal, then gid
and gno
can the same. Otherwise, the application global Ids will be mapped to Teuchos Ordinals for use by Zoltan2 internally. (Teuchos Ordinals are those data types for which traits are defined in Teuchos_OrdinalTraits.hpp.) lno
(local number) is the integral data type used by the application and by Zoltan2 for local indices and local counts. gno
(global number) is the integral data type used by Zoltan2 to represent global indices and global counts. Definition at line 132 of file Zoltan2_InputTraits.hpp.