Skip to content

Developer's Guide

Cameron Smith edited this page Jun 27, 2018 · 8 revisions

Writing operations on the CSR arrays

Example of hypergraph construction from a mesh

https://github.com/SCOREC/EnGPar/wiki/Constructing-the-N-graph#vertex-based-partition-of-a-hypergraph-created-from-a-mixed-mesh

APIs and Data structures

To access engpar's CSR arrays in the agi::PNgraph class use the publicize function: https://github.com/SCOREC/EnGPar/blob/40d649c0bf6d8021367692a065018894c14d7a96/agi/ngraph.h#L103

The agi::PNgraph class is defined here: https://github.com/SCOREC/EnGPar/blob/40d649c0bf6d8021367692a065018894c14d7a96/agi/pngraph.h

The variables relevant to running an on-process vertex coloring are:

  • int num_types;
  • lid_t num_local_edges[MAX_TYPES];
  • lid_t* degree_list[MAX_TYPES];
  • lid_t* edge_list[MAX_TYPES];

Note, the EnGPar multi-graph/Ngraph supports multiple edge types. Assume for now that we will be coloring with consideration for only one edge type at a time. I.e., when the user asks for the graph to be colored they must indicate which edge type to use.

Simple hypergraph example

Example use of publicize

The following example implements a pull-based breadth first search using the CSR arrays. This supports both hypergraphs and regular graphs:

https://github.com/SCOREC/EnGPar/blob/2e79c74902f493adf1657e0e8eceed4cd585cc75/partition/Diffusive/src/engpar_queue.cpp#L200

Kokkos view creation example

Here is some exploratory work to run a breadth first search using kokkos on the CSR - the code that creates the views may be helpful:

https://github.com/SCOREC/EnGPar/blob/1f3ddee7a1562a01a0257149f2140f1ec8dbd67e/test/kokkosBfs.cpp

  • Note, I have not tested this in many moons - based on the comments it looks like it did something :)

Clone this wiki locally