Code Monkey home page Code Monkey logo

gbtl's Introduction

GraphBLAS Template Library (GBTL), v. 3.0

Project Goals

  • Complete, mathematically equivalent implementation of the GraphBLAS C API Specification (current specification http://graphblas.org).
  • Use of modern, idiomatic C++ for the implementation and provide a testing ground for the GraphBLAS C++ API Specification development.
  • Graph algorithm library containing examples of commonly used graph algorithms implemented with the GraphBLAS primitive operations.

This is Version 3.0 of the C++ implementation and is mathematically equivalent to Version 1.3 of the GraphBLAS C API. The API defined by this (v. 3.0) release is not backward compatible with GBTL v. 2.0. See the ChangeLog file for details.

The project also contains example implementations of many common graph algorithms using the C++ API:

  • Breadth-first traversal (aka BFS)
    • level BFS
    • parent list BFS
    • batched BFS
  • Single-source shortest path (SSSP)
    • Bellman-Ford
    • Filtered Bellman-Ford
    • Delta stepping
  • All-pairs shortest path (APSP)
  • Centrality measures
    • Vertex Betweenness Centrality (batch variant too)
    • Edge Betweenness Centrality
    • Closeness centrality
  • Clustering
    • peer pressure clustering
    • Markov clustering
    • Louvain
  • Triangle counting (many variants)
  • K-truss enumeration
    • incidence matrix variant
    • adjacency matrix variant
  • PageRank
  • Maximal Independent Set (MIS)
  • Minimum Spanning Tree (MST)
  • Maxflow
    • Ford-Fulkerson
  • Metrics
    • degree, in and out
    • graph distance
    • radius, diameter
    • vertex eccentricity

Work is underway to port some of the algorithms in LAGraph repository to GBTL.

Backend Implementations (Platforms)

The file structure and build system support defining multiple different 'backend' implementations (platforms), but only one of these can be configured and compiled at a time. However, if multiple different build directories are used (extending what is shown below), then each can configured for a different platform. The code for each platform can be found in an appropriately named subdirectory of src/graphblas/platforms.

  1. 'sequential' platform: this platform is written for a single CPU. It is intended as a reference implementation focusing on correctness, but contains some modest (significant in some cases) performance improvements over previous releases.

  2. 'optimized_sequential' platform: this is an experimental platform that is currently under development and is exploring more comprehensive performance improvements (currently only for the mxm operation).

Support for GPUs that was in version 1.0 is currently not available but can be accessed using the git tag: '1.0.0').

Building

Prerequisites

  1. Cmake is required to build the set of makefiles. It has been successfully built with cmake 3.10.2.

  2. A detailed study of which C++ compilers are required has not been carried out. The cmake configuration file is currently setup to require C++17 support. The test and demo programs have been successfully built using the GNU g++ compiler version 9.2.1 with the -std=gnu++1z option.

  3. Building the unit tests also requires the "Boost Test Library: The Unit Test Framework."

Compilation

This project is designed to use cmake to build and use an "out of source" style build to make it easy to clean up. The tests and demos can be built in to a "build" directory in the top-level directory by following these steps:

$ mkdir build
$ cd build
$ cmake [-DPLATFORM=<platform name>] [-DCMAKE_BUILD_TYPE={Release,Debug}] ../src
$ make

The optional PLATFORM argument to cmake specifies which platform-specific source code (also referred to as the backend) should be configured for the build and the value must correspond to a subdirectory in "gbtl/src/graphblas/platforms/" and that subdirectory must have a "backend_include.hpp" file. If this argument is omitted it defaults to configuring the "sequential" platform. The other platform currently available is "optimized_sequential" which is currently under development to improve the performance of various operations.

The optional CMAKE_BUILD_TYPE argument to cmake can be used to build debug or release (using -O3 compiler option) versions of the library. The default is Debug.

The compiler used to build the library can be changed by specifying -DCXX=<pathname_to_compiler> on the cmake commandline as well.

Once cmake is done building the Makefiles, options to make can be used. For example, using "make -i -j8" tries to build every test (ignoring all errors) and uses 8 threads to speed up the build (use a number appropriate for the number of cores/hyperthreads on your system).

There is a convenience script to do all of this from scratch called rebuild.sh that also removes all the old content from a previous build.

For CLion support in the cmake project settings "Build, Execution, Deployment > CMake > Generation path:" set it to "../build" to use the same makefiles as that created by the clean build process so that there aren't two different build trees.

Installation

