Skip to content

Commit a4ad6e7

Browse files
authored
Merge pull request #925 from JuliaParallel/eschnett/MPIABI
Implement new ABI "MPIABI"
2 parents 05c7f88 + 2e0a9b1 commit a4ad6e7

6 files changed

Lines changed: 490 additions & 34 deletions

File tree

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name = "MPI"
22
uuid = "da04e1cc-30fd-572f-bb4f-1f8673147195"
33
authors = []
4-
version = "0.20.23"
4+
version = "0.20.24"
55

66
[deps]
77
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
88
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
99
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
10+
MPIABI_jll = "b5ada748-db0f-5fc0-8972-9331c762740c"
1011
MPICH_jll = "7cb0a576-ebde-5e09-9194-50597f1243b4"
1112
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
1213
MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748"
@@ -24,6 +25,7 @@ AMDGPU = "0.6, 0.7, 0.8, 0.9, 1, 2"
2425
CUDA = "3, 4, 5"
2526
DocStringExtensions = "0.8, 0.9"
2627
Libdl = "1"
28+
MPIABI_jll = "0.1.1"
2729
MPICH_jll = "4, 5"
2830
MPIPreferences = "0.1.8"
2931
MPItrampoline_jll = "5"

lib/MPIPreferences/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MPIPreferences"
22
uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
33
authors = []
4-
version = "0.1.11"
4+
version = "0.1.12"
55

66
[deps]
77
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

