Previous Section - SPARTA WWW Site - SPARTA Documentation - SPARTA Commands - Next Section

4. Packages

This section gives an overview of the optional packages that extend SPARTA functionality with instructions on how to build SPARTA with each of them. Packages are groups of files that enable a specific set of features. For example, the KOKKOS package provides styles that can run on different hardware such as GPUs. You can see the list of all packages and "make" commands to manage them by typing "make package" from within the src directory of the SPARTA distribution or "cmake -DSPARTA_LIST_PKGS" from within a build directory. Section 2.3 gives general info on how to install and un-install packages as part of the SPARTA build process.

Packages may require some additional code compiled located in the lib folder, or may require an external library to be downloaded, compiled, installed, and SPARTA configured to know about its location and additional compiler flags.

Following the next two tables is a sub-section for each package. It lists authors (if applicable) and summarizes the package contents. It has specific instructions on how to install the package, including (if necessary) downloading or building any extra library it requires. It also gives links to documentation, example scripts, and pictures/movies (if available) that illustrate use of the package.

NOTE: To see the complete list of commands a package adds to SPARTA, just look at the files in its src directory, e.g. "ls src/KOKKOS". Files with names that start with fix, compute, etc correspond to commands with the same style names.

In these two tables, the "Example" column is a sub-directory in the examples directory of the distribution which has an input script that uses the package. E.g. "fft" refers to the examples/fft directory; The "Library" column indicates whether an extra library is needed to build and use the package:


SPARTA packages

Package Description Doc page Example Library
FFT fast Fourier transforms compute_style compute/fft/grid fft int or ext
KOKKOS Kokkos-enabled styles Section 5.3 Benchmarks -
VTK native VTK-format dump output dump particle/vtk - ext

FFT package

Contents:

Apply Fast Fourier Transforms (FFTs) to simulation data. The FFT library is specified in the Makefile.machine or CMake using the FFT_INC, FFT_PATH, and FFT_LIB variables. Supported external FFT libraries that can be specified include FFTW3 or MKL. If no FFT library is specified, SPARTA will use the internal KISS FFT library that is included with SPARTA.

Similarly an external FFT library can be specified for the KOKKOS package. Options are CUFFT, HIPFFT, FFTW3, MKL, or MKL_GPU. If no FFT library is specified in CMake, SPARTA will use the internal Kokkos version of the KISS FFT library that is included with SPARTA.

See the see discussion in Section 2.2 (step 6).

Install or un-install with make:

make yes-fft
make machine 
make no-fft
make machine 

Install or un-install with CMake:

cd build
cmake -C /path/to/sparta/cmake/presets/machine.cmake -DPKG_FFT=ON /path/to/sparta/cmake
make 
cmake -C /path/to/sparta/cmake/presets/machine.cmake -DPKG_FFT=OFF /path/to/sparta/cmake
make 

Supporting info:


KOKKOS package

Contents:

Styles adapted to compile using the Kokkos library which can convert them to OpenMP, CUDA, HIP, or SYCL code so that they run efficiently on multicore CPUs, NVIDIA GPUs, AMD GPUs, or Intel GPUs. All the styles have a "kk" as a suffix in their style name. Section 5.3 gives details of what hardware and software is required on your system, and how to build and use this package. Its styles can be invoked at run time via the "-sf kk" or "-suffix kk" command-line switches.

You must have a C++17 compatible compiler to use this package.

IMPORTANT NOTE: The KOKKOS package must be built using CMake. GNU Makefile builds are not supported.

Authors: The KOKKOS package was created primarily by Stan Moore (Sandia), with contributions from other folks as well. It uses the open-source Kokkos library which was developed by Carter Edwards, Christian Trott, and others at Sandia, and which is included in the SPARTA distribution in lib/kokkos.

Install or un-install:

The KOKKOS package is built with CMake using a preset file that specifies the Kokkos backend (OpenMP, CUDA, HIP, or SYCL) and the target hardware architecture. Preset files are in cmake/presets/.

