This repository was created to run benchmarks between the gravity forward model available in SimPEG v0.20 and the new implementation of it that was merged in simpeg@eb07ef133a6c5e1714ff1af181147cb172eba97c. This new implementation makes use of Numba and the gravity kernels implemented in Choclo to achieve faster run times and handle memory in a more efficient way.
The benchmarks were set up in the Python files located in the notebooks
folder. They compare the two implementations in different scenarios, varying
the number of cells in the mesh, the number of receivers, enabling and
disabling parallelization (using both mutliprocessing
and dask
for the
SimPEG v0.20 implementation), and varying the number of threads assigned to
the simulation.
The results were saved as netCDF files (that can be opened with
Xarray) in the raw
folder. Figures of these results can be found in
the figs
folder.
In order to run these benchmarks, you need to have a Python distribution like Miniforge installed.
Then, clone this repository:
git clone https://github.com/santisoler/simpeg-benchmarks-gravity
cd simpeg-benchmarks-gravity
And create a conda
environment with all the required dependencies for running
these benchmarks:
mamba env create -f environment.yml
Important I recommend using
mamba
overconda
due to its faster speeds for resolving dependencies and installing packages. In case you don't havemamba
installed, feel free to replacemamba
withconda
.
All benchmarks can be run by executing the Python scripts in notebooks
folder, and through the benchmark-memory.sh
script.
Alternatively, we can run all benchmarks by executing the run.sh
shell
script:
bash run.sh
Important Most of the benchmarks were designed to be run on a machine with 125 GB of ram and a minimum of 30 threads. If your system doesn't meet these specs, you can modify the scripts to adjust them to your needs.
The benchmarks for the "large problem" require more memory: up to ~800 GB.