Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mpiexecjl for windows #783

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

guilhermebodin
Copy link

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.

@giordano
Copy link
Member

giordano commented Nov 3, 2023

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

@guilhermebodin
Copy link
Author

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

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is currently failing silently with some very weird error

Why is the error silent and not loud? Sounds like that should be fixed.

It is misparsing the sysimage part

Where is this parsing happening?

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.

No, it wouldn't: #706, JuliaLang/julia#48039 (comment)

bin/mpiexecjl_windows.ps1 Outdated Show resolved Hide resolved
@guilhermebodin
Copy link
Author

guilhermebodin commented Mar 21, 2024

@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
Copy link
Author

Found some material on it PowerShell/PowerShell#16432.

@guilhermebodin
Copy link
Author

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

# If pkgimage is set, malloc_log and code_coverage should not
@assert opts.malloc_log == 0 && opts.code_coverage == 0
end
return `$julia -C$cpu_target --sysimage=$image_file $addflags`
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only edited this part of the Base.julia_cmd() function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mpiexecjl should use a PowerShell on Windows.
2 participants