diff --git a/src/submission/ChildProcess.jl b/src/submission/ChildProcess.jl index 3d17c2a0e..c62af772f 100644 --- a/src/submission/ChildProcess.jl +++ b/src/submission/ChildProcess.jl @@ -72,11 +72,9 @@ function pigeons(pt_arguments, new_process::ChildProcess) # write("output.txt", merge(oc)) run(julia_cmd, wait = new_process.wait) else - mpiexec() do exe - mpi_cmd = `$exe $(new_process.mpiexec_args) -n $(new_process.n_local_mpi_processes)` - cmd = `$mpi_cmd $julia_cmd` - run(cmd, wait = new_process.wait) - end + mpi_cmd = `$(mpiexec()) $(new_process.mpiexec_args) -n $(new_process.n_local_mpi_processes)` + cmd = `$mpi_cmd $julia_cmd` + run(cmd, wait = new_process.wait) end return Result{PT}(exec_folder) end diff --git a/test/supporting/mpi_test_utils.jl b/test/supporting/mpi_test_utils.jl index 7adeb0bb6..f521571ac 100644 --- a/test/supporting/mpi_test_utils.jl +++ b/test/supporting/mpi_test_utils.jl @@ -6,10 +6,8 @@ function mpi_test(n_processes::Int, test_file::String; options = []) project_dir = dirname(project_file) run(`$jl_cmd --project=$project_dir -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"`) resolved_test_file = abspath(test_file) - mpiexec() do exe - mpi_args = extra_mpi_args() - run(`$exe $mpi_args -n $n_processes $jl_cmd -t 2 --project=$project_dir $resolved_test_file $options`) - end + mpi_args = extra_mpi_args() + run(`$(mpiexec()) $mpi_args -n $n_processes $jl_cmd -t 2 --project=$project_dir $resolved_test_file $options`) end function set_n_mpis_to_one_on_windows(default_n_mpis::Int)