Skip to content

Commit 493246b

Browse files
committed
Update docs to reflect recent mpi syntax changes
1 parent baf6876 commit 493246b

File tree

1 file changed

+48
-7
lines changed

1 file changed

+48
-7
lines changed

docs/recipes.md

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ For example, in the recipe below, only `netcdf-fortran` will be built with the `
146146

147147
Stackinator can configure cray-mpich (CUDA, ROCM, or non-GPU aware) or OpenMPI (with or without CUDA) (on a per-environment basis, by setting the `mpi` field in an environment.
148148

149-
!!! note
149+
!!! note Note (on non default MPI veresions)
150150
Future versions of Stackinator will fully support OpenMPI, MPICH and MVAPICH when (and if) they develop robust support for HPE SlingShot 11 interconnect.
151151

152-
Current OpenMPI support has been tested lightly and is not guaranteed to be production ready - only [email protected] is supported (default is @5.0.6 at the time of writing) - CUDA is supported, ROCM has not yet been tested.
152+
Current OpenMPI support has been tested lightly and is not guaranteed to be production ready - only [email protected] is supported (default is @5.0.6 at the time of writing - 2025.03.04) - CUDA is supported, ROCM has not yet been tested.
153153

154154
If the `mpi` field is not set, or is set to `null`, MPI will not be configured in an environment:
155155
```yaml title="environments.yaml: no MPI"
@@ -191,16 +191,57 @@ ompi-cuda-env:
191191
# ...
192192
```
193193
#### Experimental libfabric 2.x support with cray-mpich
194-
HPE recently open-sourced the libfabric/cxi provider (and related drivers) and this can be built into cray-mpich by adding the `+cxi` variant to the spec
195-
```yaml title="environments.yaml: MPI using new libfabric/cxi stack"
194+
HPE has open-sourced the libfabric/cxi provider (and related drivers) and these can be built into cray-mpich by adding a dependency to a newer version of libfabric.
195+
The system default is [email protected] - which can be changed by adding a `depends` field to the yaml. A non default version (newer than 1.15.2) will trigger a build of libfabric using libcxi, cxi-driver, cassini-headers).
196+
197+
This syntax appplies to both mpich and openmpi builds.
198+
```yaml title="environments1.yaml: cray-mpich using new libfabric/cxi stack"
196199
mpich-cxi-env:
197200
mpi:
198-
spec: cray-mpich +cxi
201+
spec: cray-mpich
199202
gpu: cuda
200-
# ...
203+
depends: [libfabric@main]
204+
# on release of libfabric@2, we recommended using @2 in preference to @main ...
205+
```
206+
```yaml title="environments2.yaml: openmpi using new libfabric/cxi stack"
207+
openmpi-cxi-env:
208+
mpi:
209+
spec: openmpi
210+
gpu: cuda
211+
depends: [libfabric@main]
212+
# on release of libfabric@2, we recommended using @2 in preference to @main ...
201213
```
202-
OpenMPI does not provide a `cxi` option since it is mandatory to use it for builds on the alps cluster. Currently the performance of OpenMPI on Alps clusters might not be optimal and work is ongoing to fine tune it especially for intra-node performance.
214+
!!! note Note (on openmpi performance)
215+
Currently the performance of OpenMPI on Alps clusters might not be optimal and work is ongoing to fine tune it especially for intra-node performance.
216+
217+
#### Custom MPI builds
218+
If an experimental version of OpenMPI is required, the yaml syntax supports additional options to enable this. the `xspec` tag may be used to supply extra spack `spec` options.
219+
To illustrate usage, consider this example: a build of openmpi using a particular git branch named `mpi-continue-5.0.6` which in this case has a variant `+continuations` that is not available on the `main` or released branches.
220+
The `xspec` tag allows the user to supply arbitrary spack variants and options that replace the defaults used by stackinator in its absence.
221+
```yaml title="custom-openmpi.yaml: custom build of openmpi"
222+
openmpi-custom-env:
223+
mpi:
224+
spec: [email protected]=main
225+
xspec: +continuations +internal-pmix fabrics=cma,ofi,xpmem schedulers=slurm +cray-xpmem
226+
gpu: cuda
227+
depends: ["libfabric@main"]
228+
```
229+
In this example, we must tell spack to fetch our custom git branch from a repo that is different from the default openmpi github version, by adding the following to our recipe `packages.yaml`
230+
```yaml title="custom-packages.yaml: custom repo for openmpi"
231+
# mpi-continue-5.0.6 branch available from here
232+
openmpi:
233+
package_attributes:
234+
git: https://github.com/your-username/ompi
235+
```
236+
237+
!!! note Note (git tags)
238+
To build using a specific git commit, use the syntax
239+
```
240+
spec: [email protected]=main
241+
```
242+
It is therefore possible to build arbitrary versions of MPI using custom options/branches etc using these combinations of settings.
203243
244+
### Version info
204245
!!! alps
205246
206247
As new versions of cray-mpich are released with CPE, they are provided on Alps vClusters, via the Spack package repo in the [CSCS cluster configuration repo](https://github.com/eth-cscs/alps-cluster-config/tree/master/site/repo).

0 commit comments

Comments
 (0)