Skip to content

Commit 635acdb

Browse files
authored
Merge pull request #337 from pyiron/release_openmpi_constraint
Release openmpi constraint - Test with openmpi 5.0
2 parents 75613c1 + 4af4e97 commit 635acdb

File tree

15 files changed

+135
-67
lines changed

15 files changed

+135
-67
lines changed

.ci_support/environment-openmpi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
dependencies:
44
- python
55
- numpy
6-
- openmpi =4.1.6
6+
- openmpi
77
- cloudpickle =3.0.0
88
- mpi4py =3.1.6
99
- tqdm =4.66.4

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ jobs:
5353
cat timing.log
5454
python -m unittest tests/benchmark/test_results.py
5555
env:
56-
OMPI_MCA_rmaps_base_oversubscribe: 'yes'
56+
PRTE_MCA_rmaps_default_mapping_policy: ':oversubscribe'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Unittests-flux-mpich
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Extend environment
15+
shell: bash -l {0}
16+
timeout-minutes: 5
17+
run: |
18+
echo -e '- coverage\n- flux-core =0.59.0\n- versioneer =0.28'>> .ci_support/environment-mpich.yml
19+
cat .ci_support/environment-mpich.yml
20+
- uses: conda-incubator/setup-miniconda@v2.2.0
21+
with:
22+
python-version: '3.12'
23+
mamba-version: "*"
24+
channels: conda-forge
25+
miniforge-variant: Mambaforge
26+
channel-priority: strict
27+
auto-update-conda: true
28+
environment-file: .ci_support/environment-mpich.yml
29+
- name: Test
30+
shell: bash -l {0}
31+
timeout-minutes: 5
32+
run: |
33+
pip install . --no-deps --no-build-isolation
34+
python -m unittest discover tests
35+
- name: Test Flux
36+
shell: bash -l {0}
37+
timeout-minutes: 5
38+
run: >
39+
flux start
40+
python -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Unittests-flux-openmpi
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Extend environment
15+
shell: bash -l {0}
16+
timeout-minutes: 5
17+
run: |
18+
echo -e '- coverage\n- flux-core =0.59.0\n- flux-pmix=0.5.0\n- versioneer =0.28' >> .ci_support/environment-openmpi.yml
19+
cat .ci_support/environment-openmpi.yml
20+
- uses: conda-incubator/setup-miniconda@v2.2.0
21+
with:
22+
python-version: '3.12'
23+
mamba-version: "*"
24+
channels: conda-forge
25+
miniforge-variant: Mambaforge
26+
channel-priority: strict
27+
auto-update-conda: true
28+
environment-file: .ci_support/environment-openmpi.yml
29+
- name: Test
30+
shell: bash -l {0}
31+
timeout-minutes: 5
32+
run: |
33+
pip install . --no-deps --no-build-isolation
34+
coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest discover tests
35+
- name: Test Flux with OpenMPI
36+
shell: bash -l {0}
37+
timeout-minutes: 5
38+
run: >
39+
flux start
40+
coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py;
41+
coverage xml
42+
env:
43+
PYMPIPOOL_PMIX: "pmix"
44+
- name: Coveralls
45+
uses: coverallsapp/github-action@v2

.github/workflows/unittest-flux.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

binder/environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ channels:
33
dependencies:
44
- python
55
- numpy
6-
- openmpi =4.1.6
6+
- openmpi
77
- cloudpickle =3.0.0
88
- mpi4py =3.1.6
99
- tqdm =4.66.2
1010
- pyzmq =26.0.0
1111
- flux-core =0.59.0
12+
- flux-pmix =0.5.0
1213
- versioneer =0.28

docs/installation.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ conda install -c conda-forge flux-core flux-sched mpich=>4 pympipool
5151
Flux is not limited to mpich / cray mpi, it can also be installed in compatibility with openmpi or intel mpi using the
5252
openmpi package:
5353
```
54-
conda install -c conda-forge flux-core flux-sched openmpi pympipool
54+
conda install -c conda-forge flux-core flux-sched openmpi=4.1.6 pympipool
5555
```
56+
For the version 5 of openmpi the backend changed to `pmix`, this requires the additional `flux-pmix` plugin:
57+
```
58+
conda install -c conda-forge flux-core flux-sched flux-pmix openmpi>=5 pympipool
59+
```
60+
In addition, the `pmi="pmix"` parameter has to be set for the `pympipool.Executor` to switch to `pmix` as backend.
5661

5762
## Test Flux Framework
5863
To validate the installation of flux and confirm the GPUs are correctly recognized, you can start a flux session on the

notebooks/examples.ipynb

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pympipool/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Executor:
4848
function.
4949
init_function (None): optional function to preset arguments for functions which are submitted later
5050
command_line_argument_lst (list): Additional command line arguments for the srun call (SLURM only)
51+
pmi (str): PMI interface to use (OpenMPI v5 requires pmix) default is None (Flux only)
5152
5253
Examples:
5354
```
@@ -85,6 +86,7 @@ def __init__(
8586
block_allocation: bool = True,
8687
init_function: Optional[callable] = None,
8788
command_line_argument_lst: list[str] = [],
89+
pmi: Optional[str] = None,
8890
disable_dependencies: bool = False,
8991
refresh_rate: float = 0.01,
9092
):
@@ -106,6 +108,7 @@ def __new__(
106108
block_allocation: bool = False,
107109
init_function: Optional[callable] = None,
108110
command_line_argument_lst: list[str] = [],
111+
pmi: Optional[str] = None,
109112
disable_dependencies: bool = False,
110113
refresh_rate: float = 0.01,
111114
):
@@ -143,6 +146,7 @@ def __new__(
143146
of the individual function.
144147
init_function (None): optional function to preset arguments for functions which are submitted later
145148
command_line_argument_lst (list): Additional command line arguments for the srun call (SLURM only)
149+
pmi (str): PMI interface to use (OpenMPI v5 requires pmix) default is None (Flux only)
146150
disable_dependencies (boolean): Disable resolving future objects during the submission.
147151
refresh_rate (float): Set the refresh rate in seconds, how frequently the input queue is checked.
148152
@@ -162,6 +166,7 @@ def __new__(
162166
block_allocation=block_allocation,
163167
init_function=init_function,
164168
command_line_argument_lst=command_line_argument_lst,
169+
pmi=pmi,
165170
refresh_rate=refresh_rate,
166171
)
167172
else:
@@ -180,4 +185,5 @@ def __new__(
180185
block_allocation=block_allocation,
181186
init_function=init_function,
182187
command_line_argument_lst=command_line_argument_lst,
188+
pmi=pmi,
183189
)

pympipool/scheduler/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
check_oversubscribe,
1414
check_executor,
1515
check_init_function,
16+
check_pmi,
1617
validate_backend,
1718
validate_number_of_cores,
1819
)
@@ -50,6 +51,7 @@ def create_executor(
5051
block_allocation: bool = False,
5152
init_function: Optional[callable] = None,
5253
command_line_argument_lst: list[str] = [],
54+
pmi: Optional[str] = None,
5355
):
5456
"""
5557
Instead of returning a pympipool.Executor object this function returns either a pympipool.mpi.PyMPIExecutor,
@@ -83,13 +85,15 @@ def create_executor(
8385
of the individual function.
8486
init_function (None): optional function to preset arguments for functions which are submitted later
8587
command_line_argument_lst (list): Additional command line arguments for the srun call (SLURM only)
88+
pmi (str): PMI interface to use (OpenMPI v5 requires pmix) default is None (Flux only)
8689
8790
"""
8891
max_cores = validate_number_of_cores(max_cores=max_cores, max_workers=max_workers)
8992
check_init_function(block_allocation=block_allocation, init_function=init_function)
9093
backend = validate_backend(
9194
backend=backend, flux_installed=flux_installed, slurm_installed=slurm_installed
9295
)
96+
check_pmi(backend=backend, pmi=pmi)
9397
if backend == "flux":
9498
check_oversubscribe(oversubscribe=oversubscribe)
9599
check_command_line_argument_lst(
@@ -105,6 +109,7 @@ def create_executor(
105109
cwd=cwd,
106110
executor=executor,
107111
hostname_localhost=hostname_localhost,
112+
pmi=pmi,
108113
)
109114
else:
110115
return PyFluxStepExecutor(
@@ -115,6 +120,7 @@ def create_executor(
115120
cwd=cwd,
116121
executor=executor,
117122
hostname_localhost=hostname_localhost,
123+
pmi=pmi,
118124
)
119125
elif backend == "slurm":
120126
check_executor(executor=executor)

0 commit comments

Comments
 (0)