MPI.jl icon indicating copy to clipboard operation
MPI.jl copied to clipboard

Add mpiexecjl for windows

Open guilhermebodin opened this issue 1 year ago • 5 comments

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.

guilhermebodin avatar Oct 16 '23 18:10 guilhermebodin

Can you please rebase on master? CI situation should be much better now.

giordano avatar Nov 03 '23 19:11 giordano

@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.

guilhermebodin avatar Feb 26 '24 21:02 guilhermebodin

@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

guilhermebodin avatar Mar 21 '24 16:03 guilhermebodin

Found some material on it https://github.com/PowerShell/PowerShell/issues/16432.

guilhermebodin avatar Mar 22 '24 02:03 guilhermebodin

@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.

guilhermebodin avatar Mar 22 '24 14:03 guilhermebodin