-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
238d6cf
commit dd39414
Showing
14 changed files
with
124 additions
and
90 deletions.
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
|
||
mpi_user: mpiuser | ||
mpi_data: /srv/mpi_data | ||
mpi_data_master_public_key_file: "{{ mpi_data }}/.id_rsa.pub" | ||
mpi_data_share: /srv/mpi_data_share | ||
shared_master_public_key_file_path: "{{ mpi_data_share }}/.id_rsa.pub" | ||
|
||
mpi_hosts_file: /etc/mpi_hosts |
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,11 @@ | ||
--- | ||
|
||
- hosts: all | ||
become: yes | ||
tasks: | ||
- include: tasks/create_hosts_file.yml | ||
|
||
- hosts: master | ||
become: yes | ||
roles: | ||
- mpi_master |
3 changes: 1 addition & 2 deletions
3
provisioning/roles/mpi/tasks/main.yml → provisioning/roles/mpi_base/tasks/main.yml
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,10 +1,9 @@ | ||
--- | ||
|
||
- name: Install OpenMPI | ||
- name: Ensure OpenMPI present | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
update_cache: yes | ||
with_items: | ||
- libopenmpi-dev | ||
- openmpi-bin |
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,4 +1,5 @@ | ||
--- | ||
|
||
dependencies: | ||
- { role: geerlingguy.nfs, nfs_exports: [ "{{ mpi_data }} *(ro,sync,no_root_squash)" ] } | ||
- { role: mpi_base } | ||
- { role: geerlingguy.nfs, nfs_exports: [ "{{ mpi_data_share }} *(ro,sync,no_root_squash)" ] } |
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,4 @@ | ||
--- | ||
|
||
dependencies: | ||
- { role: mpi_base } |
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,11 @@ | ||
--- | ||
|
||
- hosts: all | ||
become: yes | ||
tasks: | ||
- include: tasks/create_hosts_file.yml | ||
|
||
- hosts: slaves | ||
become: yes | ||
roles: | ||
- mpi_slave |
2 changes: 1 addition & 1 deletion
2
provisioning/hosts.yml → provisioning/tasks/create_hosts_file.yml
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
|
||
# Procedural process for testing that MPI is working across the cluster. Should perhaps be a script. | ||
|
||
- hosts: master | ||
become: yes | ||
vars: | ||
- mpi_tutorial_zip: 'https://github.com/wesleykendall/mpitutorial/archive/master.zip' | ||
- mpi_tutorial_repo_dest: "{{ mpi_data_share }}/mpitutorial-master" | ||
tasks: | ||
- name: Ensure Unzip present | ||
apt: | ||
name: unzip | ||
state: present | ||
|
||
- name: Extract MPI Tutorial project | ||
unarchive: | ||
src: 'https://github.com/wesleykendall/mpitutorial/archive/master.zip' | ||
dest: "{{ mpi_data_share }}" | ||
remote_src: yes | ||
|
||
- name: Make Hello World project | ||
make: | ||
chdir: "{{ mpi_tutorial_repo_dest }}/tutorials/mpi-hello-world/code" | ||
|
||
- name: Run Hello World program | ||
shell: "su mpiuser -c 'mpirun --hostfile {{ mpi_hosts_file }} mpi_hello_world'" | ||
args: | ||
chdir: "{{ mpi_tutorial_repo_dest }}/tutorials/mpi-hello-world/code" | ||
register: hello_world_result | ||
|
||
- name: Output result of Hello World program | ||
debug: | ||
msg: "{{ hello_world_result.stdout_lines }}" | ||
|
||
- name: Processor ran on all slaves | ||
assert: | ||
that: "hello_world_result.stdout.find('Hello world from processor {{ item }}') != -1" | ||
msg: "{{ item }} failed to run the processor. Increase verbosity to more about the error." | ||
with_items: "{{ groups['slaves'] }}" | ||
|
||
- name: Clean up after test | ||
file: | ||
path: "{{ mpi_tutorial_repo_dest }}" | ||
state: absent |