Zoltan2
Zoltan2_AlgZoltanCallbacks.hpp
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 #ifndef _ZOLTAN2_ALGZOLTANCALLBACKS_HPP_
46 #define _ZOLTAN2_ALGZOLTANCALLBACKS_HPP_
47 
48 #include <Zoltan2_MeshAdapter.hpp>
50 #include <Zoltan2_GraphAdapter.hpp>
53 
55 
56 #include <Zoltan2_Util.hpp>
57 #include <Zoltan2_TPLTraits.hpp>
58 #include <zoltan_cpp.h>
59 
63 // Callbacks based on Adapter; specializations provided where needed
64 
65 namespace Zoltan2 {
66 
68 // CALLBACKS SHARED BY MANY ADAPTERS
70 
72 // ZOLTAN_NUM_OBJ_FN
73 template <typename Adapter>
74 static int zoltanNumObj(void *data, int *ierr) {
75  const Adapter *adp = static_cast<Adapter *>(data);
76  *ierr = ZOLTAN_OK;
77  return int(adp->getLocalNumIDs());
78 }
79 
81 // ZOLTAN_OBJ_LIST_FN
82 template <typename Adapter>
83 static void zoltanObjList(void *data, int nGidEnt, int nLidEnt,
84  ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids,
85  int wdim, float *wgts, int *ierr)
86 {
87  const Adapter *adp = static_cast<Adapter *>(data);
88  typedef typename Adapter::gno_t gno_t;
89  typedef typename Adapter::lno_t lno_t;
90  *ierr = ZOLTAN_OK;
91 
92  size_t mynObj = adp->getLocalNumIDs();
93 
94  const gno_t *myids = NULL;
95  adp->getIDsView(myids);
96  for (size_t i = 0; i < mynObj; i++) {
97  ZOLTAN_ID_PTR idPtr = &(gids[i*nGidEnt]);
99  idPtr = &(lids[i*nLidEnt]);
101  }
102 
103  if (wdim) {
104  int mywdim = adp->getNumWeightsPerID();
105  for (int w = 0; w < wdim; w++) {
106  if (w < mywdim) {
107  // copy weights from adapter
108  const typename Adapter::scalar_t *mywgts;
109  int mystride;
110  adp->getWeightsView(mywgts, mystride, w);
111  for (size_t i = 0; i < mynObj; i++)
112  wgts[i*wdim+w] = float(mywgts[i*mystride]);
113  }
114  else {
115  // provide uniform weights
116  for (size_t i = 0; i < mynObj; i++)
117  wgts[i*wdim+w] = 1.;
118  }
119  }
120  }
121 }
122 
124 // ZOLTAN_PART_MULTI_FN
125 template <typename Adapter>
126 static void zoltanParts(void *data, int nGidEnt, int nLidEnt, int nObj,
127  ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids,
128  int *parts, int *ierr)
129 {
130  typedef typename Adapter::lno_t lno_t;
131  const Adapter *adp = static_cast<Adapter *>(data);
132  *ierr = ZOLTAN_OK;
133  const typename Adapter::part_t *myparts;
134  adp->getPartsView(myparts);
135  // User parts from input adapter
136  for (int i = 0; i < nObj; i++) {
137  lno_t lidx;
138  TPL_Traits<lno_t,ZOLTAN_ID_PTR>::ASSIGN_TPL_T(lidx, &(lids[i*nLidEnt]));
139  parts[i] = int(myparts[lidx]);
140  }
141 }
142 
144 // ZOLTAN_NUM_GEOM_FN
145 template <typename Adapter>
146 static int zoltanNumGeom(void *data, int *ierr)
147 {
148  const Adapter *adp = static_cast<Adapter *>(data);
149  *ierr = ZOLTAN_OK;
150  return adp->getDimension();
151 }
152 
154 // ZOLTAN_GEOM_MULTI_FN
155 template <typename Adapter>
156 static void zoltanGeom(void *data, int nGidEnt, int nLidEnt, int nObj,
157  ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids,
158  int nDim, double *coords, int *ierr)
159 {
160  typedef typename Adapter::lno_t lno_t;
161  const Adapter *adp = static_cast<Adapter *>(data);
162  *ierr = ZOLTAN_OK;
163 
164  for (int d = 0; d < nDim; d++) {
165  const typename Adapter::scalar_t *mycoords;
166  int mystride;
167  adp->getCoordinatesView(mycoords, mystride, d);
168  for (int i = 0; i < nObj; i++) {
169  lno_t lidx;
170  TPL_Traits<lno_t,ZOLTAN_ID_PTR>::ASSIGN_TPL_T(lidx, &(lids[i*nLidEnt]));
171  coords[i*nDim+d] = double(mycoords[lidx*mystride]);
172  }
173  }
174 }
175 
177 // HYPERGRAPH CALLBACKS USING A MATRIX ADAPTER
178 // Building the most straightforward hypergraph from a matrix and, thus,
179 // avoiding use of HypergraphModel.
180 // Assuming vertices are rows or columns, and pins are nonzeros.
182 
184 // ZOLTAN_HG_SIZE_CS_FN
185 template <typename Adapter>
186 static void zoltanHGSizeCS_withMatrixAdapter(void *data, int *nLists, int *nPins,
187  int *format, int *ierr
188 )
189 {
190  *ierr = ZOLTAN_OK;
191  typedef typename Adapter::user_t user_t;
192  const MatrixAdapter<user_t>* madp = static_cast<MatrixAdapter<user_t>* >(data);
193 
194  *nPins = madp->getLocalNumEntries();
195 
196  MatrixEntityType etype = madp->getPrimaryEntityType();
197  if (etype == MATRIX_ROW && madp->CRSViewAvailable()) {
198  *nLists = madp->getLocalNumRows();
199  *format = ZOLTAN_COMPRESSED_VERTEX;
200  }
201  else if (etype == MATRIX_ROW && madp->CCSViewAvailable()) {
202  *nLists = madp->getLocalNumColumns();
203  *format = ZOLTAN_COMPRESSED_EDGE;
204  }
205  else if (etype == MATRIX_COLUMN && madp->CRSViewAvailable()) {
206  *nLists = madp->getLocalNumRows();
207  *format = ZOLTAN_COMPRESSED_EDGE;
208  }
209  else if (etype == MATRIX_COLUMN && madp->CCSViewAvailable()) {
210  *nLists = madp->getLocalNumColumns();
211  *format = ZOLTAN_COMPRESSED_VERTEX;
212  }
213  else {
214  // Need either CRSView or CCSView.
215  // Also, not yet implemented for matrix nonzeros; may need a hypergraph model.
216  *ierr = ZOLTAN_FATAL;
217  }
218 }
219 
221 // ZOLTAN_HG_CS_FN
222 template <typename Adapter>
223 static void zoltanHGCS_withMatrixAdapter(void *data, int nGidEnt, int nLists,
224  int nPins, int format,
225  ZOLTAN_ID_PTR listIds, int *listIdx,
226  ZOLTAN_ID_PTR pinIds, int *ierr
227 )
228 {
229  *ierr = ZOLTAN_OK;
230  typedef typename Adapter::gno_t gno_t;
231  typedef typename Adapter::lno_t lno_t;
232  typedef typename Adapter::user_t user_t;
233  const MatrixAdapter<user_t>* madp = static_cast<MatrixAdapter<user_t>* >(data);
234 
235  const gno_t *Ids;
236  const gno_t *pIds;
237  const lno_t *offsets;
238 
239  // Get the pins and list IDs.
240  if (madp->CRSViewAvailable()) {
241  try {
242  madp->getRowIDsView(Ids);
243  madp->getCRSView(offsets, pIds);
244  }
245  catch (std::exception &e) {
246  *ierr = ZOLTAN_FATAL;
247  }
248  }
249  else if (madp->CCSViewAvailable()) {
250  try {
251  madp->getColumnIDsView(Ids);
252  madp->getCCSView(offsets, pIds);
253  }
254  catch (std::exception &e) {
255  *ierr = ZOLTAN_FATAL;
256  }
257  }
258  else {
259  // Need either CRSView or CCSView.
260  *ierr = ZOLTAN_FATAL;
261  }
262 
263  if (*ierr == ZOLTAN_OK) {
264  // copy into Zoltan's memory
265  for (int i=0; i < nLists; i++) {
266  ZOLTAN_ID_PTR idPtr = &(listIds[i*nGidEnt]);
268  listIdx[i] = Teuchos::as<int>(offsets[i]);
269  }
270  listIdx[nLists] = Teuchos::as<int>(offsets[nLists]);
271  for (int i=0; i < nPins; i++) {
272  ZOLTAN_ID_PTR idPtr = &(pinIds[i*nGidEnt]);
274  }
275  }
276 }
277 
279 // TODO: GRAPH ADAPTER CALLBACKS
280 
281 
283 // HYPERGRAPH CALLBACKS USING A MESH ADAPTER
284 // Implement Boman/Chevalier's hypergraph mesh model
285 // Skip explicit construction of a HypergraphModel
286 // Return either (depending on available adjacencies):
287 // + for each primary entity (vtx), the list of assoc adjacency entities (edges)
288 // + for each adjacency entity (edge), the list of assoc primary entities (vtx)
290 
292 // ZOLTAN_HG_SIZE_CS_FN
293 template <typename Adapter>
294 static void zoltanHGSizeCS_withMeshAdapter(void *data, int *nLists, int *nPins,
295  int *format, int *ierr
296 )
297 {
298  *ierr = ZOLTAN_OK;
299  typedef typename Adapter::user_t user_t;
300  const MeshAdapter<user_t>* madp = static_cast<MeshAdapter<user_t>* >(data);
301  if (madp->availAdjs(madp->getPrimaryEntityType(),
302  madp->getAdjacencyEntityType()))
303  {
304  *nLists = madp->getLocalNumOf(madp->getPrimaryEntityType());
305  *nPins = madp->getLocalNumAdjs(madp->getPrimaryEntityType(),
306  madp->getAdjacencyEntityType());
307  *format = ZOLTAN_COMPRESSED_VERTEX;
308  }
309  else if (madp->availAdjs(madp->getAdjacencyEntityType(),
310  madp->getPrimaryEntityType()))
311  {
312  *nLists = madp->getLocalNumOf(madp->getAdjacencyEntityType());
313  *nPins = madp->getLocalNumAdjs(madp->getAdjacencyEntityType(),
314  madp->getPrimaryEntityType());
315  *format = ZOLTAN_COMPRESSED_EDGE;
316  }
317  else {
318  *nLists = 0;
319  *nPins = 0;
320  *format = -1*ZOLTAN_COMPRESSED_VERTEX;
321  *ierr = ZOLTAN_FATAL;
322  }
323 }
324 
326 // ZOLTAN_HG_CS_FN
327 template <typename Adapter>
329  void *data, int nGidEnt, int nLists, int nPins,
330  int format, ZOLTAN_ID_PTR listIds,
331  int *listIdx, ZOLTAN_ID_PTR pinIds, int *ierr
332 )
333 {
334  *ierr = ZOLTAN_OK;
335  typedef typename Adapter::gno_t gno_t;
336  typedef typename Adapter::lno_t lno_t;
337  typedef typename Adapter::user_t user_t;
338  const MeshAdapter<user_t>* madp = static_cast<MeshAdapter<user_t>*>(data);
339 
340  // Select listType and pinType based on format specified in ZOLTAN_HG_CS_SIZE_FN
341  MeshEntityType listType, pinType;
342  if (format == ZOLTAN_COMPRESSED_VERTEX)
343  {
344  listType = madp->getPrimaryEntityType();
345  pinType = madp->getAdjacencyEntityType();
346  }
347  else if (format == ZOLTAN_COMPRESSED_EDGE)
348  {
349  listType = madp->getAdjacencyEntityType();
350  pinType = madp->getPrimaryEntityType();
351  }
352  else {
353  *ierr = ZOLTAN_FATAL;
354  }
355 
356  if (*ierr == ZOLTAN_OK) {
357 
358  // get list IDs
359  const gno_t *Ids;
360  try {
361  madp->getIDsViewOf(listType,Ids);
362  }
363  catch (std::exception &e) {
364  *ierr = ZOLTAN_FATAL;
365  }
366 
367  // get pins
368  const lno_t* offsets;
369  const gno_t* adjIds;
370  try {
371  madp->getAdjsView(listType, pinType, offsets, adjIds);
372  }
373  catch (std::exception &e) {
374  *ierr = ZOLTAN_FATAL;
375  }
376 
377  // copy into Zoltan's memory
378  for (int i=0; i < nLists; i++) {
379  ZOLTAN_ID_PTR idPtr = &(listIds[i*nGidEnt]);
381  listIdx[i] = Teuchos::as<int>(offsets[i]);
382  }
383  listIdx[nLists] = Teuchos::as<int>(offsets[nLists]);
384  for (int i=0; i < nPins; i++) {
385  ZOLTAN_ID_PTR idPtr = &(pinIds[i*nGidEnt]);
387  }
388  }
389 }
390 
392 // HYPERGRAPH CALLBACKS FROM A HYPERGRAPH MODEL
394 
396 // ZOLTAN_NUM_OBJ_FN
397 template <typename Adapter>
398 static int zoltanHGNumObj_withModel(void *data, int *ierr) {
399  const HyperGraphModel<Adapter>* mdl =
400  static_cast<HyperGraphModel<Adapter>* >(data);
401  *ierr = ZOLTAN_OK;
402  return int(mdl->getLocalNumOwnedVertices());
403 }
404 
406 // ZOLTAN_OBJ_LIST_FN
407 template <typename Adapter>
408 static void zoltanHGObjList_withModel(void *data, int nGidEnt, int nLidEnt,
409  ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids,
410  int wdim, float *wgts, int *ierr)
411 {
412  const HyperGraphModel<Adapter>* mdl =
413  static_cast<HyperGraphModel<Adapter>* >(data);
414  typedef typename Adapter::gno_t gno_t;
415  typedef typename Adapter::lno_t lno_t;
416  typedef typename Adapter::scalar_t scalar_t;
417  typedef StridedData<lno_t, scalar_t> input_t;
418 
419  *ierr = ZOLTAN_OK;
420  ArrayView<const gno_t> Ids;
421  ArrayView<input_t> model_wgts;
422  size_t num_verts = mdl->getVertexList(Ids,model_wgts);
423  ArrayView<bool> isOwner;
424  mdl->getOwnedList(isOwner);
425  int j=0;
426  for (size_t i=0;i<num_verts;i++) {
427  if (isOwner[i]) {
428  ZOLTAN_ID_PTR idPtr = &(gids[j*nGidEnt]);
430  idPtr = &(lids[j*nLidEnt]);
432  j++;
433  }
434  }
435  if (wdim) {
436  int mywdim = mdl->getNumWeightsPerVertex();
437  for (int w = 0; w < wdim; w++) {
438  j=0;
439  if (w < mywdim) {
440  for (size_t i = 0; i < num_verts; i++) {
441  if (isOwner[i]) {
442  wgts[j*wdim+w] = float(model_wgts[w][i]);
443  j++;
444  }
445  }
446  }
447  else {
448  // provide uniform weights
449  for (size_t i = 0; i < num_verts; i++) {
450  if (isOwner[i]) {
451  wgts[j*wdim+w] = 1.;
452  j++;
453  }
454  }
455  }
456  }
457  }
458 }
459 
461 // ZOLTAN_HG_SIZE_CS_FN
462 template <typename Adapter>
463 static void zoltanHGSizeCS_withModel(void *data, int *nEdges, int *nPins,
464  int *format, int *ierr
465 )
466 {
467  *ierr = ZOLTAN_OK;
468  const HyperGraphModel<Adapter>* mdl =
469  static_cast<HyperGraphModel<Adapter>* >(data);
470  *nEdges = mdl->getLocalNumHyperEdges();
471  *nPins = mdl->getLocalNumPins();
472  if (mdl->getCentricView()==HYPEREDGE_CENTRIC)
473  *format = ZOLTAN_COMPRESSED_EDGE;
474  else
475  *format = ZOLTAN_COMPRESSED_VERTEX;
476 }
477 
479 // ZOLTAN_HG_CS_FN
480 template <typename Adapter>
481 static void zoltanHGCS_withModel(void *data, int nGidEnt, int nEdges, int nPins,
482  int format, ZOLTAN_ID_PTR edgeIds,
483  int *edgeIdx, ZOLTAN_ID_PTR pinIds, int *ierr
484 )
485 {
486  *ierr = ZOLTAN_OK;
487  const HyperGraphModel<Adapter>* mdl =
488  static_cast<HyperGraphModel<Adapter>* >(data);
489  typedef typename Adapter::gno_t gno_t;
490  typedef typename Adapter::lno_t lno_t;
491  typedef typename Adapter::scalar_t scalar_t;
492  typedef StridedData<lno_t, scalar_t> input_t;
493 
494  ArrayView<const gno_t> Ids;
495  ArrayView<input_t> wgts;
496  mdl->getEdgeList(Ids,wgts);
497  ArrayView<const gno_t> pinIds_;
498  ArrayView<const lno_t> offsets;
499  ArrayView<input_t> pin_wgts;
500  mdl->getPinList(pinIds_,offsets,pin_wgts);
501  for (int i=0;i<nEdges;i++) {
502  ZOLTAN_ID_PTR idPtr = &(edgeIds[i*nGidEnt]);
504  edgeIdx[i] = Teuchos::as<int>(offsets[i]);
505  }
506 
507  for (int i=0;i<nPins;i++) {
508  ZOLTAN_ID_PTR idPtr = &(pinIds[i*nGidEnt]);
510  }
511 }
512 
513 }
514 
515 
516 #endif
static void zoltanHGCS_withModel(void *data, int nGidEnt, int nEdges, int nPins, int format, ZOLTAN_ID_PTR edgeIds, int *edgeIdx, ZOLTAN_ID_PTR pinIds, int *ierr)
static int zoltanNumGeom(void *data, int *ierr)
virtual bool availAdjs(MeshEntityType source, MeshEntityType target) const
Returns whether a first adjacency combination is available.
MatrixAdapter defines the adapter interface for matrices.
Defines the MeshAdapter interface.
CentricView getCentricView() const
Returns the centric view of the hypergraph.
MeshAdapter defines the interface for mesh input.
virtual size_t getLocalNumOf(MeshEntityType etype) const =0
Returns the global number of mesh entities of MeshEntityType.
size_t getPinList(ArrayView< const gno_t > &pinIds, ArrayView< const lno_t > &offsets, ArrayView< input_t > &wgts) const
Sets pointers to this process&#39; pins global Ids based on the centric view given by getCentricView() ...
Defines the IdentifierAdapter interface.
Defines the VectorAdapter interface.
enum MatrixEntityType getPrimaryEntityType() const
Returns the entity to be partitioned, ordered, colored, etc. Valid values are MATRIX_ROW, MATRIX_COLUMN, MATRIX_NONZERO.
enum MeshEntityType getAdjacencyEntityType() const
Returns the entity that describes adjacencies between the entities to be partitioned, ordered, colored, etc. That is, a primaryEntityType that contains an adjacencyEntityType are adjacent.
static void zoltanObjList(void *data, int nGidEnt, int nLidEnt, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int wdim, float *wgts, int *ierr)
static void zoltanHGCS_withMeshAdapter(void *data, int nGidEnt, int nLists, int nPins, int format, ZOLTAN_ID_PTR listIds, int *listIdx, ZOLTAN_ID_PTR pinIds, int *ierr)
static int zoltanNumObj(void *data, int *ierr)
size_t getOwnedList(ArrayView< bool > &isOwner) const
Sets pointer to the ownership of this processes vertices.
virtual size_t getLocalNumColumns() const =0
Returns the number of columns on this process.
virtual void getCRSView(const lno_t *&offsets, const gno_t *&colIds) const
Sets pointers to this process&#39; matrix entries using compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
virtual void getIDsViewOf(MeshEntityType etype, gno_t const *&Ids) const =0
Provide a pointer to this process&#39; identifiers.
static void zoltanHGCS_withMatrixAdapter(void *data, int nGidEnt, int nLists, int nPins, int format, ZOLTAN_ID_PTR listIds, int *listIdx, ZOLTAN_ID_PTR pinIds, int *ierr)
size_t getEdgeList(ArrayView< const gno_t > &Ids, ArrayView< input_t > &wgts) const
Sets pointers to this process&#39; hyperedge Ids and their weights.
static void zoltanHGSizeCS_withModel(void *data, int *nEdges, int *nPins, int *format, int *ierr)
virtual bool CCSViewAvailable() const
Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse column (CCS)...
static void zoltanGeom(void *data, int nGidEnt, int nLidEnt, int nObj, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int nDim, double *coords, int *ierr)
size_t getLocalNumHyperEdges() const
Returns the number of hyper edges on this process. These are all hyper edges that have an adjacency t...
virtual size_t getLocalNumAdjs(MeshEntityType source, MeshEntityType target) const
Returns the number of first adjacencies on this process.
The StridedData class manages lists of weights or coordinates.
virtual void getAdjsView(MeshEntityType source, MeshEntityType target, const lno_t *&offsets, const gno_t *&adjacencyIds) const
Sets pointers to this process&#39; mesh first adjacencies.
static int zoltanHGNumObj_withModel(void *data, int *ierr)
size_t getLocalNumPins() const
Returns the local number of pins.
size_t getVertexList(ArrayView< const gno_t > &Ids, ArrayView< input_t > &wgts) const
Sets pointers to this process&#39; vertex Ids and their weights.
Traits class to handle conversions between gno_t/lno_t and TPL data types (e.g., ParMETIS&#39;s idx_t...
static void zoltanParts(void *data, int nGidEnt, int nLidEnt, int nObj, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int *parts, int *ierr)
virtual void getCCSView(const lno_t *&offsets, const gno_t *&rowIds) const
Sets pointers to this process&#39; matrix entries using compressed sparse column (CCS) format...
static void zoltanHGSizeCS_withMeshAdapter(void *data, int *nLists, int *nPins, int *format, int *ierr)
static void zoltanHGObjList_withModel(void *data, int nGidEnt, int nLidEnt, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int wdim, float *wgts, int *ierr)
Defines the HyperGraphModel interface.
MeshEntityType
Enumerate entity types for meshes: Regions, Faces, Edges, or Vertices.
Defines the MatrixAdapter interface.
static void ASSIGN_TPL_T(tpl_t &a, zno_t b)
Defines the GraphAdapter interface.
virtual void getRowIDsView(const gno_t *&rowIds) const
Sets pointer to this process&#39; rows&#39; global IDs.
virtual bool CRSViewAvailable() const
Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse row (CRS) fo...
static void zoltanHGSizeCS_withMatrixAdapter(void *data, int *nLists, int *nPins, int *format, int *ierr)
virtual size_t getLocalNumRows() const =0
Returns the number of rows on this process.
virtual size_t getLocalNumEntries() const =0
Returns the number of nonzeros on this process.
A gathering of useful namespace methods.
HyperGraphModel defines the interface required for hyper graph models.
enum MeshEntityType getPrimaryEntityType() const
Returns the entity to be partitioned, ordered, colored, etc.
int getNumWeightsPerVertex() const
Returns the number (0 or greater) of weights per vertex.
size_t getLocalNumOwnedVertices() const
Returns the number vertices on this process that are owned.
virtual void getColumnIDsView(const gno_t *&colIds) const
Sets pointer to this process&#39; columns&#39; global IDs.