Git Product home page Git Product logo

apsp's Introduction

This package is out of maintenance. I changed the name to https://github.com/mnakao/ODP and am developing it.

Description

  • This software is to solve APSP (All Pairs Shortest Paths) problem for a noweight graph.
  • It outputs a diameter and ASPL (Average Shortest Path Length) of the graph.
  • This software may be useful for Graph Golf Competition.
  • The performance is referred to [1].

Algorithms

  • Matrix operation (Default)
  • BFS (with -B option)
    • BFS itself is a classical top-down method.
    • It repeats BFS as many as the number of vertices.
    • In MPI versions, Each BFS uses a BFS with 1D Partitioning [2].
      • Two stages of MPI parallel are performed.
      • The 1st stage MPI executes multiple BFSs simultaneously.
      • The 2nd stage MPI executes a single BFS in parallel.

Usage

This software provides the following versions.

  • apsp : Serial version
  • apsp_openmp : OpenMP version
  • apsp_mpi : MPI version
  • apsp_mpi_openmp : MPI/OpenMP version
  • apsp_cuda : CUDA version
  • apsp_mpi_cuda : MPI/CUDA version

Compilation for Serial version

$ make

Compilation for OpenMP version

$ make openmp

Compilation for MPI version

$ make mpi

Compilation for MPI/OpenMP version

$ make mpi_openmp

Compilation for CUDA version

$ make cuda

Compilation for MPI/CUDA version

$ make mpi_cuda

Examples of execution

$ ./apsp -f <graph file>
$ OMP_NUM_THREADS=8 ./apsp_openmp -f <graph file>
$ mpirun -np 4 ./apsp_mpi -f <graph file>
$ OMP_NUM_THREADS=8 mpirun -np 4 ./apsp_mpi_openmp -f <graph file>

Option

  • -g : Indicate the number of groups for Graph Symmetry [3].

  • -n : Execute APSP as many times as a specified value.

  • -d : Number pf degrees

  • -B : Usage BFS instead of bit operation

  • -S : Memory saving mode of Matrix operation

  • -P : Enable profile

  • -E : Enable extended profile (Only MPI versions)

  • -p : Indicates the number of processes in each BFS. This value must be a divisor of the number of all processes. (Only MPI and MPI/OpenMP versions)

     $ mpirun -np 32 ./apsp_mpi -f <graph file> -p 4
     
     In the above case, the 1st stage MPI uses 8 processes and the 2nd stage MPI uses 4 processes.
    

NOTE

  • Sample input graph files are in "./data."
  • Sample execution scripts are in "./script."
  • If you encount some errors when dealing with a large graph using the OpenMP versions, please set a large value for the environment variable OMP_STACKSIZE.

Reference

  • [1] Masahiro Nakao, et al. ``Parallelization of All-Pairs-Shortest-Path Algorithms in Unweighted Graphs'', HPC Asia 2020, Fukuoka, Japan, Jan. 2020.
  • [2] Aydın Bulu, et al. ``Parallel Breadth-First Search on Distributed Memory Systems'', SC '11 Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis, Article No. 65
  • [3] Masahiro Nakao, et al. ``A Method for Order/Degree Problem Based on Graph Symmetry and Simulated Annealing with MPI/OpenMP Parallelization'', HPC Asia 2019, Guangzhou, China, Jan. 2019.

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.