An Adaptive Pencil Decomposition Library for NVIDIA GPUs
cuDecomp is a library for managing 1D (slab) and 2D (pencil) parallel decompositions of 3D Cartesian spatial domains on NVIDIA GPUs, with routines to perform global transpositions and halo communications. The library is inspired by the 2DECOMP&FFT Fortran library, a popular decomposition library for numerical simulation codes, with a similar set of available transposition routines. While 2DECOMP&FFT and similar libraries in the past have been written to target CPU systems, this library is designed for GPU systems, leveraging CUDA-aware MPI and additional communication libraries optimized for GPUs, like the NVIDIA Collective Communication Library (NCCL) and NVIDIA OpenSHMEM Library (NVSHMEM).
Please refer to the documentation for additional information on the library and usage details.
This library is currently in a research-oriented state, and has been released as a companion to a paper presented at the PASC22 conference (link). We are making it available here as it can be useful in other applications outside of this study or as a benchmarking tool and usage example for various GPU communication libraries to perform transpose and halo communication.
Please contact us or open a GitHub issue if you are interested in using this library in your own solvers and have questions on usage and/or feature requests.
You can build this library using CMake. A CMake build of the library without additional examples/tests can be completed using the following commands
$ mkdir build
$ cd build
$ cmake ..
$ make -jThere are several build variables available to configure the CMake build which can be found at the top of the project CMakeLists.txt file. As an example,
to configure the build to compile additional examples and enable NVSHMEM backends, you can run the following CMake command
$ cmake -DCUDECOMP_BUILD_EXTRAS=1 -DCUDECOMP_ENABLE_NVSHMEM=1 ..The NVHPC SDK remains the primary tested environment and provides all required
GPU dependencies, but the C++ library does not require the NVHPC C++ compiler.
GPU Fortran bindings require nvfortran. CMake 3.18 or newer is required.
When no C++ compiler or toolchain is selected explicitly, CMake prefers
nvc++ when it is available.
The CUDA Toolkit location is inferred from the selected NVIDIA CUDA compiler.
To select a specific CUDA installation, set CUDACXX or
CMAKE_CUDA_COMPILER when configuring a fresh build directory. When building
the Fortran bindings against an external CUDA Toolkit, also set
NVHPC_CUDA_HOME or NVCOMPILER_CUDA_HOME to an installation with the same
CUDA major and minor version.
CMake automatically searches system locations and paths exposed by the current
environment, including CPATH, LIBRARY_PATH, and LD_LIBRARY_PATH. If
dependencies cannot be found there, use CUDECOMP_CUTENSOR_HOME/CUTENSOR_ROOT,
CUDECOMP_NCCL_HOME/NCCL_ROOT, or CUDECOMP_NVSHMEM_HOME/NVSHMEM_ROOT. The
CUDECOMP_*_HOME setting takes precedence when both forms are provided.
One exception is cuDecomp builds using NVSHMEM versions older than v3.0, which require the use of a bootstrapping layer that depends on your MPI distribution. The NVSHMEM library packaged within NVHPC SDK supports OpenMPI only. If you require usage of a different MPI implementation (e.g. Spectrum MPI or Cray MPICH), you need to either build NVSHMEM against your desired MPI implementation, or build a custom MPI bootstrap layer separately. Please refer to this NVSHMEM documentation section for more details. For cuDecomp builds using NVSHMEM v3.0+, this additional MPI boostrapping layer is no longer required.
Additionally, this library utilizes CUDA-aware MPI and is only compatible with MPI libraries with these features enabled.
This library is released under an Apache 2.0 license, which can be found in LICENSE.