-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
guilhermebodin
wants to merge
6
commits into
JuliaParallel:master
Choose a base branch
from
guilhermebodin:gb/add_mpiexec_windows
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8b3b8fa
add mpiexecjl for windows
guilhermebodin 98c24a0
small fixes for tests
guilhermebodin 6a627ea
Merge branch 'JuliaParallel:master' into gb/add_mpiexec_windows
guilhermebodin ce902a7
fix exit code and print $args received by ps1
guilhermebodin 1229988
[no ci] back with --startup-file=no and -q in mpiexec test.
guilhermebodin 3603c6a
add a version of julia_cmd with --sysimage=
guilhermebodin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Copyright (C) 2023 Guilherme Bodin | ||
# License is MIT "Expat" | ||
# | ||
# Commentary: | ||
# | ||
# Command line utility to call the `mpiexec` binary used by the `MPI.jl` version | ||
# in the given Julia project. It has the same syntax as the `mpiexec` binary | ||
# that would be called, with the additional `--project=...` flag to select a | ||
# different Julia project. | ||
# | ||
# Examples of usage (the MPI flags available depend on the MPI implementation | ||
# called): | ||
# | ||
# $ mpiexecjl -n 40 julia mpi-script.jl | ||
# $ mpiexecjl --project=my_experiment -n 80 --oversubscribe julia mpi-script.jl | ||
|
||
function usage { | ||
Write-Host "Usage: $([System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Name)) [--project=...] MPIEXEC_ARGUMENTS..." | ||
Write-Host "Call the mpiexec binary in the Julia environment specified by the --project option." | ||
Write-Host "If no project is specified, the MPI associated with the global Julia environment will be used." | ||
Write-Host "All other arguments are forwarded to mpiexec." | ||
} | ||
|
||
$julia_args = @() | ||
$PROJECT_ARG = "" | ||
|
||
echo $args | ||
|
||
foreach ($arg in $args) { | ||
if ($arg -match "^--project(=.*)?$") { | ||
$PROJECT_ARG = $arg | ||
} | ||
elseif ($arg -eq "-h" -or $arg -eq "--help") { | ||
$helpRequested = $true | ||
usage | ||
Write-Host "Below is the help of the current mpiexec." | ||
Write-Host | ||
exit 0 | ||
} | ||
else { | ||
$julia_args += $arg | ||
} | ||
} | ||
|
||
if (-not $julia_args) { | ||
Write-Error "ERROR: no arguments specified." | ||
usage | ||
exit 1 | ||
} | ||
|
||
if ($env:JULIA_BINDIR) { | ||
$JULIA_CMD = Join-Path $env:JULIA_BINDIR "julia" | ||
} else { | ||
$JULIA_CMD = "julia" | ||
} | ||
|
||
$SCRIPT = @' | ||
using MPI | ||
ENV[\"JULIA_PROJECT\"] = dirname(Base.active_project()) | ||
try | ||
mpiexec(exe -> run(`$exe $ARGS`)) | ||
catch e | ||
rethrow(e) | ||
end | ||
'@ | ||
|
||
$PRECOMPILATION_SCRIPT = @' | ||
println(\"precompiling current project before running MPI\") | ||
|
||
import Pkg | ||
Pkg.activate(dirname(Base.active_project())) | ||
Pkg.instantiate() | ||
|
||
println(\"precompilation finished\") | ||
'@ | ||
|
||
& $JULIA_CMD $PROJECT_ARG -e $PRECOMPILATION_SCRIPT | ||
|
||
if ($PROJECT_ARG) { | ||
& $JULIA_CMD $PROJECT_ARG --color=yes --startup-file=no --compile=min -O0 -e $SCRIPT -- $julia_args | ||
} else { | ||
& $JULIA_CMD --color=yes --startup-file=no --compile=min -O0 -e $SCRIPT -- $julia_args | ||
} | ||
|
||
# Guarantees that we will exit .ps1 with the same process status as the last command executed | ||
exit $lastExitCode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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