@@ -29,7 +29,6 @@ mutable struct MPIManager <: ClusterManager
2929 mode:: TransportMode
3030
3131 launched:: Bool # Are the MPI processes running?
32- mpirun_cmd:: Cmd # How to start MPI processes
3332 launch_timeout:: Int # seconds
3433
3534 initialized:: Bool # All workers registered with us
@@ -51,10 +50,9 @@ mutable struct MPIManager <: ClusterManager
5150 receiving_done:: Channel{Nothing}
5251
5352 function MPIManager (; np:: Integer = Sys. CPU_THREADS,
54- mpirun_cmd:: Cmd = ` $mpiexec -n $np ` ,
5553 launch_timeout:: Real = 60.0 ,
5654 mode:: TransportMode = MPI_ON_WORKERS,
57- master_tcp_interface:: String = " " )
55+ master_tcp_interface:: String = " " )
5856 mgr = new ()
5957 mgr. np = np
6058 mgr. mpi2j = Dict {Int,Int} ()
@@ -64,7 +62,6 @@ mutable struct MPIManager <: ClusterManager
6462 # Only start MPI processes for MPI_ON_WORKERS
6563 mgr. launched = mode != MPI_ON_WORKERS
6664 @assert MPI. Initialized () == mgr. launched
67- mgr. mpirun_cmd = mpirun_cmd
6865 mgr. launch_timeout = launch_timeout
6966
7067 mgr. initialized = false
@@ -141,8 +138,10 @@ function Distributed.launch(mgr::MPIManager, params::Dict,
141138 end
142139 cookie = string (" :cookie_" ,Distributed. cluster_cookie ())
143140 setup_cmds = ` import MPIClusterManagers\; MPIClusterManagers.setup_worker'('$(mgr. ip) ,$(mgr. port) ,$cookie ')'`
144- mpi_cmd = ` $(mgr. mpirun_cmd) $(params[:exename ]) -e $(Base. shell_escape (setup_cmds)) `
145- open (detach (mpi_cmd))
141+ MPI. mpiexec () do mpiexec_cmd
142+ mpi_cmd = ` $mpiexec_cmd -n $(mgr. np) $(params[:exename ]) -e $(Base. shell_escape (setup_cmds)) `
143+ open (detach (mpi_cmd))
144+ end
146145 mgr. launched = true
147146 end
148147
0 commit comments