The current library is set up as a header only library. To install this library, copy the graphblas directory, its subdirectories and the specific platform subdirectory (sans the platform's test directories) to a location in your include path.

Documentation

Documentation can be generated using the Doxygen documentation system. To generate documentation run doxygen from the src directory:

$ cd src
$ doxygen

All documentation is built in the 'docs' subdirectory.

Acknowledgments and Disclaimers

GraphBLAS Template Library (GBTL), Version 3.0 includes and/or can make use of certain third party software ("Third Party Software"). The Third Party Software that is used by GraphBLAS Template Library (GBTL), Version 3.0 is dependent upon your system configuration, but typically includes the software identified below. By using GraphBLAS Template Library (GBTL), Version 3.0, You agree to comply with any and all relevant Third Party Software terms and conditions contained in any such Third Party Software or separate license file distributed with such Third Party Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party beneficiaries to this License with respect to the terms applicable to their Third Party Software. Third Party Software licenses only apply to the Third Party Software and not any other portion of GraphBLAS Template Library (GBTL), Version 3.0 or GraphBLAS Template Library (GBTL), Version 3.0 as a whole.

This material is based upon work funded and supported by the United States Department of Defense under Contract No. FA8702-15-D-0002 with Carnegie Mellon University for the operation of the Software Engineering Institute, a federally funded research and development center and by the United States Department of Energy under Contract DE-AC05-76RL01830 with Battelle Memorial Institute for the Operation of the Pacific Northwest National Laboratory.

THIS MATERIAL WAS PREPARED AS AN ACCOUNT OF WORK SPONSORED BY AN AGENCY OF THE UNITED STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR THE UNITED STATES DEPARTMENT OF DEFENSE, NOR CARNEGIE MELLON UNIVERSITY, NOR BATTELLE, NOR ANY OF THEIR EMPLOYEES, NOR ANY JURISDICTION OR ORGANIZATION THAT HAS COOPERATED IN THE DEVELOPMENT OF THESE MATERIALS, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OR ANY INFORMATION, APPARATUS, PRODUCT, SOFTWARE, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.

Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Carnegie Mellon University, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

Please see “AUTHORS” file for a list of known contributors.

[DISTRIBUTION STATEMENT A] This material has been approved for public release and unlimited distribution. Please see Copyright notice for non-US Government use and distribution.

This release is an update of:

  1. GraphBLAS Template Library (GBTL) (https://github.com/cmu-sei/gbtl/blob/1.0.0/LICENSE) Copyright 2015 Carnegie Mellon University and The Trustees of Indiana. DM17-0037, DM-0002659

  2. GraphBLAS Template Library (GBTL) (https://github.com/cmu-sei/gbtl/blob/2.0.0/LICENSE) Copyright 2018 Carnegie Mellon University, Battelle Memorial Institute, and Authors. DM18-0559

DM20-0442

gbtl's People

Contributors

marcinz avatar mcmillan03 avatar paldar avatar sei-amellinger avatar sei-jlarkin avatar sei-smcmillan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gbtl's Issues

support for negation

At the current stage, we cannot support the negate operation without materializing the negated matrix in the cusp backend.

Need to discuss how to implement a negation mask on the GPU (searches through a COO matrix?), which probably will involve making our own matrix implementation at some point.

new API naming convention (from gitlab)

After the GraphBLAS API call of 2 October we have new more explicit C++ naming standards:
The namespace: GraphBLAS API operations: will be 'camelCase' except for matrix multiplies as follows: buildMatrix, mXm, extractTuples
In addition an mxm_demo.cpp must be written (adapt mxm_test.cpp) and use the specific values from the homework assignment.
This will need to committed to the API bitbucket repo.

bfs-do is slow

There are numerous performance issues that need to be addressed when time allows.

Errors running tests after building

I am running into problems running tests for the GPU implementation of GBTL. I am thinking the issue is with the cusplibrary version I'm using not matching up with the cusplibrary you used. Could you let me know which version you used?

My system environment is:

CUDA: 10.0
nvcc: 10.0
GBTL: 1.0.0 branch
cusplibrary: develop branch (commit dc77579)

I built using make and ran the tests using run_tests.sh on two GPUs (Tesla V and K40c). The output for both looks like:

*** No errors detected
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
./run_tests.sh: line 1: 30328 Aborted                 (core dumped) ./$test

*** No errors detected
terminate called after throwing an instance of 'thrust::system::system_error'
  what():  device free failed: an illegal memory access was encountered
terminate called recursively

*** 2 failures detected in test suite "mst_suite"

*** No errors detected

*** 16 failures detected in test suite "bfs_suite"

*** No errors detected

*** No errors detected

*** 12 failures detected in test suite "sssp_suite"

*** No errors detected

*** No errors detected

*** No errors detected

*** 2 failures detected in test suite "maxflow_suite"

*** No errors detected

*** No errors detected

*** No errors detected

Full error log: https://gist.github.com/ctcyang/09cffca92d64bd3c9bc63300c9122f5f

masked mxm support

need to support masked mxm either natively or adding a stage of post-processing.

solved in PR #35

supporting a pseudo-zero construct on cusp

cuspbackend::matrix constructor is slightly different from that of sequential::matrix (and frontend::matrix, for that matter) in terms of how zeroes are treated. need to fix this.

however, if the only time a structural zero is used is at negation, and negate needs to take a semiring to get its ones and zeroes, there is really no point in storing a separate zero at the matrix level, eh?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.