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
sudo apt install libyaml-cpp-dev
export CURRENT_HOME=$PWD
git clone --depth 1 --branch yaml-cpp-0.6.3 https://github.com/jbeder/yaml-cpp.git
mkdir ${CURRENT_HOME}/build-yaml-cpp && cd ${CURRENT_HOME}/build-yaml-cpp
cmake ../yaml-cpp/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-yaml-cpp -DYAML_BUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF
make install -j 4
cd ${CURRENT_HOME}
export PATH_TO_YAML=$PWD/install-yaml-cpp
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
Please, select the correct compute capability for your GPU
for DCMAKE_CUDA_ARCHITECTURES
instead of 86 in this example.
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=ON -DCMAKE_CUDA_ARCHITECTURES=86
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
Please, note that you need copy on topaze onika and exaNBody repository. You can load the YAML
module such as module load yaml-cpp/
and add this option to the cmake
command: -DCMAKE_PREFIX_PATH=/ccc/products/yaml-cpp-0.6.3/system/default/
module load gnu/13.2.0 cuda/12.4 mpi/openmpi/4.1.6 cmake/3.29.6
cd $CCCSCRATCHDIR
export CURRENT_HOME=$PWD
// copy onika v1.0.2
// copy exaNBody v2.0.2
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=ON -DCMAKE_CUDA_ARCHITECTURES=80
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
The gpu installation depends on onika.
cmake ../exaDEM -DCMAKE_BUILD_TYPE=Release
make -j 4
source bin/setup-env.sh
cmake ../exaDEM -DEXADEM_MAX_VERTICES=36 -DCMAKE_BUILD_TYPE=Release
make -j 4
source bin/setup-env.sh
See the spack section if you need to install spack.
The spack_repo
directory is in the exaDEM repository, you need to git clone
exaDEM.
spack repo add spack_repo
spack install exadem
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
You need to specify “export exaNBody_DIR=${path_to_exaNBody}” and “export onika_DIR=${path_to_onika}”
module load gnu/13.2.0 cuda/12.4 mpi/openmpi/4.1.6 cmake/3.29.6
cmake ${path_to_exaDEM} -DCMAKE_BUILD_TYPE=Release
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