Skip to content

Commit fdb8b57

Browse files
authored
Merge pull request #29 from JuliaParallel/sb/mpiflags
add mpiflags and support exeflags
2 parents 28d9968 + c7dbf7b commit fdb8b57

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
version:
1616
- '1'
17-
- '1.5'
17+
- '1.6'
1818
- 'nightly'
1919
os:
2020
- ubuntu-latest

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
1111

1212
[compat]
1313
MPI = "0.14, 0.15, 0.19"
14-
julia = "1"
14+
julia = "1.6"
1515

1616
[extras]
1717
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

src/mpimanager.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ function Base.show(io::IO, mgr::MPIManager)
121121
print(io, "MPI.MPIManager(np=$(mgr.np),launched=$(mgr.launched),mode=$(mgr.mode))")
122122
end
123123

124+
Distributed.default_addprocs_params(::MPIManager) =
125+
merge(Distributed.default_addprocs_params(),
126+
Dict{Symbol,Any}(
127+
:mpiexec => nothing,
128+
:mpiflags => ``,
129+
))
124130
################################################################################
125131
# Cluster Manager functionality required by Base, mostly targeting the
126132
# MPI_ON_WORKERS case
@@ -138,8 +144,9 @@ function Distributed.launch(mgr::MPIManager, params::Dict,
138144
end
139145
cookie = string(":cookie_",Distributed.cluster_cookie())
140146
setup_cmds = `import MPIClusterManagers\;MPIClusterManagers.setup_worker'('$(mgr.ip),$(mgr.port),$cookie')'`
141-
MPI.mpiexec() do mpiexec_cmd
142-
mpi_cmd = `$mpiexec_cmd -n $(mgr.np) $(params[:exename]) -e $(Base.shell_escape(setup_cmds))`
147+
MPI.mpiexec() do mpiexec
148+
mpiexec = something(params[:mpiexec], mpiexec)
149+
mpi_cmd = `$mpiexec $(params[:mpiflags]) -n $(mgr.np) $(params[:exename]) $(params[:exeflags]) -e $(Base.shell_escape(setup_cmds))`
143150
open(detach(mpi_cmd))
144151
end
145152
mgr.launched = true

0 commit comments

Comments
 (0)