Please refer to CB-Geo MPM Documentation for information on compiling, and running the code. The documentation also include the MPM theory.
-
Docker image for CB-Geo mpm code https://hub.docker.com/r/cbgeo/mpm
-
Instructions for running mpm docker container: https://github.com/cb-geo/docker-mpm/blob/master/README.md.
The following prerequisite packages can be found in the docker image:
Please run the following command:
dnf install -y boost boost-devel clang cmake cppcheck eigen3-devel findutils gcc gcc-c++ \
git hdf5 hdf5-devel hdf5-openmpi hdf5-openmpi-devel kernel-devel lcov\
make openmpi openmpi-devel sqlite sqlite-devel tar tbb tbb-devel valgrind vim \
voro++ voro++-devel vtk vtk-devel wget
Please run the following commands to install dependencies:
sudo apt-get install -y cmake gcc git libboost-all-dev libeigen3-dev libhdf5-serial-dev libopenmpi-dev \
libtbb-dev libvtk7-dev
See https://mpm-doc.cb-geo.com/ for more detailed instructions.
-
Run
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ ..
. -
Run
make clean && make -jN
(where N is the number of cores).
- To compile either
mpm
ormpmtest
alone, runmake mpm -jN
ormake mpmtest -jN
(where N is the number of cores).
To compile without tests run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DMPM_BUILD_TESTING=Off ..
.
- Run
./mpmtest -s
(for a verbose output) orctest -VV
.
See https://mpm-doc.cb-geo.com/ for more detailed instructions.
The CB-Geo MPM code uses a JSON
file for input configuration. To run the mpm code:
./mpm [-p <tbb_parallel>] [-i <input_file>] -f <working_dir> [--]
[--version] [-h]
For example:
./mpm -f /path/to/input-dir/ -i mpm-usf-3d.json -p 8
Where:
-p <tbb_parallel>, --tbb_parallel <tbb_parallel>
Number of parallel TBB threads
-i <input_file>, --input_file <input_file>
Input JSON file [mpm.json]
-f <working_dir>, --working_dir <working_dir>
(required) Current working folder
--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.
--version
Displays version information and exits.
-h, --help
Displays usage information and exits.
The CB-Geo mpm code can be compiled with MPI
to distribute the workload across compute nodes in a cluster.
Additional steps to load OpenMPI
on Fedora:
source /etc/profile.d/modules.sh
export MODULEPATH=$MODULEPATH:/usr/share/modulefiles
module load mpi/openmpi-x86_64
Compile with OpenMPI:
mkdir build && cd build
export CXX_COMPILER=mpicxx
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_EXPORT_COMPILE_COMMANDS=On ..
make -jN
To run the CB-Geo mpm code on a cluster with MPI:
mpirun -N <#-MPI-tasks> ./mpm -f /path/to/input-dir/ -i mpm.json
For example to run the code on 4 compute nodes (MPI tasks):
mpirun -N 4 ./mpm -f ~/benchmarks/3d/uniaxial-stress -i mpm.json