NOTE: You cannot build one executable that runs on multiple hardware targets. Build SPARTA separately for each target.

For multicore CPUs using OpenMP:

cmake -C /path/to/sparta/cmake/presets/kokkos_omp.cmake /path/to/sparta/cmake
make 

To select a specific CPU architecture (e.g. Haswell):

cmake -C /path/to/sparta/cmake/presets/kokkos_omp.cmake   -DKokkos_ARCH_HSW=ON /path/to/sparta/cmake
make 

For MPI-only (no threading):

cmake -C /path/to/sparta/cmake/presets/kokkos_mpi_only.cmake /path/to/sparta/cmake
make 

For NVIDIA GPUs using CUDA:

cmake -C /path/to/sparta/cmake/presets/kokkos_cuda.cmake /path/to/sparta/cmake
make 

The kokkos_cuda.cmake preset defaults to Hopper (H100) GPUs. To target a different architecture, override the arch flag:

For A100 GPUs (Ampere):

cmake -C /path/to/sparta/cmake/presets/kokkos_cuda.cmake   -DKokkos_ARCH_HOPPER90=OFF -DKokkos_ARCH_AMPERE80=ON   /path/to/sparta/cmake
make 

For V100 GPUs (Volta):

cmake -C /path/to/sparta/cmake/presets/kokkos_cuda.cmake   -DKokkos_ARCH_HOPPER90=OFF -DKokkos_ARCH_VOLTA70=ON   /path/to/sparta/cmake
make 

For AMD GPUs using HIP:

cmake -C /path/to/sparta/cmake/presets/kokkos_hip.cmake /path/to/sparta/cmake
make 

The kokkos_hip.cmake preset defaults to MI250X GPUs. To target MI300X/MI300A GPUs:

cmake -C /path/to/sparta/cmake/presets/kokkos_hip.cmake   -DKokkos_ARCH_VEGA90A=OFF -DKokkos_ARCH_AMD_GFX942=ON   /path/to/sparta/cmake
make 

For Intel GPUs using SYCL:

cmake -C /path/to/sparta/cmake/presets/kokkos_sycl.cmake /path/to/sparta/cmake
make 

The GPU architecture is detected automatically at runtime; no arch override is needed for Intel GPUs.

To uninstall (disable) the KOKKOS package:

cmake -C /path/to/sparta/cmake/presets/machine.cmake -DPKG_KOKKOS=OFF /path/to/sparta/cmake
make 

Supporting info:


VTK package

Contents:

Dump styles that write native VTK files (legacy .vtk, XML .vtp/.vtu, and their parallel .pvtp/.pvtu variants) for direct visualization of SPARTA data in ParaView or VisIt. The package adds three dump styles: "particle/vtk", "grid/vtk", and "surf/vtk", which write particles as points, grid cells as voxels/pixels, and surface elements as triangles/lines, respectively, with requested per-particle, per-grid, or per-surf attributes attached as data arrays.

This package requires the external VTK library from Kitware (version 9 or later recommended). It is distinct from the "tools/paraview" Python converters, which post-process existing SPARTA dump files rather than writing VTK directly.

IMPORTANT NOTE: The VTK package must be built using CMake. GNU Makefile builds are not supported.

Install or un-install with CMake:

Set VTK_ROOT in your environment (or pass -DVTK_ROOT=/path) so CMake can locate your VTK install, then enable both the package and its TPL:

cd build
cmake -C /path/to/sparta/cmake/presets/machine.cmake   -DPKG_VTK=ON -DBUILD_VTK=ON /path/to/sparta/cmake
make 

To uninstall (disable) the VTK package:

cmake -C /path/to/sparta/cmake/presets/machine.cmake   -DPKG_VTK=OFF -DBUILD_VTK=OFF /path/to/sparta/cmake
make 

Supporting info: