Skip to content

Commit

Permalink
Merge branch 'topic/default/update-bench-mpi' into 'branch/default'
Browse files Browse the repository at this point in the history
Update bench_mpi for Debian 11

See merge request fluiddyn/fluidsim!383
  • Loading branch information
paugier committed May 21, 2024
2 parents 5c801b9 + 01652ac commit cf3d76d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ site.cfg
*.lock
*.dirlock
**/tmp*
**/venv_*

fluidsim_path
scratch
Expand Down
37 changes: 37 additions & 0 deletions bench/bench_mpi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Benchmark MPI with and without infiniband network

It appears that the value of the environment variable `OMPI_MCA_pml` influences how mpi4py is built.
Therefore, to use the infiniband network, mpi4py has to be rebuilt with something like:

```sh
export OMPI_MCA_pml=ucx
pip install mpi4py --force-reinstall --no-binary mpi4py
```

At LEGI, there is a module `env/ib4openmpi` that sets this variable.

The script `submit_legi.py` can use 2 virtual environments that should be built with something like this.

First, get an interactive session on cores with the infiniband network:

```sh
oarsub -I -l "{net='ib' and os='bullseye'}/core=2,walltime=0:10:0"
```

Then,

```sh
rm -rf venv_mpi_ib venv_mpi_noib
# module with infiniband
module purge
/usr/bin/python3 -m venv venv_mpi_ib
. venv_mpi_ib/bin/activate
module load env/ib4openmpi
pip install mpi4py --no-binary mpi4py
deactivate
# module without infiniband
module purge
/usr/bin/python3 -m venv venv_mpi_noib
. venv_mpi_noib/bin/activate
pip install mpi4py --no-binary mpi4py
```
17 changes: 8 additions & 9 deletions bench/bench_mpi/submit_legi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@
cluster.commands_setting_env = [
"source /etc/profile",
"export MPI4PY_RC_THREAD_LEVEL=serialized",
"module purge",
]

if infiniband:
name_venv = "mpi_ib"
name_venv = "venv_mpi_ib"
else:
name_venv = "mpi_noib"
name_venv = "venv_mpi_noib"

name_run = "bench_py_" + name_venv

cluster.commands_setting_env.append(
f"source /home/users/augier3pi/envs/{name_venv}/bin/activate"
)
cluster.commands_setting_env.append(f"source {name_venv}/bin/activate")

if infiniband:
cluster.commands_setting_env.append("module load openmpi/4.0.5-ib")

resource_conditions = "net='ib' and os='buster'"
cluster.commands_setting_env.append(
"module load env/ib4openmpi # export OMPI_MCA_pml=ucx",
)

nb_nodes = 2

Expand All @@ -44,5 +43,5 @@
omp_num_threads=1,
walltime="0:10:00",
ask=False,
resource_conditions=resource_conditions,
resource_conditions="net='ib' and os='bullseye'",
)

0 comments on commit cf3d76d

Please sign in to comment.