|
Astaroth
3.1
Scalable Multi-GPU Stencil Computations
|
Docs | API specification | Astaroth DSL | Contributing | Licence | Repository | Issue Tracker | Wiki
Astaroth is a multi-GPU library designed for high-order stencil computations with a special focus on the requirements of multiphysics applications on modern HPC systems. It provides a multi-GPU and single-GPU APIs, a domain-specific language for expressing stencil codes in a high-level syntax, and an optimizing compiler that translates DSL sources into CUDA/HIP subroutines that exhibit near handtuned performance.
Astaroth is licenced under the terms of the GNU General Public Licence, version 3, or later (see LICENCE.txt). For contributing guidelines, see Contributing.
Astaroth is tested against its test suite after every commit. You can find the success of the latest test suite here. You can the test suite yourself locally by first sourcing Astaroth with . ./sourceme.sh and then ./test/run_all_tests.sh. To run the tests on CPUs pass the flag --cpu to ./test/run_all_tests.sh.
Note: Some tests in the full auto-test require pandas to be loaded (to check the correctness of the timeseries data) and expect to be used with OpenMPI due to using –oversubscribe flag. This is to be improved but on MPICH you can search and replace to get rid of the –oversubscribe flag (at the moment we are looking into the best way to support both OpenMPI and MPICH).
Or
Relative recent versions of
gcc cmake flex bison
and either nvcc (NVIDIA) or hipcc (AMD). The library is built for NVIDIA by default, but AMD support can be enabled by passing -DUSE_HIP=ON to CMake.
master is a tested, stable branch. We recommend to use this branch in production
develop is the main development branch.
In the base directory, run
or
To install Astaroth in order to use it from other projects run
And link to it using the following CMake code
Optional: Documentation can be generated by running doxygen in the base directory. Generated documentation can be found in doc/doxygen. Documentation automatically generated after every commit can be found also from here.
Tip: The library is configured by passing options to CMake with -D[option]=[ON|OFF]. For example, double precision can be enabled by calling cmake -DBUILD_DOUBLE_PRECISION=ON ... See CMakeLists.txt for an up-to-date list of options.
Note: CMake will inform you if there are missing dependencies.
If you need a functioning and documented example of how to run Astaroth in standalone more out of the box,
please see this shock turbulence run example in the directory config/samples/shockturb/. Or for a simpler setup see the hello world setup in samples/advection-example.
Note: Assign one task per GPU when using MPI.
Tip: For more information on running the code on Puhti, see Puhti docs.
Getting the modules and slurm commands right can be tricky because they vary system by system. See a list of systems and commands that have been tested to work below.
| Option | Description | Default |
|---|---|---|
| 2D | Compile Astaroth for 2D simulation | OFF |
| BUILD_ACM | Whether to build to the Astaroth Communication Module (ACM). | OFF |
| BUILD_ADVECTION_EXAMPLE | Builds hello world example | OFF |
| BUILD_MHD_SAMPLES | Builds MHD samples. Has no effect if BUILD_SAMPLES=OFF. | ON |
| BUILD_MLLIB_SAMPLES | Builds samples that use cuDNN or MIOpen | OFF |
| BUILD_SAMPLES | Builds projects in samples subdirectory. | ON |
| BUILD_SHARED_LIBS | Build Astaroth as a collection of shared libraries instead of statically built modules | OFF |
| BUILD_STANDALONE | Build the standalone_mpi executable to run standard simulation. | ON |
| BUILD_TESTS | Builds tests in test subdirectory. Make sure to set DSL_MODULE_DIR and DSL_MODULE_FILE accordingly and build only a specific test taget. | OFF |
| BUILD_UTILS | Builds the utility library | ON |
| CPU_BUILD | To build CPU-only build | OFF |
| DEBUG_SYNC | Whether to sync after all tasks in default ops | OFF |
| DOUBLE_PRECISION | Generates double precision code. | ON |
| FFT_ENABLED | Whether to enable FFT | OFF |
| INCLUDE_3RD_PARTIES | Whether to include 3rd party dependencies | OFF |
| LAGRANGIAN_GRID | Use Lagrangian grid instead of Eulerian | OFF |
| MPI_ENABLED | Enables additional functions for MPI communciation. | OFF |
| MULTIGPU_ENABLED | Enables multi-GPU on a single node. Uses peer-to-peer communication instead of MPI. Affects Legacy & Node layers only. | ON |
| PACKED_DATA_TRANSFERS | Enables kernel for packed data transfers | OFF |
| PROFILING_ENABLED | Whether to enable profiling and link to the vendor profiling libraries | ON |
| RUNTIME_COMPILATION | Compile version of Astaroth compiled at runtime | OFF |
| SINGLEPASS_INTEGRATION | Perform integration in a single pass. Improves performance by ~20% but may introduce slightly larger floating-point arithmetic error than the conventional approach | OFF |
| SUPPORT_MAJOR_ARCHITECTURES | Compile for all major CUDA architectures supported by the used CUDA SDK | ON |
| SUPPRESS_COMPILER_WARNINGS | Suppress default compiler warnings of Astaroth | OFF |
| USE_DISTRIBUTED_IO | Use distributed IO (one file per process) instead of collective | ON |
| USE_HIP | Use HIP as the underlying GPGPU library instead of CUDA | OFF |
| USE_PERFSTUBS | Build with perfstubs | OFF |
| USE_POSIX_IO | Uses POSIX I/O less error prone, but increased overheads. | ON |
| USE_VENDORED_PERFSTUBS | Use the vendored perfstubs in 3rd_party/perfstubs | ON |
| VERBOSE | Enables various status and warning messages | OFF |
See analysis/python/ directory of existing data visualization and analysis scripts.
See also config parameter AC_num_snapshots for more control over how many snapshots are written out.
When you use Astaroth please cite the following papers as appropriate:
JOSS paper, General usage of the code:
Communication optimizations: CUDA-aware MPI, Hierarchical decomposition and kernel fusion, Taskgraph system for overlapping communication and computation.
GPU kernels optimizations for stencil computations.
Can I use the code even if I don't make my changes public?
GPL requires only that if you release a binary based on Astaroth to the public, then you should also release the source code for it. In private you can do whatever you want (secret forks, secret collaborations, etc). Astaroth Code source files (.ac, .h) do not belong to the library and therefore are not licenced under GPL. The user who created the files holds copyright over them and can choose to distribute them under any licence.
How do I compile with MPI support?
Ensure that your MPI implementation has been built with CUDA support and invoke CMake with cmake -DMPI_ENABLED=ON -DBUILD_SAMPLES=ON ... Otherwise the build steps are the same. Assign exactly one process per GPU and run with, for example, srun --gres=gpu:v100:<ngpus per node> --ntasks-per-socket=<ngpus per node / NICs per node> -n <total number of gpus> -N <number of nodes> ./mpitest or for mpirun the command mpirun -np <ngpus per node> ./mpitest works (at least on a GPU node).
I have issues with MPI
If your MPI has been setup incorrectly or does not support CUDA-aware communication, you can try running Astaroth without RDMA support with AC_use_cuda_aware_mpi=F in your config file. Note that without CUDA-aware support, communication is routed through CPU memory which gives notably worse performance than communicating directly between GPUs.
I have issues with IBM Power PCs
This may be due to utils library requiring vectorization. You can try replacing -mavx with -maltivec or -mcpu=native in src/utils/CMakeLists.txt. Otherwise, the core library does not use vectorization, so using Astaroth without the utils component should be possible.
How do I contribute?
See Contributing.
Reporting issues and seeking help
This section is to be expanded, but for reporting issues and for seeking help you can make issues on the github mirror of Astaroth. Optionally, you can always contact one of the main developers: touko.nosp@m..pur.nosp@m.o@aal.nosp@m.to.f.nosp@m.i. For issues and bug reports, please describe them in enough detail for them to be reproducible, and best if you have clear description on how to invoke the problem. Sharing the commands of how did you build and run the program are very much appreciated. For seeking help on syntax, APIs, etc. please first check does the documentation already answer your problem.