|
Zoltan2
Version of the Day
|
BasicCoordinateInput represents geometric coordinates that are supplied by the user as pointers to strided arrays. More...
#include <Zoltan2_BasicCoordinateInput.hpp>


Public Member Functions | |
| BasicCoordinateInput (lno_t numIds, const gid_t *ids, const scalar_t *x, const scalar_t *y, const scalar_t *z, int xStride=1, int yStride=1, int zStride=1) | |
| Constructor for dimension 1, 2 or 3 and no weights. More... | |
| BasicCoordinateInput (lno_t numIds, const gid_t *ids, vector< const scalar_t * > &values, vector< int > &valueStrides, vector< const scalar_t * > &weights, vector< int > &weightStrides) | |
| Constructor for arbitrary dimension with weights. More... | |
| ~BasicCoordinateInput () | |
| string | inputAdapterName () const |
| Returns a descriptive name that identifies the concrete adapter. More... | |
| size_t | getLocalNumberOfObjects () const |
| Returns the number of objects in the input. More... | |
| int | getNumberOfWeightsPerObject () const |
| Returns the number of weights per object. Number of weights per object should be zero or greater. If zero, then it is assumed that all objects are equally weighted. More... | |
| size_t | getObjectWeights (int dim, const scalar_t *&wgt, int &stride) const |
| Provide pointer to a weight array with stride. More... | |
| int | getCoordinateDimension () const |
| Return dimension of the coordinates. More... | |
| int | getNumberOfWeights () const |
| Return the number of weights per coordinate. More... | |
| size_t | getLocalNumberOfCoordinates () const |
| Return the number of coordinates on this process. More... | |
| size_t | getCoordinates (int dim, const gid_t *&gids, const scalar_t *&coords, int &stride) const |
| Provide a pointer to one dimension of this process' coordinates. More... | |
| size_t | getCoordinateWeights (int dim, const scalar_t *&weights, int &stride) const |
| Provide a pointer to the weights, if any, corresponding to the coordinates returned in getCoordinates(). More... | |
| enum InputAdapterType | inputAdapterType () const |
| Returns the type of adapter. More... | |
| template<typename Adapter > | |
| size_t | applyPartitioningSolution (User &in, User *&out, const PartitioningSolution< Adapter > &solution) const |
| Apply a PartitioningSolution to an input. More... | |
Static Public Member Functions | |
| static string | inputAdapterTypeName (InputAdapterType iaType) |
| Returns the name of the input adapter. More... | |
BasicCoordinateInput represents geometric coordinates that are supplied by the user as pointers to strided arrays.
Input adapters provide access for Zoltan2 to the user's data. The methods in the interface must be defined by users. Many built-in adapters are already defined for common data structures, such as Tpetra and Epetra objects and C-language pointers to arrays.
Data types:
scalar_t is the data type for weights and coordinates lno_t is the integral data type used by Zoltan2 for local indices and local counts. gno_t is the integral data type used by Zoltan2 to represent global indices and global counts. gid_t 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_t and gno_t are 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 Trilinos/packages/teuchos/src/Teuchos_OrdinalTraits.hpp.) node_t is a sub class of Kokkos::StandardNodeMemoryModel, which is used to optimize performance on many-core and multi-core architectures. If you don't use Kokkos, you can ignore this data type.The template parameter (User) is a C++ class type which provides the actual data types with which the Zoltan2 library will be compiled, through a Traits mechanism. User may be the actual class used by application to represent coordinates, or it may be the empty helper class BasicUserTypes with which a Zoltan2 user can easily supply the data types for the library.
The scalar_t type, representing use data such as matrix values, is used by Zoltan2 for weights, coordinates, part sizes and quality metrics. Some User types (like Tpetra::CrsMatrix) have an inherent scalar type, and some (like Tpetra::CrsGraph) do not. For such objects, the scalar type is set by Zoltan2 to float. If you wish to change it to double, set the second template parameter to double.
Definition at line 93 of file Zoltan2_BasicCoordinateInput.hpp.
| Zoltan2::BasicCoordinateInput< User >::BasicCoordinateInput | ( | lno_t | numIds, |
| const gid_t * | ids, | ||
| const scalar_t * | x, | ||
| const scalar_t * | y, | ||
| const scalar_t * | z, | ||
| int | xStride = 1, |
||
| int | yStride = 1, |
||
| int | zStride = 1 |
||
| ) |
Constructor for dimension 1, 2 or 3 and no weights.
| numIds | The number of local coordinates. |
| ids | The global identifiers for the coordinates. |
| x | A pointer to the first dimension of the coordinates. |
| y | A pointer to the second dimension, if any. |
| z | A pointer to the third dimension, if any. |
| xStride | The stride for the x list. The coordinate for point ids[n] should be found at x[xStride * n]. |
| yStride | The stride for the y list. The coordinate for point ids[n] should be found at y[yStride * n]. |
| zStride | The stride for the z list. The coordinate for point ids[n] should be found at z[zStride * n]. |
The values pointed to the arguments must remain valid for the lifetime of this InputAdapter.
Definition at line 239 of file Zoltan2_BasicCoordinateInput.hpp.
| Zoltan2::BasicCoordinateInput< User >::BasicCoordinateInput | ( | lno_t | numIds, |
| const gid_t * | ids, | ||
| vector< const scalar_t * > & | values, | ||
| vector< int > & | valueStrides, | ||
| vector< const scalar_t * > & | weights, | ||
| vector< int > & | weightStrides | ||
| ) |
Constructor for arbitrary dimension with weights.
| numIds | the local number of coordinates. |
| ids | is a pointer to the coordinate global Ids. |
| values | a list of pointers to the coordinate values corresponding to the numIds ids. The coordinate dimension is taken to be values.size(). |
| valueStrides | The strides for the values list. The coordinate for dimension n for ids[k] should be found at values[n][valueStrides[n] * k]. If valueStrides.size() is zero, it is assumed all strides are one. |
| weights | a list of pointers to arrays of weights. The number of weights per coordinate is assumed to be weights.size(). |
| weightStrides | a list of strides for the weights. The weight for weight dimension n for ids[k] should be found at weights[n][weightStrides[n] * k]. If weightStrides.size() is zero, it is assumed all strides are one. |
The values pointed to the arguments must remain valid for the lifetime of this InputAdapter.
Definition at line 273 of file Zoltan2_BasicCoordinateInput.hpp.
|
inline |
Destructor
Definition at line 161 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Returns a descriptive name that identifies the concrete adapter.
Implements Zoltan2::InputAdapter< User >.
Definition at line 167 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Returns the number of objects in the input.
Objects may be coordinates, graph vertices, matrix rows, etc. They are the objects to be partitioned, ordered, or colored.
Implements Zoltan2::InputAdapter< User >.
Definition at line 169 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Returns the number of weights per object. Number of weights per object should be zero or greater. If zero, then it is assumed that all objects are equally weighted.
Implements Zoltan2::InputAdapter< User >.
Definition at line 171 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Provide pointer to a weight array with stride.
| dim | the weight dimension, zero or greater |
| wgt | on return a pointer to the weights for this dimension |
| stride | on return, the value such that the nth weight should be found at wgt[n*stride] . |
wgt array, which should be at least equal to getLocalNumberOfObjects() * stride . Implements Zoltan2::InputAdapter< User >.
Definition at line 173 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Return dimension of the coordinates.
Implements Zoltan2::CoordinateInput< User >.
Definition at line 182 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Return the number of weights per coordinate.
Implements Zoltan2::CoordinateInput< User >.
Definition at line 184 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Return the number of coordinates on this process.
Implements Zoltan2::CoordinateInput< User >.
Definition at line 186 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Provide a pointer to one dimension of this process' coordinates.
| coordDim | is a value from 0 to one less than getLocalNumberOfCoordinates() specifying which dimension is being provided in the coords list. |
| coords | points to a list of coordinate values for the dimension. |
| stride | describes the layout of the coordinate values in the coords list. If stride is one, then the ith coordinate value is coords[i], but if stride is two, then the ith coordinate value is coords[2*i]. |
coords list. This may be more than getLocalNumberOfCoordinates() because the stride may be more than one.Zoltan2 does not copy your data. The data pointed to coords must remain valid for the lifetime of this InputAdapter.
Implements Zoltan2::CoordinateInput< User >.
Definition at line 188 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtual |
Provide a pointer to the weights, if any, corresponding to the coordinates returned in getCoordinates().
| weightDim | ranges from zero to one less than getNumberOfWeights() |
| weights | is the list of weights of the given dimension for the coordinates listed in getCoordinates(). If weights for this dimension are to be uniform for all coordinates in the global problem, the weights should be a NULL pointer. |
| stride | The k'th weight is located at weights[stride*k] |
Implements Zoltan2::CoordinateInput< User >.
Definition at line 203 of file Zoltan2_BasicCoordinateInput.hpp.
|
inlinevirtualinherited |
Returns the type of adapter.
Implements Zoltan2::InputAdapter< User >.
Definition at line 127 of file Zoltan2_CoordinateInput.hpp.
|
inlineinherited |
Apply a PartitioningSolution to an input.
This is not a required part of the CoordinateInput interface. However if the Caller calls a Problem method to redistribute data, it needs this method to perform the redistribution.
| in | An input object with a structure and assignment of of global Ids to processes that matches that of the input data that instantiated this InputAdapter. |
| out | On return this should point to a newly created object with the specified partitioning. |
| solution | The Solution object created by a Problem should be supplied as the third argument. It must have been templated on user data that has the same global ID distribution as this user data. |
Definition at line 204 of file Zoltan2_CoordinateInput.hpp.
|
staticinherited |
Returns the name of the input adapter.
Definition at line 134 of file Zoltan2_InputAdapter.hpp.
1.8.5