Skip to content

Commit

Permalink
[sparse] Improve readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
cpmech committed Sep 5, 2023
1 parent c95f7a1 commit e36848d
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions russell_sparse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<real-core-count>
```

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
Expand Down

0 comments on commit e36848d

Please sign in to comment.