lib/MPIPreferences/src/MPIPreferences.jl

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ const DEPS_LOADED = Ref(false)
1616
1717
The currently selected binary. The possible values are
1818
19+
- `"MPIABI_jll"`: use the binary provided by [MPIABI_jll](https://github.com/JuliaBinaryWrappers/MPIABI_jll.jl)
1920
- `"MPICH_jll"`: use the binary provided by [MPICH_jll](https://github.com/JuliaBinaryWrappers/MPICH_jll.jl)
20-
- `"OpenMPI_jll"`: use the binary provided by [OpenMPI_jll](https://github.com/JuliaBinaryWrappers/OpenMPI_jll.jl)
21-
- `"MicrosoftMPI_jll"`: use binary provided by [MicrosoftMPI_jll](https://github.com/JuliaBinaryWrappers/MicrosoftMPI_jll.jl/)
2221
- `"MPItrampoline_jll"`: use the binary provided by [MPItrampoline_jll](https://github.com/JuliaBinaryWrappers/MPItrampoline_jll.jl/)
22+
- `"MicrosoftMPI_jll"`: use binary provided by [MicrosoftMPI_jll](https://github.com/JuliaBinaryWrappers/MicrosoftMPI_jll.jl/)
23+
- `"OpenMPI_jll"`: use the binary provided by [OpenMPI_jll](https://github.com/JuliaBinaryWrappers/OpenMPI_jll.jl)
2324
- `"system"`: use a system-provided binary.
2425
2526
"""
@@ -30,22 +31,25 @@ const binary = @load_preference("binary", Sys.iswindows() ? "MicrosoftMPI_jll" :
3031
3132
The ABI (application binary interface) of the currently selected binary. Supported values are:
3233
34+
- `"HPE MPT"`: HPE MPT
35+
- `"MPIABI"`: MPI-ABI-compatible ABI (https://www.mpi-form.org/)
3336
- `"MPICH"`: MPICH-compatible ABI (https://www.mpich.org/abi/)
34-
- `"OpenMPI"`: Open MPI compatible ABI (Open MPI, IBM Spectrum MPI, Fujitsu MPI)
35-
- `"MicrosoftMPI"`: Microsoft MPI
3637
- `"MPItrampoline"`: MPItrampoline
37-
- `"HPE MPT"`: HPE MPT
38+
- `"MicrosoftMPI"`: Microsoft MPI
39+
- `"OpenMPI"`: Open MPI compatible ABI (Open MPI, IBM Spectrum MPI, Fujitsu MPI)
3840
"""
3941
const abi = if binary == "system"
4042
@load_preference("abi")
41-
elseif binary == "MicrosoftMPI_jll"
42-
"MicrosoftMPI"
43+
elseif binary == "MPIABI_jll"
44+
"MPIABI"
4345
elseif binary == "MPICH_jll"
4446
"MPICH"
45-
elseif binary == "OpenMPI_jll"
46-
"OpenMPI"
4747
elseif binary == "MPItrampoline_jll"
4848
"MPItrampoline"
49+
elseif binary == "MicrosoftMPI_jll"
50+
"MicrosoftMPI"
51+
elseif binary == "OpenMPI_jll"
52+
"OpenMPI"
4953
else
5054
error("Unknown binary: $binary")
5155
end
@@ -66,16 +70,17 @@ Switches the underlying MPI implementation to one provided by JLL packages. A
6670
restart of Julia is required for the changes to take effect.
6771
6872
Available options are:
69-
- `"MicrosoftMPI_jll"` (Only option and default on Windows)
73+
- `"MPIABI_jll"`
7074
- `"MPICH_jll"` (Default on all other platform)
71-
- `"OpenMPI_jll"`
7275
- `"MPItrampoline_jll"`
76+
- `"MicrosoftMPI_jll"` (Only option and default on Windows)
77+
- `"OpenMPI_jll"`
7378
7479
The `export_prefs` option determines whether the preferences being set should be
7580
stored within `LocalPreferences.toml` or `Project.toml`.
7681
"""
7782
function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll"; export_prefs=false, force=true)
78-
known_binaries = ("MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll")
83+
known_binaries = ("MPIABI_jll", "MPICH_jll", "MicrosoftMPI_jll", "MPItrampoline_jll", "OpenMPI_jll")
7984
binary in known_binaries ||
8085
error("""
8186
Unknown jll: $binary.
@@ -118,7 +123,7 @@ end
118123

119124
"""
120125
use_system_binary(;
121-
library_names = ["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpi_cray", "libmpitrampoline"],
126+
library_names = ["libmpi", "libmpi_abi", "libmpi_ibm", "msmpi", "libmpich", "libmpi_cray", "libmpitrampoline"],
122127
extra_paths = String[],
123128
mpiexec = "mpiexec",
124129
abi = nothing,
@@ -162,7 +167,7 @@ Options:
162167
- `force`: if `true`, the preferences are set even if they are already set.
163168
"""
164169
function use_system_binary(;
165-
library_names=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpi_cray", "libmpitrampoline"],
170+
library_names=["libmpi", "libmpi_abi", "libmpi_ibm", "msmpi", "libmpich", "libmpi_cray", "libmpitrampoline"],
166171
extra_paths=String[],
167172
mpiexec="mpiexec",
168173
abi=nothing,

src/api/api.jl

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@ export MPI_Aint, MPI_Count, MPI_Offset, MPI_Status,
88
import MPIPreferences
99
using Libdl
1010

11-
if MPIPreferences.binary == "MPICH_jll"
12-
import MPICH_jll: MPICH_jll, libmpi, libmpi_handle, mpiexec
13-
const libmpiconstants = nothing
14-
elseif MPIPreferences.binary == "OpenMPI_jll"
15-
import OpenMPI_jll: OpenMPI_jll, libmpi, libmpi_handle, mpiexec
11+
if MPIPreferences.binary == "MPIABI_jll"
12+
import MPIABI_jll: MPIABI_jll, libmpi, libmpi_handle, mpiexec
1613
const libmpiconstants = nothing
17-
elseif MPIPreferences.binary == "MicrosoftMPI_jll"
18-
import MicrosoftMPI_jll: MicrosoftMPI_jll, libmpi, libmpi_handle, mpiexec
14+
elseif MPIPreferences.binary == "MPICH_jll"
15+
import MPICH_jll: MPICH_jll, libmpi, libmpi_handle, mpiexec
1916
const libmpiconstants = nothing
2017
elseif MPIPreferences.binary == "MPItrampoline_jll"
2118
import MPItrampoline_jll: MPItrampoline_jll, libmpi, libmpi_handle, mpiexec
2219
const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path
20+
elseif MPIPreferences.binary == "MicrosoftMPI_jll"
21+
import MicrosoftMPI_jll: MicrosoftMPI_jll, libmpi, libmpi_handle, mpiexec
22+
const libmpiconstants = nothing
23+
elseif MPIPreferences.binary == "OpenMPI_jll"
24+
import OpenMPI_jll: OpenMPI_jll, libmpi, libmpi_handle, mpiexec
25+
const libmpiconstants = nothing
2326
elseif MPIPreferences.binary == "system"
2427
import MPIPreferences.System: libmpi, libmpi_handle, mpiexec
2528
const libmpiconstants = nothing
@@ -33,7 +36,7 @@ const initexprs = Any[]
3336
"""
3437
@const_ref name T expr
3538
36-
Defines an constant binding
39+
Defines a constant binding
3740
```julia
3841
const name = Ref{T}()
3942
```
@@ -48,14 +51,16 @@ macro const_ref(name, T, expr)
4851
:(const $(esc(name)) = Ref{$T}())
4952
end
5053

51-
@static if MPIPreferences.abi == "MPICH"
54+
@static if MPIPreferences.abi == "MPIABI"
55+
include("mpiabi.jl")
56+
elseif MPIPreferences.abi == "MPICH"
5257
include("mpich.jl")
53-
elseif MPIPreferences.abi == "OpenMPI"
54-
include("openmpi.jl")
55-
elseif MPIPreferences.abi == "MicrosoftMPI"
56-
include("microsoftmpi.jl")
5758
elseif MPIPreferences.abi == "MPItrampoline"
5859
include("mpitrampoline.jl")
60+
elseif MPIPreferences.abi == "MicrosoftMPI"
61+
include("microsoftmpi.jl")
62+
elseif MPIPreferences.abi == "OpenMPI"
63+
include("openmpi.jl")
5964
elseif MPIPreferences.abi == "HPE MPT"
6065
include("mpt.jl")
6166
else

0 commit comments

Comments
 (0)