Skip to content

the-nuclear-confectionery/CCAKE

Repository files navigation

CCAKE

CCAKE v2 is a performance portable and parallellizable 3+1 D relativistic viscous hydrodynamic code with 3 conserved charges (baryon number, strangeness, and electric charge) that uses Smoothed Particle Hydrodynamics. CCAKE can make state-of-the-art predictions for heavy-ion collisions. It uses the 4D lattice QCD equation of state with T, baryon, strangeness, and electric charge that is coupled to the PDG16+ particle list. It offers multiple coordinate system and viscous hydrodynamic schemes, and an option to invert the EoS using a pre-computed table of densities for a faster simulation.

If you use this code in your research, please remember to cite us using the following papers and the Zenodo release, respectively: arXiv:2511.22852, arXiv:2405.09648.

@software{Pala2026_CCAKE,
  author       = {Pala, Kevin P. and
                  Virk, Surkhab Kaur and
                  Almaalol, Dekrayat and
                  Danhoni, Isabella and
                  Yao, Nanxi and
                  Long, Isaac and
                  Serenone, Willian and
                  Salinas San Martín, Jordi and
                  Gardim, Fernando G. and
                  Yared, Alayna A. and
                  Plumberg, Christopher and
                  Noronha-Hostler, Jacquelyn},
  title        = {the-nuclear-confectionery/CCAKE: CCAKE v2.0.0},
  month        = mar,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {v2.0.0},
  doi          = {10.5281/zenodo.18895140},
  url          = {https://doi.org/10.5281/zenodo.18895140},
}

1. Installation

For basic usage, the apptainer image can be used. It contains all the dependencies needed to run the code on CPU. To build the image, run the following command inside its folder (skip this step if someone gave you the image ready):

./build-base-img.sh
./build.sh

To run the image, do:

./run.sh

If you want to build locally with GPU support, follow the instructions below.

1.1 Requirements

  • Nvidia GPU (tested with RTX 3050 Laptop)
    • In theory, AMD and Intel GPUs should work as well with minimal adaptations.
  • Nvidia HPC SDK 22.11 (More recent versions should work, but are not tested)
  • CMake 3.4 or higher

1.2 Installing dependencies.

1.2.1 Download and install Nvidia HPC SDK 22.11

  • Choose a place where you have written permissions. In a local machine, /opt may be a good choice (It may be necessary to use sudo chown -R $USER:$USER /opt to give yourself permissions to write there)
  • Download the Nvidia HPC SDK 22.11 from https://developer.nvidia.com/hpc-sdk
  • Unpack it in the chosen location with tar -xvf <path_to_sdk>.tar.gz
  • Install the SDK with ./<path_to_sdk>/install
  • Add the following lines to your "~/.bashrc" at the end of the install:
MANPATH=$MANPATH:/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/compilers/man; export MANPATH
PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/compilers/bin:$PATH; export PATH
export PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/comm_libs/mpi/bin:$PATH
export MANPATH=$MANPATH:/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/comm_libs/mpi/man
export CUDA_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/22.11/cuda/11.8

1.2.2 Download and install Kokkos

  • Assuming you installed the SDK in /opt, create a "local" folder inside it. Kokkos will be installed there.
  • Create the following env variables:
KOKKOSSRC=<path/to/kokkos_src>
PREFIX=/opt/local

Note: If you exit the terminal, you will need to set these variables again.

  • Clone the Kokkos repository: git clone https://github.com/ECP-copa/Cabana.git $CABANASRC
  • Checkout to version 4.1.0: git checkout 4.1.00
  • Create a build folder inside the Kokkos folder: mkdir -p $KOKKOSSRC/build && cd $KOKKOSSRC/build
  • Edit $KOKKOSSRC/bin/nvcc_wrapper according to your architecture. Most likely, you will need to replace sm_70 by sm_80 or sm_86 (according to the architecture being targeted).
  • Configure kokkos from within build dir with
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX \
      -DCMAKE_CXX_COMPILER=$KOKKOSSRC/bin/nvcc_wrapper \
      -DCMAKE_CXX_STANDARD=17 \
      -DCMAKE_CXX_EXTENSIONS=Off \
      -DCMAKE_BUILD_TYPE="Release" \
      -DKokkos_ENABLE_COMPILER_WARNINGS=ON \
      -DKokkos_ENABLE_CUDA=On \
      -DKokkos_ENABLE_CUDA_LAMBDA=On \
      -DKokkos_ENABLE_OPENMP=On \
      -DKokkos_ENABLE_SERIAL=On \
      -DKokkos_ENABLE_TESTS=Off \
      -DKokkos_ARCH_AMPERE86=On $KOKKOSSRC

Note: Depending on your GPU architecture, you may need to change the Kokkos_ARCH_AMPERE86 flag.

  1. Build and install: cmake --build . --target install -j

1.2.3 Download and install Cabana

  • Assuming you installed the SDK in /opt, create a "local" folder inside it. Kokkos will be installed there.
  • Create the following env variables:
CABANASRC=<Path/to/cabana/src>
PREFIX=/opt/local

Note: If you exit the terminal, you will need to set these variables again. Also, if you are not on the same terminal used to install kokkos, you will need to set the KOKKOSSRC variable again.

  • Clone the Cabana repository: git clone https://github.com/ECP-copa/Cabana.git
  • Create a build folder inside the Cabana folder: mkdir -p $CABANASRC/build && cd $CABANASRC/build
  • Configure Cabana from within build dir with
cmake -D CMAKE_BUILD_TYPE="Debug" \
      -D CMAKE_CXX_STANDARD=17 \
      -D CMAKE_PREFIX_PATH=$CABANASRC \
      -D CMAKE_INSTALL_PREFIX=$PREFIX \
      -D CMAKE_CXX_COMPILER=$KOKKOSSRC/bin/nvcc_wrapper \
      -D Cabana_REQUIRE_CUDA=ON \
      -D Cabana_ENABLE_TESTING=OFF \
      -D Cabana_ENABLE_EXAMPLES=OFF $CABANASRC    
  • Build and install: cmake --build . --target install -j

1.3 Build CCAKE

  • Create a build folder: mkdir CCAKE/build && cd CCAKE/build
  • Configure CCAKE: cmake -DCMAKE_PREFIX_PATH=/opt/local -DCMAKE_BUILD_TYPE="Debug" .. && make -j

Releases

Packages

Contributors

Languages