Example programs#
|
Reference API
|
Here you can find example programs that demonstrate the usage of Ginkgo. Some examples are built on one another and some are stand-alone and demonstrate a concept of Ginkgo, which can be used in your own code.
You can browse the available example programs
- as a graph that shows how example programs build upon each other.
- as a list that provides a short synopsis of each program.
- or grouped by topic.
By default, all Ginkgo examples are built using CMake.
An example for building the examples and using Ginkgo as an external library without CMake can be found in the script provided for each example, which should be called with the form: ./build.sh PATH_TO_GINKGO_BUILD_DIR
By default, Ginkgo is compiled with at least -DGINKGO_BUILD_REFERENCE=ON. Ginkgo also tries to detect your environment setup (presence of CUDA, ...) to enable the relevant accelerator modules. If you want to target a specific GPU, make sure that Ginkgo is compiled with the accelerator specific module enabled, such as:
-
-DGINKGO_BUILD_CUDA=ONoption for NVIDIA GPUs. -
-DGINKGO_BUILD_HIP=ONoption for AMD or NVIDIA GPUs. -
-DGINKGO_BUILD_SYCL=ONoption for Intel GPUs (and possibly any other platform).
Connections between example programs
The following graph shows the connections between example programs and how they build on each other. Click on any of the boxes to go to one of the programs. If you hover your mouse pointer over a box, a brief description of the program should appear.
Legend:
Example programs
| The simple-solver program | A minimal CG solver in Ginkgo, which reads a matrix from a file. |
| The minimal-cuda-solver program | A minimal solver on the CUDA executor than can be run on NVIDIA GPU's. |
| The poisson-solver program | Solve an actual physically relevant problem, the poisson problem. The matrix is generated within Ginkgo. |
| The preconditioned-solver program | Using a Jacobi preconditioner to solve a linear system. |
| The ilu-preconditioned-solver program | Using an ILU preconditioner to solve a linear system. |
| The performance-debugging program | Using Loggers to debug the performance within Ginkgo. |
| The three-pt-stencil-solver program | Using a three point stencil to solve the poisson equation with array views. |
| The nine-pt-stencil-solver program | Using a nine point 2D stencil to solve the poisson equation with array views. |
| The external-lib-interfacing program | Using Ginkgo's solver with the external library deal.II. |
| The custom-logger program | Creating a custom logger specifically for comparing the recurrent and the real residual norms. |
| The custom-matrix-format program | Creating a matrix-free stencil solver by using Ginkgo's advanced methods to build your own custom matrix format. |
| The inverse-iteration program | Using Ginkgo to compute eigenvalues of a matrix with the inverse iteration method. |
| The simple-solver-logging program | Using the logging functionality in Ginkgo to get solver and other information to diagnose and debug your code. |
| The papi-logging program | Using the PAPI logging library in Ginkgo to get advanced information about your code and its behaviour. |
| The ginkgo-overhead program | Measuring the overhead of the Ginkgo library. |
| The custom-stopping-criterion program | Creating a custom stopping criterion for the iterative solution process. |
| The ginkgo-ranges program | Using the ranges concept to factorize a matrix with the LU factorization. |
| The mixed-spmv program | Shows the Ginkgo mixed precision spmv functionality. |
| The mixed-precision-ir program | Manual implementation of a Mixed Precision Iterative Refinement (MPIR) solver. |
| The adaptiveprecision-blockjacobi program | Shows how to use the adaptive precision block-Jacobi preconditioner. |
| The cb-gmres program | Using the Ginkgo CB-GMRES solver (Compressed Basis GMRES). |
| The heat-equation program | Solving a 2D heat equation and showing matrix assembly, vector initialization and solver setup in a more complex setting with output visualization. |
| The iterative-refinement program | Using a low accuracy CG solver as an inner solver to an iterative refinement (IR) method which solves a linear system. |
| The ir-ilu-preconditioned-solver program | Combining iterative refinement with the adaptive precision block-Jacobi preconditioner to approximate triangular systems occurring in ILU preconditioning. |
| The par-ilu-convergence program | Convergence analysis at the examples of parallel incomplete factorization solver. |
| The preconditioner-export program | Explicit generation and storage of preconditioners for given matrices. |
| The multigrid-preconditioned-solver program | Use multigrid as preconditioner to a solver. |
| The mixed-multigrid-solver program | Use multigrid with different precision multigrid_level as a solver. |
| The distributed-solver program | Use a distributed solver to solve a 1D Laplace equation. |
| The distributed-multigrid-preconditioned-solver program | Use a distributed solver to solve a 1D Laplace equation. |
| The batched-solver program | Using and interfacing with a batched solver. |
| The kokkos-assembly program | Use Kokkos to assemble a simple linear system. |
| The mixed-multigrid-preconditioned-solver program | Use mixed-precision multigrid preconditioner. |
| The multigrid-preconditioned-solver-customized program | Use a customized multigrid preconditioner. |
| The reordered-preconditioned-solver program | Use reordering to solve a linear system. |
| The schroedinger-splitting program | Use the FFT and iFFT implementations to solve Schrödinger's equation. |
| The file-config-solver program | Use a solver from a config file in Ginkgo to solve a linear system. |
Example programs grouped by topics
Basic techniques
Advanced techniques
| Using Ginkgo with external libraries | |
| Customizing Ginkgo | The custom-logger program, The custom-stopping-criterion program, The custom-matrix-format program |
| Writing your own matrix format | |
| Using Ginkgo to construct more complex linear algebra routines | |
| Logging within Ginkgo | The simple-solver-logging program, The papi-logging program, The performance-debugging program The custom-logger program |
| Constructing your own stopping criterion | |
| Using ranges in Ginkgo | |
| Mixed precision | The mixed-spmv program, The mixed-precision-ir program, The adaptiveprecision-blockjacobi program The mixed-multigrid-solver program |
| Multigrid | The multigrid-preconditioned-solver program The mixed-multigrid-solver program |
| Configure a solver from a config file | |
| Distributed | The distributed-solver program The distributed-multigrid-preconditioned-solver program |
Generated by