AmgXWrapper

AmgXWrapper: An interface between PETSc and the NVIDIA AmgX library - Published in JOSS (2017)

https://github.com/barbagroup/amgxwrapper

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 15 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    4 of 9 committers (44.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

amgx gpu mpi nvidia petsc

Keywords from Contributors

computational-fluid-dynamics immersed-boundary-method nvidia-amgx bayesian-inference materials-science
Last synced: 4 months ago · JSON representation

Repository

AmgXWrapper: An interface between PETSc and the NVIDIA AmgX library

Basic Info
  • Host: GitHub
  • Owner: barbagroup
  • License: mit
  • Language: C++
  • Default Branch: master
  • Homepage:
  • Size: 346 KB
Statistics
  • Stars: 47
  • Watchers: 9
  • Forks: 23
  • Open Issues: 11
  • Releases: 11
Topics
amgx gpu mpi nvidia petsc
Created about 10 years ago · Last pushed over 3 years ago
Metadata Files
Readme Contributing License Codemeta

README.md

AmgXWrapper

DOI badge

AmgXWrapper simplifies the usage of AmgX when using AmgX together with PETSc. A unique feature is that when the number of MPI processes is greater than the number of GPU devices, this wrapper will do the system consolidation/data scattering/data gathering automatically. So there's always only one MPI process using each GPU and no resource competition. Though we currently only support PETSc, we hope this wrapper can work with other libraries in the future.

The usage is simple. Just follow the procedure: initialize -> set matrix A -> solve -> finalize.

For example,

```c++ int main(int argc, char **argv) { // initialize matrix A, RHS, etc using PETSc ...

// create an instance of the solver wrapper
AmgXSolver    solver;
// initialize the instance with communicator, executation mode, and config file
solver.initialize(comm, mode, file);    
// set matrix A. Currently it only accept PETSc AIJ matrix
solver.setA(A);    
// solve. x and rhs are PETSc vectors. unkns will be the final result in the end
solver.solve(unks, rhs);    
// get number of iterations
int         iters;
solver.getIters(iters);    
// get residual at the last iteration
double      res;
solver.getResidual(iters, res);    
// finalization
solver.finalize();

// other codes
....

return 0;

} ```

Note, this wrapper was originally designed for our CFD solver -- PetIBM, so it may lack some features for other kinds of PETSc-based applications. We are trying to make it more general.

Document

  1. Dependencies
  2. Build and install
  3. Usage
  4. Test
  5. Examples

Feature: system consolidation when the number of MPI processes is greater than number of GPUs

If a user ever tries to use AmgX directly without this wrapper, and when multiple MPI processes are sharing a GPU device, AmgX does not deliver a satisfying performance. One feature of this wrapper is to resolve this problem.

Our solution is always to allow only one MPI process to call AmgX on each GPU. In other words, only certain MPI processes can talk to GPUs when the number of MPI processes is greater than the number of GPUs. The wrapper will consolidate matrix. Data on other processes will be gathered to the processes that can talk to AmgX before solving, and then scattered back afterward.

For example, if there are 18 MPI processes and 6 GPUs (12 MPI processes and 2 GPUs on node 1, and 6 MPI processes and 4 GPUs on node 2), only the rank 0, 6, 12, 14, 16, 17 can talk to GPUs and will call AmgX solvers. Data on rank 1-5 will be gathered to rank 0; data on rank 7-11 will go to rank 6; data on rank 13 and 15 go to rank 12 and 14, respectively; and both rank 16 and 17 enjoy a single GPU by itself. This causes some penalties on computing time because of communications between processes. However, the overall performance is much better than calling AmgX solvers from all processes directly.

The redistribution method may be naive, but it's working. We are satisfied with the performance so far.

Limitation

  • CPU version of AmgX solver (i.e., hDDI mode in AmgX or AmgX_CPU option in our Poisson example) is not supported in this wrapper. Using PETSc's (or third-party's, like Hypre) solvers and preconditioners may be a better choice for CPU capability.
  • Due to our PETSc applications only use AIJ format for sparse matrices, AmgXWrapper currently only supports AIJ format.

Future work

  • Add support of updating entry values of a matrix that is already on CUDA devices.
  • Support other matrix formats other than AIJ.
  • Add mechanisms for debugging and error handling.

Contributing

To contribute to AmgXWrapper, see CONTRIBUTING.

How to cite

To cite this code, please use the citation or the BibTeX entry below.

Pi-Yueh Chuang, & Lorena A. Barba (2017). AmgXWrapper: An interface between PETSc and the NVIDIA AmgX library. J. Open Source Software, 2(16):280, doi:10.21105/joss.00280

console @article{Chuang2017, doi = {10.21105/joss.00280}, url = {https://doi.org/10.21105/joss.00280}, year = {2017}, month = {aug}, publisher = {The Open Journal}, volume = {2}, number = {16}, author = {Pi-Yueh Chuang and Lorena A. Barba}, title = {{AmgXWrapper}: An interface between {PETSc} and the {NVIDIA} {AmgX} library}, journal = {The Journal of Open Source Software} }

Reference

[1] Chuang, Pi-Yueh; Barba, Lorena A. (2017): Using AmgX to Accelerate PETSc-Based CFD Codes. figshare. https://doi.org/10.6084/m9.figshare.5018774.v1

Owner

  • Name: Barba group
  • Login: barbagroup
  • Kind: organization
  • Location: Washington, DC

JOSS Publication

AmgXWrapper: An interface between PETSc and the NVIDIA AmgX library
Published
August 29, 2017
Volume 2, Issue 16, Page 280
Authors
Pi-Yueh Chuang ORCID
The George Washington University
Lorena A. Barba ORCID
The George Washington University
Editor
Daniel S. Katz ORCID
Tags
PETSc AmgX multigrid multi-GPU computing

CodeMeta (codemeta.json)

{
  "@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
  "@type": "Code",
  "author": [
    {
      "@id": "0000-0001-6330-2709",
      "@type": "Person",
      "email": "pychuang@gwu.edu",
      "name": "Pi-Yueh Chuang",
      "affiliation": "The George Washington University"
    },
    {
      "@id": "0000-0001-5812-2711",
      "@type": "Person",
      "email": "labarba@gwu.edu",
      "name": "Lorena A. Barba",
      "affiliation": "The George Washington University"
    }
  ],
  "identifier": "https://doi.org/10.6084/m9.figshare.5018774.v1",
  "codeRepository": "https://github.com/barbagroup/AmgXWrapper",
  "datePublished": "2017-06-02",
  "dateModified": "2017-06-02",
  "dateCreated": "2017-06-02",
  "description": "A wrapper for using AmgX in PETSc applications",
  "keywords": "PETSc, AmgX, multigrid, multi-GPU computing",
  "license": "MIT",
  "title": "AmgXWrapper",
  "version": ""
}

GitHub Events

Total
  • Watch event: 5
  • Fork event: 1
Last Year
  • Watch event: 5
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 122
  • Total Committers: 9
  • Avg Commits per committer: 13.556
  • Development Distribution Score (DDS): 0.082
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Pi-Yueh Chuang p****g@g****u 112
mesnardo m****o@g****u 2
Lorena A. Barba l****a@g****u 2
Matthew Martineau m****u@n****m 1
Markus Hrywniak m****k@n****m 1
Jed Brown j****d@j****g 1
Gil Forsyth g****h 1
Arfon Smith a****n 1
Pi-Yueh Chuang p****g@l****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 25
  • Total pull requests: 17
  • Average time to close issues: 6 months
  • Average time to close pull requests: 5 days
  • Total issue authors: 11
  • Total pull request authors: 6
  • Average comments per issue: 3.36
  • Average comments per pull request: 0.65
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jedbrown (8)
  • piyueh (6)
  • pledac (2)
  • hanfluid (2)
  • xdquan (1)
  • skakarla1982 (1)
  • Dcn303 (1)
  • jkelling (1)
  • srinivas1982 (1)
  • mateuslattari (1)
  • aminamooie (1)
Pull Request Authors
  • piyueh (12)
  • mattmartineau (1)
  • arfon (1)
  • mesnardo (1)
  • jedbrown (1)
  • mhrywniak (1)
Top Labels
Issue Labels
bug (3)
Pull Request Labels
enhancement (1)