2. Installing ExaDEM

ExaDEM provides flexible installation methods to meet various user and developer needs. For user usage, the Spack package manager offers a straightforward installation process, ideal for user-only. However, for those who intend to develop or customize ExaDEM, CMake is recommended, as it supports both CPU and GPU configurations (GPU support is not available with Spack).

Choose the method below that best suits your setup and follow the instructions for a smooth installation experience.

2.1. Installation With CMake

2.1.1. Minimal Requirements

The first step involves the installation of yaml-cpp, which can be achieved using either the spack package manager or cmake:

spack install yaml-cpp@0.6.3
spack load yaml-cpp@0.6.3

Please ensure to remove yaml-cpp and build-yaml-cpp. When installing Onika, exaNBody, and exaDEM, remember to add the following to your cmake command: -DCMAKE_PREFIX_PATH=${PATH_TO_YAML}.

To proceed with the installation, your system must meet the minimum prerequisites (MPI, Onika, and ExaNBody). The next step involves the installation of Onika and ExaNBody:

export CURRENT_HOME=$PWD
git clone --branch v1.0.2 https://github.com/Collab4exaNBody/onika.git
git clone --branch v2.0.2 https://github.com/Collab4exaNBody/exaNBody.git
mkdir ${CURRENT_HOME}/build-onika && cd ${CURRENT_HOME}/build-onika
cmake ${CURRENT_HOME}/onika -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-onika -DONIKA_BUILD_CUDA=OFF
make install -j 10
export onika_DIR=${CURRENT_HOME}/install-onika
mkdir ${CURRENT_HOME}/build-exanb && cd ${CURRENT_HOME}/build-exanb
cmake ${CURRENT_HOME}/exaNBody -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-exanb
make install -j 10
export exaNBody_DIR=${CURRENT_HOME}/install-exanb
rm -rf ${CURRENT_HOME}/build-onika
rm -rf ${CURRENT_HOME}/build-exanb

2.1.2. Optional Dependencies

Before proceeding further, you have the option to consider the following dependencies:

  • CUDA

  • HIP

  • RSA_MPI

2.1.3. ExaDEM Installation

To install ExaDEM, follow these steps:

Set the exaNBody_DIR environment variable to the installation path. Clone the ExaDEM repository using the command:

git clone https://github.com/Collab4exaNBody/exaDEM.git

Create a directory named build-exaDEM and navigate into it:

mkdir build-exaDEM && cd build-exaDEM

Run CMake to configure the ExaDEM build:

cmake ../exaDEM -DCMAKE_BUILD_TYPE=Release
make -j 4
source bin/setup-env.sh

Warning

It’s important to note that the maximum number of vertices per particle shape is set to 8 by default. To change this value, you can specify this number by adding: -DEXADEM_MAX_VERTICES=N.

Warning

Please, do not forget to load the exaDEM environnement before running a job: source bin/setup-env.sh.

This command will display all plugins and related operators. Example:

+ exadem_force_fieldPlugin
  operator    cylinder_wall
  operator    gravity_force
  operator    contact_force
  operator    rigid_surface
+ exadem_ioPlugin
  operator    print_simulation_state
  operator    read_xyz
  operator    read_dump_particles

Here are a few examples on CEA supercomputers:

You need to specify “export exaNBody_DIR=${path_to_exaNBody}” and “export onika_DIR=${path_to_onika}”

module load yaml-cpp/0.6.3 gnu/13.2.0 mpi/openmpi/4.1.6
cmake ${path_to_exaDEM} -DCMAKE_BUILD_TYPE=Release

2.1.4. Launch examples / ctest

A set of minimal test cases can be run using the following command (non-regression test) in your build repository:

ctest --test-dir example

You can also add exaDEM to your bashrc by adding an alias (please, replace YOURDIR by your build directory):

vi ~/.bashrc
alias exaDEM='~/YOURDIR/build/exaDEM'

Or just on your local environment:

alias exaDEM=$PWD/exaDEM

2.2. Installation With Spack

Installation with spack is preferable for people who don’t want to develop in exaDEM. Only stable versions are added when you install ExaDEM with Spack.

Note

The main of ExaDEM will never be directly accessible via this installation method.

2.2.1. Installing Spack

git clone --depth=2 --branch=v0.23.0 https://github.com/spack/spack.git
export SPACK_ROOT=$PWD/spack
source ${SPACK_ROOT}/share/spack/setup-env.sh

2.2.2. Installing ExaDEM

First get the spack repository in exaDEM directory and add it to spack. It contains two packages: exanbody and exadem:

git clone https://github.com/Collab4exaNBody/spack-repos.git
spack repo add spack-repos

Second install ExaDEM (this command will install cmake, yaml-cpp, onika and exanbody).

spack install exadem

2.3. Running your simulation

2.3.1. CMake

Now that you have installed the ExaDEM and exaNBody packages, you can create your simulation file in YAML format (refer to the ‘example’ folder or the documentation for each operator). Once this file is constructed, you can initiate your simulation using the following instructions.

export N_OMP=1
export N_MPI=1
export OMP_NUM_THREADS=$N_OMP
mpirun -n $N_MPI ./exaDEM test-case.msp

2.3.2. Spack

The ExaDEM executable has been created in the spack directory. You can run your simulation with your input file (your_input_file.msp) such as:

spack load exadem
exaDEM your_input_file.msp

2.4. Adding Optional Packages:

2.4.1. RSA

This external library is available here: https://github.com/MarcJos/RSA_MPI

You can install it with the following commands:

export rsa_mpi_DIR=$DIR
cmake ../exaDEM -DUSE_RSA=ON