-
Notifications
You must be signed in to change notification settings - Fork 225
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
MPICH support #478
Closed
Closed
MPICH support #478
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4421847
Initial support for MPICH
sheevy 8e42d24
Correct the source image used by MPICH docker image
sheevy 41ed59d
Improve docs
sheevy 8341e0a
Add mpich docker images to makefile
sheevy 7c1ae22
Initial version for testing
sheevy 4e15756
Initial support for MPICH
sheevy 98febe8
Correct the source image used by MPICH docker image
sheevy c83c7e7
Improve docs
sheevy e8c7520
Add mpich docker images to makefile
sheevy 837cb3d
Initial version for testing
sheevy cb5d915
Merge branch 'master' of github.com:sheevy/mpi-operator
sheevy c7b3faf
Temporary: manual trigger
sheevy 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: build | ||
on: [push, pull_request] | ||
on: [push, pull_request, workflow_dispatch] | ||
jobs: | ||
validate: | ||
name: Validate | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM debian:buster as builder | ||
|
||
RUN apt update \ | ||
&& apt install -y --no-install-recommends \ | ||
g++ \ | ||
libmpich-dev \ | ||
&& rm -rf /var/lib/apt/lists/* |
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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
function resolve_host() { | ||
host="$1" | ||
check="nslookup $host" | ||
max_retry=10 | ||
counter=0 | ||
backoff=0.1 | ||
until $check > /dev/null | ||
do | ||
if [ $counter -eq $max_retry ]; then | ||
echo "Couldn't resolve $host" | ||
return | ||
fi | ||
sleep $backoff | ||
echo "Couldn't resolve $host... Retrying" | ||
((counter++)) | ||
backoff=$(echo - | awk "{print $backoff + $backoff}") | ||
done | ||
echo "Resolved $host" | ||
} | ||
|
||
if [ "$K_MPI_JOB_ROLE" == "launcher" ]; then | ||
resolve_host "$HOSTNAME" | ||
cat /etc/mpi/hostfile | while read host | ||
do | ||
resolve_host $host | ||
done | ||
fi | ||
|
||
exec "$@" |
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,8 @@ | ||
FROM mpioperator/base | ||
|
||
RUN apt update \ | ||
&& apt install -y --no-install-recommends mpich dnsutils \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY mpich-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
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 |
---|---|---|
|
@@ -121,6 +121,7 @@ spec: | |
enum: | ||
- OpenMPI | ||
- Intel | ||
- MPICH | ||
type: string | ||
mpiReplicaSpecs: | ||
properties: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM mpioperator/mpich-builder as builder | ||
|
||
COPY pi.cc /src/pi.cc | ||
RUN mpic++ /src/pi.cc -o /pi | ||
|
||
FROM mpioperator/mpich | ||
|
||
COPY --from=builder /pi /home/mpiuser/pi |
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,54 @@ | ||
apiVersion: kubeflow.org/v2beta1 | ||
kind: MPIJob | ||
metadata: | ||
name: pi | ||
spec: | ||
slotsPerWorker: 1 | ||
runPolicy: | ||
cleanPodPolicy: Running | ||
sshAuthMountPath: /home/mpiuser/.ssh | ||
mpiImplementation: MPICH | ||
mpiReplicaSpecs: | ||
Launcher: | ||
replicas: 1 | ||
template: | ||
spec: | ||
containers: | ||
- image: mpioperator/mpi-pi:mpich | ||
imagePullPolicy: Always | ||
name: mpi-launcher | ||
securityContext: | ||
runAsUser: 1000 | ||
args: | ||
- mpirun | ||
- -n | ||
- "2" | ||
- /home/mpiuser/pi | ||
resources: | ||
limits: | ||
cpu: 1 | ||
memory: 1Gi | ||
Worker: | ||
replicas: 2 | ||
template: | ||
spec: | ||
containers: | ||
- image: mpioperator/mpi-pi:mpich | ||
imagePullPolicy: Always | ||
name: mpi-worker | ||
securityContext: | ||
runAsUser: 1000 | ||
command: | ||
args: | ||
- /usr/sbin/sshd | ||
- -De | ||
- -f | ||
- /home/mpiuser/.sshd_config | ||
readinessProbe: | ||
tcpSocket: | ||
port: 2222 | ||
initialDelaySeconds: 2 | ||
resources: | ||
limits: | ||
cpu: 1 | ||
memory: 1Gi |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.
Does anyone know how to figure out what should be provided here?
Interestingly, the pi example works as is, i.e. with mpichSlotsEnv == TODO
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.
This should be the name of the environment variable for configuring the number of workers per host.
It works in the sense that it runs, because this would just set an environment variable called TODO. But it's not doing the intended outcome.
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.
There's
-ppn
command line option (both for Intel and MPICH), but I don't think it can be controlled via an environemnt variableThere 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.
In general, it's hard to overwrite the command line, because users might be using wrappers around
mpiexec
. That's why environment variables is better. Another option that openMPI and Intel MPI support is to set them in the hostfile.Actually, it might be useful to use that in general because of this #445