Skip to content

Commit 08618fe

Browse files
committed
add docs
1 parent f36d1d2 commit 08618fe

File tree

2 files changed

+73
-21
lines changed

2 files changed

+73
-21
lines changed

docs/cluster-config.md

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Spack stacks are built on bare-metal clusters using a minimum of dependencies from the underlying system.
44
A cluster configuration is a directory with the following structure:
55

6-
TODO: document layout of the `network.yaml` file
7-
86
```
97
/path/to/cluster/configuration
108
├─ packages.yaml # external system packages
@@ -27,12 +25,74 @@ stack-config --system ./alps-cluster-config/clariden --recipe <recipe path> --bu
2725

2826
If there are additional system packages that you want to use in a recipe, consider adding a `packages.yaml` file to the recipe, in which you can define additional external packages.
2927

30-
!!! warning
31-
Only use external dependencies that are strictly necessary:
32-
28+
!!! warning "Only use external dependencies that are strictly necessary"
3329
* the more dependencies, the more potential that software stacks will have to be rebuilt when the system is updated, and the more potential there are for breaking changes;
3430
* the external packages are part of the Spack upstream configuration generated with the Stack - you might be constraining the choices of downstream users.
3531

32+
[](){#ref-cluster-config-network}
33+
### Configuring MPI and network libraries: `network.yaml`
34+
35+
The `network.yaml` file contains two high level fields:
36+
37+
```yaml title="network.yaml"
38+
mpi:
39+
cray-mpich:
40+
specs: [... default packages to add to the network stack ...]
41+
openmpi:
42+
specs: [... default packages to add to the network stack ...]
43+
# standard Spack packages.yaml for packages
44+
packages:
45+
libfabric: ...
46+
openmpi: ...
47+
```
48+
49+
??? example "example `network.yaml` for grace hopper"
50+
* The `specs` field for `mpi:cray-mpich:specs` and `mpi:openmpi:specs` fields set different default `libfabric` for the respective MPI distributions.
51+
* By default `packages:cray-mpich` and `packages:openmpi` add the `+cuda` variant as a preference to build with cuda support by default on the Grace-Hopper nodes.
52+
* This can be overriden by adding `~cuda` to the spec in `network:mpi` in your recipe.
53+
* The version of `libfabric` on tye system is `1.22.0`, but it is set as buildable so that it can be build from source by Spack if a different (more recent) verson is selected in a recipe.
54+
* A combination of `require` and `prefer` are used in the `packages` definitions to enforce settings and set defaults, respectively.
55+
56+
```yaml title="network.yaml"
57+
mpi:
58+
cray-mpich:
59+
specs: ["libfabric@1.22"]
60+
openmpi:
61+
specs: ["libfabric@2.2.0"]
62+
packages:
63+
# adding a variant to the variants field of a package
64+
# e.g. packages:openmpi:variants
65+
# is not strong enough: if that variant does not exist it simply will be ignored with no error message
66+
openmpi:
67+
buildable: true
68+
require:
69+
- 'schedulers=slurm'
70+
- 'fabrics=cma,ofi,xpmem'
71+
- '+internal-pmix'
72+
- '+cray-xpmem'
73+
prefer:
74+
- '+cuda'
75+
variants: []
76+
cray-mpich:
77+
buildable: true
78+
prefer:
79+
- '+cuda'
80+
- '@8.1.32'
81+
libfabric:
82+
buildable: true
83+
externals:
84+
- spec: libfabric@1.22.0 fabrics=cxi,rxm,tcp
85+
prefix: /opt/cray/libfabric/1.22.0/
86+
version: ["git.v2.2.0=main"]
87+
require: fabrics=cxi,rxm,tcp
88+
libcxi:
89+
version: ["git.be1f7149482581ad589a124e5f6764b9d20d2d45=main"]
90+
cxi-driver:
91+
version: ["git.08deb056fac4ca8b0d3d39b5f7cc0dad019ee266=main"]
92+
cassini-headers:
93+
version: ["git.59b6de6a91d9637809677c50cc48b607a91a9acb=main"]
94+
```
95+
3696
## Site and System Configurations
3797

3898
The `repo.yaml` configuration can be used to provide a list of additional Spack package repositories to use on the target system.

docs/recipes.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,7 @@ Stackinator can configure MPI (cray-mpich and OpenMPI) its dependencies (libfabr
155155
The `network` field replaces the `mpi` field in Stackinator 6.
156156
See the [porting guide][ref-porting-network] for guidance on updating uenv recipes for Spack 1.0.
157157

158-
If the `network` field is not set, or is set to `null`, MPI will not be configured in an environment:
159-
160-
```yaml title="environments.yaml no network/mpi stack"
161-
serial-env:
162-
network: null
163-
```
158+
If the `network` field is not set, MPI will not be configured in an environment.
164159

165160
The `network` field has a field for defining MPI and additional custom package definitions
166161

@@ -180,7 +175,7 @@ The `network` field has a field for defining MPI and additional custom package d
180175
```
181176

182177
Provide a more explicit spec that disables `cuda` (this might be useful on a system where `cuda` support is the default).
183-
Also request a specific version of `libfabric`
178+
Also request a specific version of
184179
```yaml title="environments.yaml"
185180
network:
186181
mpi: cray-mpich@9.0 ~cuda
@@ -198,7 +193,7 @@ The `network` field has a field for defining MPI and additional custom package d
198193
It is only possible to have a single MPI implementation in an environment, specified through the `mpi` field.
199194
Behind the scenes, Stackinator adds a hard requirement that all packages in the environment use the the chosen MPI, to help Spack concretise correctly.
200195

201-
??? tip "but I want to provide cray-mpich and openmpi in my uenv"
196+
??? question "How do I provide cray-mpich and openmpi in my uenv?"
202197
No problem!
203198
Just add two environments in your `environments.yaml` file, for example:
204199

@@ -227,8 +222,11 @@ Behind the scenes, Stackinator adds a hard requirement that all packages in the
227222
228223
The uenv will provide two views for the end user.
229224
230-
!!! question "Why add a `network:specs` field instead of just adding `libfabric` and friends to the main `specs` list"
231-
The `network.yaml` file in the cluster config provides a set of default specs for MPI dependencies for each MPI distribution.
225+
226+
The `network.yaml` file in the cluster config provides a set of default specs for MPI dependencies for each MPI distribution.
227+
See the [`network.yaml` documenation][ref-cluster-config-network] for more information about how the defaults are set.
228+
229+
??? question "Why add a `network:specs` field instead of just adding `libfabric` and friends to the main `specs` list?"
232230
It is easier to override these by providing a custom field for network dependencies.
233231

234232
!!! alps
@@ -239,12 +237,6 @@ Behind the scenes, Stackinator adds a hard requirement that all packages in the
239237
As such, it is recommended as an option for applications that have performance issues or bugs with cray-mpich.
240238

241239

242-
243-
244-
#### Custimsing network dependences with specs
245-
246-
You can provide
247-
248240
### Specs
249241

250242
The list of software packages to install is configured in the `spec:` field of an environment. The specs follow the [standard Spack practice](https://spack.readthedocs.io/en/latest/environments.html#spec-concretization).

0 commit comments

Comments
 (0)