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

JuliaParallel / MPI.jl / 18750138884

23 Oct 2025 01:33PM UTC coverage: 60.865% (+0.6%) from 60.288%
18750138884

push

github

web-flow
Merge pull request #916 from JuliaParallel/eschnett-patch-1

Remove duplicated if branch

1577 of 2591 relevant lines covered (60.86%)

6756.05 hits per line

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

82.98
/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()
10✔
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)
10✔
14
    buflen = Ref{Cint}()
10✔
15

16
    API.MPI_Get_library_version(buf, buflen)
10✔
17
    @assert buflen[] < 8192
10✔
18
    resize!(buf, buflen[])
15✔
19
    return String(buf)
10✔
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()
67✔
67
    major = Ref{Cint}()
74✔
68
    minor = Ref{Cint}()
74✔
69
    API.MPI_Get_version(major, minor)
74✔
70
    VersionNumber(major[], minor[])
74✔
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)
20✔
90
    println(io, "MPIPreferences:")
20✔
91
    println(io, "  binary:  ", MPIPreferences.binary)
10✔
92
    println(io, "  abi:     ", MPIPreferences.abi)
10✔
93
    if MPIPreferences.binary == "system"
10✔
94
        println(io, "  libmpi:  ", MPIPreferences.System.libmpi)
×
95
        println(io, "  mpiexec: ", MPIPreferences.System.mpiexec_path)
×
96
    end
97
    println(io)
10✔
98
    println(io, "Package versions")
10✔
99
    println(io, "  MPI.jl:             ", PkgVersion.@Version)
10✔
100
    println(io, "  MPIPreferences.jl:  ", PkgVersion.Version(MPIPreferences))
10✔
101
    if MPIPreferences.binary == "MPICH_jll"
10✔
102
        println(io, "  MPICH_jll:          ", PkgVersion.Version(API.MPICH_jll))
6✔
103
    elseif MPIPreferences.binary == "OpenMPI_jll"
4✔
104
        println(io, "  OpenMPI_jll:        ", PkgVersion.Version(API.OpenMPI_jll))
×
105
    elseif MPIPreferences.binary == "MicrosoftMPI_jll"
4✔
106
        println(io, "  MicrosoftMPI_jll:   ", PkgVersion.Version(API.MicrosoftMPI_jll))
4✔
107
    elseif MPIPreferences.binary == "MPItrampoline_jll"
×
108
        println(io, "  MPItrampoline_jll   ", PkgVersion.Version(API.MPItrampoline_jll))
×
109
    end
110

111
    println(io)
10✔
112
    println(io, "Library information:")
10✔
113
    println(io, "  libmpi:  ", API.libmpi)
10✔
114
    println(io, "  libmpi dlpath:  ", Libdl.dlpath(API.libmpi))
15✔
115
    println(io, "  MPI version:  ", Get_version())
10✔
116
    println(io, "  Library version:  ")
10✔
117
    for line in split(Get_library_version(), '\n')
10✔
118
        println(io, "    ", line)
75✔
119
    end
35✔
120
    println(io, "  MPI launcher: ", mpiexec()[1])
10✔
121
    mpiexec_path = Sys.which(mpiexec()[1])
10✔
122
    if !isnothing(mpiexec_path)
20✔
123
        println(io, "  MPI launcher path: ", mpiexec_path)
10✔
124
    end
125
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