Run MPM - geomechanics/mpm GitHub Wiki
Note: for the purposes of documentation, ~/mpm/
is used as an example directory where the mpm repository is cloned.
Steps
1. Compile MPM
See Compiling with Linux, in ARM-based MacOS, or with MPI.
Notes:
- Compiling with MPI is required for running MPI or hybrid (MPI + OpenMP), however serial or OpenMP can also run with an MPI compilation.
- Delete the
CMakeCache.txt
in~/mpm/build/
between compilations, when the settings are changed (e.g. changing to MPI, debug mode, or compiling with/without tests).
2. Navigate to the build directory
To run MPM from the terminal, first navigate to the directory where MPM is compiled:
cd ~/mpm/build/
3. Run MPM
To run some example model mpm.json
from the terminal, with input files located in example folder ~/mpm-simulations/demo/
:
Serial:
./mpm -f ~/mpm-simulations/demo/ -p 1 -i mpm.json
Run with OpenMP (e.g., 8 threads):
./mpm -f ~/mpm-simulations/demo/ -p 8 -i mpm.json
Run with MPI (e.g., rank 4):
mpirun -n 4 mpm -f ~/mpm-simulations/demo/ -i mpm.json
Run with hybrid (e.g., rank 4, 2 threads per rank):
OMP_NUM_THREADS=2 mpirun -n 4 mpm -f ~/mpm-simulations/demo/ -i mpm.json
Notes:
- To run large-deformation models with MPI, set
"nload_balance_steps"
under the analysis object in thempm.json
input file (see Explicit Single Phase MPM wiki page). This is the number of steps between rebalancing particles between ranks.