Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
[skip ci] README updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
neoblizz committed Jul 27, 2022
1 parent 60b45b9 commit 4ac6c6d
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Essentials: CUDA/C++ GPU Graph Analytics
[![Ubuntu](https://github.com/gunrock/essentials/actions/workflows/ubuntu.yml/badge.svg)](https://github.com/gunrock/essentials/actions/workflows/ubuntu.yml) [![Windows](https://github.com/gunrock/essentials/actions/workflows/windows.yml/badge.svg)](https://github.com/gunrock/essentials/actions/workflows/windows.yml) [![Code Quality](https://github.com/gunrock/essentials/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/gunrock/essentials/actions/workflows/codeql-analysis.yml) [![Ubuntu: Testing](https://github.com/gunrock/essentials/actions/workflows/ubuntu-tests.yml/badge.svg)](https://github.com/gunrock/essentials/actions/workflows/ubuntu-tests.yml)

| [**Examples**](https://github.com/gunrock/essentials/tree/master/examples/algorithms) | [**Project Template**](https://github.com/gunrock/template) | [**Documentation**](https://github.com/gunrock/essentials/wiki) |
|--------------|----------------------|-------------------|
| [**Examples**](https://github.com/gunrock/essentials/tree/master/examples/algorithms) | [**Project Template**](https://github.com/gunrock/template) | [**Documentation**](https://github.com/gunrock/essentials/wiki) | [**GitHub Actions**](https://github.com/gunrock/essentials/actions) |
|--------------|----------------------|-------------------|-------------------|

**Gunrock/Essentials**[<sup>[1]</sup>](#footnotes) is a CUDA library for graph-processing designed specifically for the GPU. It uses a **high-level**, **bulk-synchronous/asynchronous**, **data-centric abstraction** focused on operations on vertex or edge frontiers. Gunrock achieves a balance between performance and expressiveness by coupling high-performance GPU computing primitives and optimization strategies, particularly in the area of fine-grained load balancing, with a high-level programming model that allows programmers to quickly develop new graph primitives that scale from one to many GPUs on a node with small code size and minimal GPU programming knowledge.

Expand All @@ -18,6 +18,54 @@ make sssp # or for all algorithms, use: make -j$(nproc)
bin/sssp ../datasets/chesapeake/chesapeake.mtx
```

## Implementing Graph Algorithms
For a detailed explanation, please see the full [documentation](https://github.com/gunrock/essentials/wiki/How-to-write-a-new-graph-algorithm). The following example shows simple APIs using Gunrock's data-centric, bulk-synchronous programming model, we implement Breadth-First Search on GPUs. This example skips the setup phase of creating a `problem_t` and `enactor_t` struct and jumps straight into the actual algorithm.

We first prepare our frontier with the initial source vertex to begin
push-based BFS traversal. A simple `f->push_back(source)` places
the initial vertex we will use for our first iteration.
```cpp
void prepare_frontier(frontier_t* f,
gcuda::multi_context_t& context) override {
auto P = this->get_problem();
f->push_back(P->param.single_source);
}
```
We then begin our iterative loop, which iterates until a convergence condition has been met. If no condition has been specified, the loop converges when the frontier is empty.
```cpp
void loop(gcuda::multi_context_t& context) override {
auto E = this->get_enactor(); // Pointer to enactor interface.
auto P = this->get_problem(); // Pointer to problem (data) interface.
auto G = P->get_graph(); // Graph that we are processing.
auto single_source = P->param.single_source; // Initial source node.
auto distances = P->result.distances; // Distances array for BFS.
auto visited = P->visited.data().get(); // Visited map.
auto iteration = this->iteration; // Iteration we are on.
// Following lambda expression is applied on every source,
// neighbor, edge, weight tuple during the traversal.
// Our intent here is to find and update the minimum distance when found.
// And return which neighbor goes in the output frontier after traversal.
auto search = [=] __host__ __device__(
vertex_t const& source, // ... source
vertex_t const& neighbor, // neighbor
edge_t const& edge, // edge
weight_t const& weight // weight (tuple).
) -> bool {
auto old_distance =
math::atomic::min(&distances[neighbor], iteration + 1);
return (iteration + 1 < old_distance);
};
// Execute advance operator on the search lambda expression.
// Uses load_balance_t::block_mapped algorithm (try others for perf. tuning.)
operators::advance::execute<operators::load_balance_t::block_mapped>(
G, E, search, context);
}
```
[include/gunrock/algorithms/bfs.hxx](include/gunrock/algorithms/bfs.hxx)

## How to Cite Gunrock & Essentials
Thank you for citing our work.

Expand Down Expand Up @@ -58,11 +106,11 @@ Thank you for citing our work.
}
```

## Copyright and License
## Copyright & License

Gunrock is copyright The Regents of the University of California. The library, examples, and all source code are released under [Apache 2.0](https://github.com/gunrock/essentials/blob/master/LICENSE).

<a class="anchor" id="1"></a>
## Footnotes
1. Essentials is intended as a future release of [Gunrock](https://github.com/gunrock/gunrock). You can read more about in our vision paper: [Essentials of Parallel Graph Analytics](https://escholarship.org/content/qt2p19z28q/qt2p19z28q_noSplash_38a658bccc817ba025517311a776840f.pdf).
2. Preferred **CUDA v11.5.1 or higher** due to support for stream ordered memory allocators.
1. Essentials is intended as a future release of [Gunrock](https://github.com/gunrock/gunrock).
- You can read more about it in our vision paper: [Essentials of Parallel Graph Analytics](https://escholarship.org/content/qt2p19z28q/qt2p19z28q_noSplash_38a658bccc817ba025517311a776840f.pdf).
2. Recommended **CUDA v11.5.1 or higher** due to support for stream ordered memory allocators.

0 comments on commit 4ac6c6d

Please sign in to comment.