MPI.jl
MPI.jl copied to clipboard
Add mpiexecjl for windows
close #545
This is an attempt to have an mpiexecjl on windows. Currently, you have to call powershell.exe -File ...
This could be avoided if we did a .bat file calling a .ps1 file but I find this too ugly.
Can you please rebase on master
? CI situation should be much better now.
@giordano it is currently failing silently with some very weird error
could not load library "D:\a\MPI.jl\MPI.jl\test\C"
The specified module could not be found.
ERROR: failed process: Process(`'C:\Users\runneradmin\.julia\artifacts\4c2053ce1fd1b18af0517bdac687a718f567cdae\bin\mpiexec.exe' -n 4 'C:\hostedtoolcache\windows\julia\1.6.7\x64\bin\julia.exe' -Cnative -JC '\hostedtoolcache\windows\julia\1.6.7\x64\lib\julia\sys.dll' --depwarn=yes --check-bounds=yes -g1 --code-coverage=user --color=yes --startup-file=no --startup-file=no -q 'D:\a\MPI.jl\MPI.jl\test\..\docs\examples\01-hello.jl'`, ProcessExited(1)) [1]
It is misparsing the sysimage part -JC
should be -JC:\hostedtoolcache....
I have tried many things locally but could not solve the problem. Everytime I try to parse the command following command it comes out correctly.
run(`$(additional_initial_parts_cmd) $(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
I could not identify where it gets lost in the middle. Honestly, the $(julia) variable is used only for testing, we could simply write julia
directly without betting it with Base.julia_cmd()
and it would work correctly.
@giordano I fixed many things in the comments and got the Powershell script to not fail silently. It will rethrow the exit code of the underlying julia process.
From my perspective the only problem left now is that powershell is splitting the command line switch:
-JC:\hostedtoolcache\windows\julia\1.10.2\x64\lib\julia\sys.dll
into two separate ones
-JC
and \hostedtoolcache\windows\julia\1.10.2\x64\lib\julia\sys.dll
.
This happens in the PowerShell argument parsing. I am investigating how to avoid this behavior.
https://github.com/JuliaParallel/MPI.jl/actions/runs/8377054363/job/22938230315
Found some material on it https://github.com/PowerShell/PowerShell/issues/16432.
@giordano The only solution I found with Powershell was to replace the -J
for --sysimage=
in the julia_cmd
. I don't think that this is reasonable but it was the only thing that worked.