• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaParallel / MPI.jl / 16589599617

29 Jul 2025 07:29AM UTC coverage: 63.158%. Remained the same
16589599617

push

github

web-flow
Bump AMDGPU (#910)

1752 of 2774 relevant lines covered (63.16%)

4142.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.63
/src/implementations.jl
1

2
# This is required in addition to __init__() so that we can call library at precompilation time.
3
if Sys.isunix()
4
    Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL)
5
end
6

7

8
function Get_library_version()
11✔
9
    # There is no way to query at runtime what the length of the buffer should be.
10
    # https://github.com/mpi-forum/mpi-issues/issues/159
11
    # 8192 is the maximum value of MPI_MAX_LIBRARY_VERSION_STRING across known
12
    # implementations.
13
    buf = Array{UInt8}(undef, 8192)
11✔
14
    buflen = Ref{Cint}()
11✔
15

16
    API.MPI_Get_library_version(buf, buflen)
11✔
17
    @assert buflen[] < 8192
11✔
18
    resize!(buf, buflen[])
16✔
19
    return String(buf)
11✔
20
end
21

22
"""
23
    MPI_LIBRARY_VERSION_STRING :: String
24

25
The full version string provided by the library
26

27
# External links
28
$(_doc_external("MPI_Get_library_version"))
29
"""
30
const MPI_LIBRARY_VERSION_STRING = Get_library_version()
31

32
"""
33
    impl, version = identify_implementation()
34

35
Attempt to identify the MPI implementation based on
36
[`MPI_LIBRARY_VERSION_STRING`](@ref). Returns a triple of values:
37

38
- `impl`: a `String` with the name of the MPI implementation, or `"unknown"` if it cannot be determined,
39
- `version`: a `VersionNumber` of the library, or `nothing` if it cannot be determined.
40

41
This function is only intended for internal use. Users should use [`MPI_LIBRARY`](@ref),
42
[`MPI_LIBRARY_VERSION`](@ref).
43
"""
44
function identify_implementation()
×
45
    impl, version, abi = MPIPreferences.identify_implementation_version_abi(MPI_LIBRARY_VERSION_STRING)
×
46
    return impl, version
×
47
end
48

49
const MPI_LIBRARY, MPI_LIBRARY_VERSION = identify_implementation()
50

51
"""
52
    MPI_LIBRARY :: String
53

54
The current MPI implementation: this is determined by
55
"""
56
MPI_LIBRARY
57

58
"""
59
    MPI_LIBRARY_VERSION :: VersionNumber
60

61
The version of the MPI library
62
"""
63
MPI_LIBRARY_VERSION
64

65

66
function Get_version()
70✔
67
    major = Ref{Cint}()
75✔
68
    minor = Ref{Cint}()
75✔
69
    API.MPI_Get_version(major, minor)
75✔
70
    VersionNumber(major[], minor[])
75✔
71
end
72

73
"""
74
    MPI_VERSION :: VersionNumber
75

76
The supported version of the MPI standard.
77

78
# External links
79
$(_doc_external("MPI_Get_version"))
80
"""
81
const MPI_VERSION = Get_version()
82

83
using PkgVersion
84
"""
85
    MPI.versioninfo(io::IO=stdout)
86

87
Print a summary of the current MPI configuration.
88
"""
89
function versioninfo(io::IO=stdout)
22✔
90
    println(io, "MPIPreferences:")
22✔
91
    println(io, "  binary:  ", MPIPreferences.binary)
11✔
92
    println(io, "  abi:     ", MPIPreferences.abi)
11✔
93
    if MPIPreferences.binary == "system"
11✔
94
        println(io, "  libmpi:  ", MPIPreferences.System.libmpi)
×
95
        println(io, "  mpiexec: ", MPIPreferences.System.mpiexec_path)
×
96
    end
97
    println(io)
11✔
98
    println(io, "Package versions")
11✔
99
    println(io, "  MPI.jl:             ", PkgVersion.@Version)
11✔
100
    println(io, "  MPIPreferences.jl:  ", PkgVersion.Version(MPIPreferences))
11✔
101
    if MPIPreferences.binary == "MPICH_jll"
11✔
102
        println(io, "  MPICH_jll:          ", PkgVersion.Version(API.MPICH_jll))
7✔
103
    elseif MPIPreferences.binary == "OpenMPI_jll"
4✔
104
        println(io, "  OpenMPI_jll:        ", PkgVersion.Version(API.OpenMPI_jll))
×
105
    elseif MPIPreferences.binary == "OpenMPI_jll"
4✔
106
        println(io, "  OpenMPI_jll:        ", PkgVersion.Version(API.OpenMPI_jll))
×
107
    elseif MPIPreferences.binary == "MicrosoftMPI_jll"
4✔
108
        println(io, "  MicrosoftMPI_jll:   ", PkgVersion.Version(API.MicrosoftMPI_jll))
4✔
109
    elseif MPIPreferences.binary == "MPItrampoline_jll"
×
110
        println(io, "  MPItrampoline_jll   ", PkgVersion.Version(API.MPItrampoline_jll))
×
111
    end
112

113
    println(io)
11✔
114
    println(io, "Library information:")
11✔
115
    println(io, "  libmpi:  ", API.libmpi)
11✔
116
    println(io, "  libmpi dlpath:  ", Libdl.dlpath(API.libmpi))
16✔
117
    println(io, "  MPI version:  ", Get_version())
11✔
118
    println(io, "  Library version:  ")
11✔
119
    for line in split(Get_library_version(), '\n')
11✔
120
        println(io, "    ", line)
86✔
121
    end
46✔
122
    println(io, "  MPI launcher: ", mpiexec()[1])
11✔
123
    mpiexec_path = Sys.which(mpiexec()[1])
11✔
124
    if !isnothing(mpiexec_path)
22✔
125
        println(io, "  MPI launcher path: ", mpiexec_path)
11✔
126
    end
127
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc