Skip to content

Commit fa100b9

Browse files
committed
Store full path of libmpi and mpiexec in deps.jl
This makes it slightly easier to use on clusters since it avoids the need to "module load mpiXXX" each time it is used, and makes it more robust if the wrong MPI library is loaded.
1 parent 4e6ad89 commit fa100b9

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

deps/build.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ end
3838
const libmpi = find_library(Sys.iswindows() ? "msmpi.dll" : "libmpi",
3939
MPI_LIBRARY_PATH !== nothing ? [MPI_LIBRARY_PATH] : [])
4040

41-
libptr = dlopen_e(libmpi)
42-
if libmpi == "" || libptr == C_NULL
43-
error("No MPI library found")
41+
if libmpi == ""
42+
error("No MPI library found.\nEnsure an MPI implementation is loaded, or set the `JULIA_MPI_PATH` variable.")
4443
end
45-
@info "Using MPI library $libmpi"
4644

47-
libpath = dlpath(libptr)
48-
libsize = filesize(libpath)
45+
# expand paths
46+
libmpi = dlpath(libmpi)
47+
libsize = filesize(libmpi)
48+
49+
mpiexec = Sys.which(mpiexec)
50+
51+
@info "Using MPI library $libmpi"
4952

5053
function Get_version()
5154
major = Ref{Cint}()

deps/gen_consts.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ MPI_pointers = [
104104
:MPI_STATUSES_IGNORE,
105105
]
106106

107+
const libptr = dlopen_e(libmpi)
107108

108109
open("gen_consts.c","w") do f
109110
print(f,"""

0 commit comments

Comments
 (0)