@@ -48,9 +48,7 @@ function use_system_binary(;
48
48
error (" MPI library could not be found" )
49
49
end
50
50
if isnothing (abi)
51
- versionstring = Get_library_version (libmpi)
52
- impl, version = identify_implementation (versionstring)
53
- abi = identify_abi (impl, version)
51
+ abi = identify_abi (libmpi)
54
52
end
55
53
if mpiexec isa Cmd
56
54
mpiexec = collect (mpiexec)
@@ -63,12 +61,14 @@ function use_system_binary(;
63
61
)
64
62
end
65
63
64
+
66
65
"""
67
- Get_library_version (libmpi)
66
+ identify_abi (libmpi)
68
67
69
- Get the version string of the MPI library.
68
+ Identify the MPI implementation from the library version string
70
69
"""
71
- function Get_library_version (libmpi)
70
+ function identify_abi (libmpi)
71
+ # 1) query MPI_Get_version
72
72
# There is no way to query at runtime what the length of the buffer should be.
73
73
# https://github.com/mpi-forum/mpi-issues/issues/159
74
74
# 8192 is the maximum value of MPI_MAX_LIBRARY_VERSION_STRING across known
@@ -82,16 +82,9 @@ function Get_library_version(libmpi)
82
82
83
83
@assert buflen[] < 8192
84
84
resize! (buf, buflen[])
85
- return String (buf)
86
- end
87
-
85
+ version_string = String (buf)
88
86
89
- """
90
- identify_abi(version_string)
91
-
92
- Identify the MPI implementation from the library version string
93
- """
94
- function identify_abi (version_string:: String )
87
+ # 2) try to identify the MPI implementation
95
88
impl = " unknown"
96
89
version = v " 0"
97
90
@@ -143,22 +136,30 @@ function identify_abi(version_string::String)
143
136
if (m = match (r" CRAY MPICH version (\d +.\d +.\d +)" , version_string)) != = nothing
144
137
version = VersionNumber (m. captures[1 ])
145
138
end
139
+ elseif startswith (version_string, " FUJITSU MPI" )
140
+ impl = " FujitsuMPI"
141
+ # "FUJITSU MPI Library 4.0.0 (4.0.1fj4.0.0)\0"
142
+ if (m = match (r" ^FUJITSU MPI Library (\d +.\d +.\d +)" , version_string)) != = nothing
143
+ version = VersionNumber (m. captures[1 ])
144
+ end
146
145
end
147
-
148
- # determine the abi from the implementation + version
146
+ # 3) determine the abi from the implementation + version
149
147
if (impl == " MPICH" && version >= v " 3.1" ||
150
148
impl == " IntelMPI" && version > v " 2014" ||
151
149
impl == " MVAPICH" && version >= v " 2" ||
152
150
impl == " CrayMPICH" && version >= v " 7" )
153
151
# https://www.mpich.org/abi/
154
152
abi = " MPICH"
155
- elseif impl == " OpenMPI" || impl == " IBMSpectrumMPI"
153
+ elseif impl == " OpenMPI" || impl == " IBMSpectrumMPI" || impl == " FujitsuMPI "
156
154
abi = " OpenMPI"
157
155
elseif impl == " MicrosoftMPI"
158
156
abi = " MicrosoftMPI"
159
157
else
160
158
abi = " unknown"
161
159
end
160
+
161
+ @info " MPI implementation" libmpi version_string impl version abi
162
+
162
163
return abi
163
164
end
164
165
0 commit comments