diff --git a/russell_sparse/README.md b/russell_sparse/README.md index 57ace300..8e0532e4 100644 --- a/russell_sparse/README.md +++ b/russell_sparse/README.md @@ -10,46 +10,50 @@ Documentation: ## Installation -Install some libraries: +Essential dependencies: ```bash -sudo apt-get install \ - liblapacke-dev \ - libmumps-seq-dev \ - libopenblas-dev \ - libsuitesparse-dev +sudo apt-get install liblapacke-dev libopenblas-dev libsuitesparse-dev ``` -[![Crates.io](https://img.shields.io/crates/v/russell_sparse.svg)](https://crates.io/crates/russell_sparse) +**Important:** The Debian `libmumps-seq-dev` package does not come with Metis or OpenMP, which makes it possible slower. Therefore, it may be advantageous to use a locally compiled MUMPS library with Metis and OpenMP. Below we recommend Option 1, but Option 2 is also available. -👆 Check the crate version and update your Cargo.toml accordingly: +### Option 1: Locally compiled MUMPS solver -```toml -[dependencies] -russell_sparse = "*" +Follow the steps in https://github.com/cpmech/script-install-mumps and set the environment variable: + +```bash +export USE_LOCAL_MUMPS=1 ``` -### Optional: Use a locally compiled MUMPS library +### Option 2: Debian/Ubuntu package for the MUMPS solver + +Install: -The standard Debian `libmumps-seq-dev` does not come with Metis or OpenMP that may lead to faster calculations. Therefore, it may be advantageous to use a locally compiled MUMPS library. +```shell +sudo apt-get install libmumps-seq-dev +``` -We just need the include files in `/usr/local/include/mumps` and a library file named `libdmumps_open_seq_omp` in `/usr/local/lib/mumps`. +### Crates.io -Follow the instructions from https://github.com/cpmech/script-install-mumps and then set the environment variable `USE_LOCAL_MUMPS=1`: +[![Crates.io](https://img.shields.io/crates/v/russell_sparse.svg)](https://crates.io/crates/russell_sparse) -```bash -export USE_LOCAL_MUMPS=1 +👆 Check the crate version and update your Cargo.toml accordingly: + +```toml +[dependencies] +russell_sparse = "*" ``` ### Number of threads -By default OpenBLAS will use all available threads, including Hyper-Threads that make the performance worse. Thus, it is best to set the following environment variable: +By default OpenBLAS will use all available threads, including Hyper-Threads which may make the performance worse. Thus, it is best to set the following environment variable: ```bash export OPENBLAS_NUM_THREADS= ``` -Furthermore, if working on a multi-threaded application, it is recommended to set: +Furthermore, if working on a multi-threaded application where the solver should not be multi-threaded, you may set: ```bash export OPENBLAS_NUM_THREADS=1