Skip to content

Commit 0e22a4d

Browse files
committed
Improvement
1 parent affee86 commit 0e22a4d

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

docs/src/configuration.md

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ standard or later.
7979
### Configuration
8080

8181
To use the system MPI library, run `MPI.use_system_binary()`.
82-
This will attempt find and identify any available MPI implementation, and create
82+
This will attempt to locate and to identify any available MPI implementation, and create
8383
a file called `LocalPreferences.toml` adjacent to the current `Project.toml`.
84+
Use `Base.active_project()` to obtain the location of the currently active project.
8485

8586
```sh
8687
julia --project -e 'using MPI; MPI.use_system_binary()'
8788
```
89+
8890
!!! note
8991
You can copy `LocalPreferences.toml` to a different project folder, but you must list
9092
`MPIPreferences` in the `[extras]` section of the `Project.toml` for the settings
@@ -106,6 +108,7 @@ The following MPI implementations should work out-of-the-box with MPI.jl:
106108
```@doc
107109
MPI.use_system_binary
108110
```
111+
109112
You can use the argument `mpiexec` to provide the name (or full path) of the MPI launcher executable. The default is
110113
`mpiexec`, but some clusters require using the scheduler launcher interface (e.g. `srun`
111114
on Slurm, `aprun` on PBS). If the MPI library has an uncommon name you can provide it in `library_names`.
@@ -120,22 +123,28 @@ but also open an issue such that the automatic detection can be improved.
120123
Preferences are merged across the Julia load path, such that it is feasible to provide a module file that appends a path to
121124
`JULIA_LOAD_PATH` variable that contains system-wide preferences.
122125

123-
As an example you can use [`MPI.use_system_binary(;export_prefs)`](@ref) to create a file `Project.toml` containing:
126+
As an example you can use [`MPI.use_system_binary()`](@ref) to create a file `LocalPreferences.toml` containing:
124127

125128
```toml
126-
[extras]
127-
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
128-
129-
[preferences.MPIPreferences]
129+
[MPIPreferences]
130130
abi = "OpenMPI"
131131
binary = "system"
132132
libmpi = "/software/mpi/lib/libmpi.so"
133133
mpiexec = "/software/mpi/bin/mpiexec"
134134
```
135-
Copying this `Project.toml` to a central location such as `/software/mpi/julia` and setting the environment
136-
variable `JULIA_LOAD_PATH=":/software/mpi/julia"` (note the `:` before the path) in the corresponding
135+
136+
Copying this `LocalPreferences.toml` to a central location such as `/software/mpi/julia` and
137+
create adjacent to it a `Project.toml` containing:
138+
139+
```toml
140+
[extras]
141+
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
142+
```
143+
144+
Now exporting the environment variable `JULIA_LOAD_PATH=":/software/mpi/julia"`
145+
(note the `:` before the path) in the corresponding
137146
module file (preferably the module file for the MPI installation or for Julia),
138-
will cause the user to default to your cluster MPI installation.
147+
will cause MPI.jl to default to your cluster MPI installation.
139148

140149
The user can still provide differing MPI configurations for each Julia project that
141150
will take precedent by modifying the local `Project.toml` or by providing a `LocalPreferences.toml` file.
@@ -147,13 +156,29 @@ The following MPI implementations are provided as JLL packages and automatically
147156
- `MicrosoftMPI_jll`: Default for Windows
148157
- `MPICH_jll`: Default for all Unix-like systems
149158
- [`MPItrampoline_jll`](https://github.com/eschnett/MPItrampoline): Binaries built against MPItrampoline can be efficiently retargetted to a system MPI implementation.
150-
- `OpenMPI_jll`
159+
- `OpenMPI_jll`:
151160

152161
```@doc
153162
MPI.use_jll_binary
154163
```
155164

156-
## Environment variables for the testsuite
165+
## Configuration of the MPI.jl testsuite
166+
167+
### Testing against a different MPI implementation
168+
169+
The `LocalPreferences.toml` must be located within the `test` folder, you can
170+
either create it in place or copy it into place.
171+
172+
```
173+
~/MPI> julia --project=test
174+
julia> using MPIPreferences
175+
julia> MPIPreferences.use_system_binary()
176+
~/MPI> rm test/Manifest.toml
177+
~/MPI> julia --project
178+
(MPI) pkg> test
179+
```
180+
181+
### Environment variables
157182
The test suite can also be modified by the following variables:
158183

159184
- `JULIA_MPI_TEST_NPROCS`: How many ranks to use within the tests

0 commit comments

Comments
 (0)