How hvdieren/graphgrind works
Purpose and execution model
GraphGrind is a NUMA-aware, shared-memory graph-processing framework derived from Ligra. It builds standalone native executables for graph algorithms; each executable reads a graph, runs a templated Compute(graph, start) workload repeatedly, and reports timing. Primary entry points are algorithm translation units such as BFS.C, BellmanFord.C, PageRank.C, Components.C, and BC.C.
Application layer
Algorithm files define per-algorithm state and frontier update functors, then invoke Ligra-style traversal primitives:
• Unweighted traversal/centrality: BFS.C, BC.C, Components.C
• Weighted shortest paths: BellmanFord.C
• Iterative ranking: PageRank.C, PageRankDelta.C
• Sparse matrix/vector-style graph computation: SPMV.C
• Partition/load-balancing benchmark or implementation: BP.C
These are independently compiled programs rather than modules behind a shared server or API.
Core graph representation and ingestion
The graph abstraction is centered in graph.h, with input parsing and graph construction provided by IO.h. Inputs support PBBS text adjacency graphs and a three-file binary CSR layout (.config, .idx, .adj), with optional weighted text input. Vertex-ID and offset widths are compile-time choices. Sample graph datasets are included as rMatGraph_J_5_100 and rMatGraph_WJ_5_100.
Traversal and frontier engine
ligra.h supplies the main programming model: vertexSubset frontiers plus edgeMap, vertexMap, and vertexFilter. edgeMap selects sparse or dense traversal based on active-frontier work and supports read-oriented dense and write-oriented dense-forward modes. Applications provide update, atomic update, and destination-condition callbacks; this is the central boundary between generic parallel traversal machinery and algorithm-specific semantics.
Grounding paths: ligra.h, graph.h, parallel.h.
NUMA-aware partitioning and memory placement
GraphGrind’s primary extension over Ligra is NUMA-conscious graph partitioning, allocation, and execution support. ligra-numa.h integrates NUMA-aware traversal/runtime behavior; partitioner.h defines partitioning responsibilities; graph-numa.h carries NUMA-specific graph representation or access support. Memory utilities in mm.h and reuse.h support allocation/reuse behavior relevant to high-throughput iterative processing.
Parallel runtime and hardware integration
Execution relies on a Clang/CilkPlus-compatible toolchain and extended Cilk runtime, using parallel loops and task execution through parallel.h. NUMA facilities are expected from the host/platform runtime. Optional performance-counter integration is represented by papi_code.h; timing support is in gettime.h. There is no network service dependency: computation is in-process over shared memory.
Driver, controls, and build boundary
Each executable obtains runtime options—graph format, symmetric-graph mode, source vertex, and timing rounds—through parseCommandLine.h and input code. Makefile is the build orchestration point that selects and compiles application targets. The bin directory is the expected output location for built artifacts, while root-level executable names may also be produced by the build environment.
Main entry points: ligra.h Ligra traversal API · Makefile Native build orchestration · ligra-numa.h NUMA traversal support · IO.h Graph input and construction
Components 18
Algorithm executables
Independently compiled graph workloads.
- BFS · Unweighted frontier traversal executable.
BFS.C - BC and Components · Centrality and connectivity frontier workloads.
BC.C - Bellman-Ford · Weighted shortest-path executable.
BellmanFord.C - PageRank workloads · Iterative ranking executables.
PageRank.C - SPMV and BP · Sparse computation and partitioning/load-balancing workloads.
SPMV.C
Graph processing core
Shared graph, traversal, and NUMA mechanisms.
- Ligra traversal API · vertexSubset frontiers and edgeMap, vertexMap, and vertexFilter.
ligra.h - Graph abstraction · Shared-memory graph structure with compile-time ID and offset widths.
graph.h - NUMA traversal support · NUMA-aware traversal and runtime integration.
ligra-numa.h - Graph partitioner · Defines NUMA graph partitioning responsibilities.
partitioner.h - NUMA graph access · NUMA-specific graph representation or access support.
graph-numa.h - Allocation and reuse · Memory placement, allocation, and iterative reuse utilities.
mm.h
Runtime and measurement
In-process parallel execution and optional instrumentation.
- Cilk parallel runtime · Parallel loops and task execution through CilkPlus-compatible support.
parallel.h - Timing and counters · Timing with optional PAPI performance counters.
gettime.h
Input and build
Graph ingestion, controls, and native build output.
- Runtime options · Selects graph format, symmetry, source vertex, and timing rounds.
parseCommandLine.h - Graph input and construction · Parses PBBS text, weighted text, and three-file binary CSR graphs.
IO.h - Sample graph datasets · Includes rMatGraph_J_5_100 and rMatGraph_WJ_5_100.
rMatGraph_J_5_100 - Native build orchestration · Selects and compiles algorithm targets.
Makefile - Built executables · Expected output directory for standalone executables.
bin
Connections 22
- BFS → Ligra traversal API: uses traversal primitives
- BC and Components → Ligra traversal API: uses traversal primitives
- Bellman-Ford → Ligra traversal API: uses traversal primitives
- PageRank workloads → Ligra traversal API: uses traversal primitives
- SPMV and BP → Ligra traversal API: uses traversal primitives
- Ligra traversal API → Graph abstraction: traverses
- Ligra traversal API → Cilk parallel runtime: parallelizes work
- NUMA traversal support → Ligra traversal API: extends
- NUMA traversal support → Graph partitioner: uses partitions
- NUMA traversal support → NUMA graph access: accesses
- Graph partitioner → Allocation and reuse: drives placement
- NUMA graph access → Graph abstraction: specializes
- Graph input and construction → Graph abstraction: constructs
- Sample graph datasets → Graph input and construction: input graphs
- Runtime options → Graph input and construction: selects format
- Timing and counters → Cilk parallel runtime: measures execution
- Native build orchestration → BFS: builds
- Native build orchestration → BC and Components: builds
- Native build orchestration → Bellman-Ford: builds
- Native build orchestration → PageRank workloads: builds
- Native build orchestration → SPMV and BP: builds
- Native build orchestration → Built executables: outputs