50 #ifndef _ZOLTAN2_GRAPHADAPTER_HPP_
51 #define _ZOLTAN2_GRAPHADAPTER_HPP_
94 template <
typename User,
typename UserCoord = User>
114 bool haveCoordinateInput_ =
false;
117 #ifndef DOXYGEN_SHOULD_SKIP_THIS
124 using userCoord_t = UserCoord;
127 using VtxDegreeHostView = Kokkos::View<bool *, Kokkos::HostSpace>;
128 using device_t =
typename node_t::device_type;
176 const gno_t *&adjIds)
const = 0;
189 typename Base::ConstIdsDeviceView &adjIds)
const {
202 typename Base::ConstIdsHostView &adjIds)
const {
330 coordinateInput_ = coordData;
331 haveCoordinateInput_ =
true;
343 return coordinateInput_;
353 return this->primaryEntityType_;
362 if (typestr ==
"vertex") {
365 }
else if (typestr ==
"edge") {
370 "). Valid values are 'vertex' and 'edge'");
379 return this->adjacencyEntityType_;
388 if (typestr ==
"vertex") {
391 }
else if (typestr ==
"edge") {
396 "). Valid values are 'vertex' and 'edge'");
410 "getIDsView not yet supported for graph edges.");
417 "getIDsDeviceView not yet supported for graph edges.");
424 "getIDsHostView not yet supported for graph edges.");
437 int idx = 0)
const override {
440 "getWeightsView not yet supported for graph edges.");
446 int idx = 0)
const override {
448 "getWeightsHostView not yet supported for graph edges.");
455 "getWeightsHostView not yet supported for graph edges.");
461 int idx = 0)
const override {
463 "getWeightsDeviceView not yet supported for graph edges.");
470 "getWeightsDeviceView not yet supported for graph edges.");
477 "useDegreeAsWeight not yet supported for graph edges.");
Zoltan2::BaseAdapter< userTypes_t > base_adapter_t
VectorAdapter< UserCoord > * getCoordinateInput() const override
Obtain the coordinate data registered by the user.
virtual void getEdgeWeightsDeviceView(typename Base::WeightsDeviceView1D &weights, int=0) const
Provide a device view of the edge weights, if any.
virtual void getVertexWeightsView(const scalar_t *&weights, int &stride, int=0) const
Provide a pointer to the vertex weights, if any.
void getWeightsDeviceView(typename Base::WeightsDeviceView1D &deviceWgts, int idx=0) const override
virtual void getVertexWeightsDeviceView(typename Base::WeightsDeviceView &weights) const
Provide a device view of the vertex weights, if any.
virtual void getEdgesHostView(typename Base::ConstOffsetsHostView &offsets, typename Base::ConstIdsHostView &adjIds) const
Gets adjacency lists for all vertices in a compressed sparse row (CSR) format.
typename InputTraits< User >::scalar_t scalar_t
static void AssertCondition(bool condition, const std::string &message, const char *file=__FILE__, int line=__LINE__)
size_t getLocalNumIDs() const override
Returns the number of objects on this process.
virtual size_t getLocalNumEdges() const =0
Returns the number of edges on this process.
GraphAdapter defines the interface for graph-based user data.
virtual int getNumWeightsPerEdge() const
Returns the number (0 or greater) of edge weights.
virtual bool useDegreeAsVertexWeight(int) const
Indicate whether vertex weight with index idx should be the global degree of the vertex.
GraphEntityType
Enumerated entity type for graphs: Vertices or Edges.
map_t::global_ordinal_type gno_t
bool coordinatesAvailable() const
Indicate whether coordinate information has been set for this MatrixAdapter.
virtual void getVertexWeightsHostView(typename Base::WeightsHostView1D &weights, int=0) const
Provide a host view of the vertex weights, if any.
Defines the VectorAdapter interface.
#define Z2_THROW_NOT_IMPLEMENTED
typename node_t::device_type device_t
void getIDsHostView(typename Base::ConstIdsHostView &Ids) const override
virtual void getVertexWeightsHostView(typename Base::WeightsHostView &weights) const
Provide a host view of the vertex weights, if any.
virtual void getVertexIDsDeviceView(typename Base::ConstIdsDeviceView &vertexIds) const
Sets pointers to this process' graph entries.
void getWeightsView(const scalar_t *&wgt, int &stride, int idx=0) const override
Provide pointer to a weight array with stride.
int getNumWeightsPerID() const override
Returns the number of weights per object. Number of weights per object should be zero or greater...
virtual void getEdgesView(const offset_t *&offsets, const gno_t *&adjIds) const =0
Gets adjacency lists for all vertices in a compressed sparse row (CSR) format.
void getWeightsHostView(typename Base::WeightsHostView1D &hostWgts, int idx=0) const override
virtual void getVertexIDsHostView(typename Base::ConstIdsHostView &vertexIds) const
Sets pointers to this process' graph entries.
void setCoordinateInput(VectorAdapter< UserCoord > *coordData) override
Allow user to provide additional data that contains coordinate info associated with the MatrixAdapter...
typename InputTraits< User >::node_t node_t
typename InputTraits< User >::gno_t gno_t
BaseAdapterType
An enum to identify general types of adapters.
void getWeightsHostView(typename Base::WeightsHostView &hostWgts) const override
virtual void getVertexWeightsDeviceView(typename Base::WeightsDeviceView1D &weights, int=0) const
Provide a device view of the vertex weights, if any.
void setPrimaryEntityType(const std::string &typestr)
Sets the primary entity type. Called by algorithm based on parameter value in parameter list from app...
void getIDsView(const gno_t *&Ids) const override
Provide a pointer to this process' identifiers.
virtual void getVertexIDsView(const gno_t *&vertexIds) const =0
Sets pointers to this process' graph entries.
virtual int getNumWeightsPerVertex() const
Returns the number (0 or greater) of weights per vertex.
typename InputTraits< User >::offset_t offset_t
bool useDegreeAsWeight(int idx) const
virtual void getEdgeWeightsHostView(typename Base::WeightsHostView &weights) const
Provide a host view of the edge weights, if any.
enum GraphEntityType getAdjacencyEntityType() const
Returns the entity that describes adjacencies between the entities to be partitioned, ordered, colored, etc. Valid values are GRAPH_VERTEX or GRAPH_EDGE.
enum GraphEntityType getPrimaryEntityType() const
Returns the entity to be partitioned, ordered, colored, etc. Valid values are GRAPH_VERTEX or GRAPH_E...
virtual size_t getLocalNumVertices() const =0
Returns the number of vertices on this process.
virtual void getEdgesDeviceView(typename Base::ConstOffsetsDeviceView &offsets, typename Base::ConstIdsDeviceView &adjIds) const
Gets adjacency lists for all vertices in a compressed sparse row (CSR) format.
void setAdjacencyEntityType(const std::string &typestr)
Sets the adjacency entity type. Called by algorithm based on parameter value in parameter list from a...
void getIDsDeviceView(typename Base::ConstIdsDeviceView &Ids) const override
virtual void getEdgeWeightsHostView(typename Base::WeightsHostView1D &weights, int=0) const
Provide a host view of the edge weights, if any.
typename InputTraits< User >::lno_t lno_t
virtual void getEdgeWeightsView(const scalar_t *&weights, int &stride, int=0) const
Provide a pointer to the edge weights, if any.
virtual void getEdgeWeightsDeviceView(typename Base::WeightsDeviceView &weights) const
Provide a device view of the edge weights, if any.
enum BaseAdapterType adapterType() const override
Returns the type of adapter.
void getWeightsDeviceView(typename Base::WeightsDeviceView &deviceWgts) const override