Skip to content

Commit

Permalink
Fixes #1: Tweak a few more parameters for cluster SSH usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed Nov 16, 2022
1 parent e227aa2 commit 5f0636e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ Here are a few of the results I've acquired in my testing:
|--- |--- |--- |--- |
| Turing Pi 2 (4x CM4 @ 1.5 GHz) | 44.942 Gflops | 24.5W | 1.83 Gflops/W |
| Turing Pi 2 (4x CM4 @ 2.0 GHz) | 51.327 Gflops | 33W | 1.54 Gflops/W |
| DeskPi Super6c (6x CM4 @ 1.5 GHz) | TODO Gflops | TODOW | TODO Gflops/W |
| DeskPi Super6c (6x CM4 @ 1.5 GHz) | 57.634 Gflops | 40W | 1.44 Gflops/W |
| M2 MacBook Air (1x M2 @ 3.5 GHz, in Docker) | 104.68 Gflops | TODOW | TODO Gflops/W |
13 changes: 6 additions & 7 deletions example.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ hpl_root: /opt/top500
ssh_user: pi
ssh_user_home: /home/pi

# Use this option if running on a single node.
# Replace ansible_memtotal_mb with cluster memory total if running on cluster.
ram_in_gb: "{{ ( ansible_memtotal_mb / 1024 * 0.75 ) | int | abs }}"

# Use this option if running on multiple nodes in a cluster; calculate manually.
# ram_in_gb: "44"

# Count the nodes for accurate HPL.dat calculations.
nodecount: "{{ ansible_play_hosts | length | int }}"

Expand All @@ -21,6 +18,8 @@ nodecount: "{{ ansible_play_hosts | length | int }}"
hpl_dat_opts:
# sqrt((Memory in GB * 1024 * 1024 * 1024 * Node count) / 8) * 0.9
Ns: "{{ (((((ram_in_gb | int) * 1024 * 1024 * 1024 * (nodecount | int)) / 8) | root) * 0.90) | int }}"
NBs: 192
Ps: 2
Qs: 2
NBs: 256
# (P * Q) should be roughly equivalent to total core count, with Qs higher.
# If running on a single system, Ps should be 1 and Qs should be core count.
Ps: 1
Qs: 4
9 changes: 9 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@
ssh {{ ssh_user }}@{{ item }} -o StrictHostKeyChecking=accept-new date
loop: "{{ host_ips }}"

- name: Write chunk of hosts information to the hosts file.
ansible.builtin.blockinfile:
path: /etc/hosts
marker: "# {mark} Ansible MPI host {{ item }}"
block: |
{{ hostvars[item].ansible_default_ipv4.address }} {{ item }} {{ item | replace('.local', '') }}
loop: "{{ groups['cluster'] }}"
become: true

- name: Run linpack benchmark.
hosts: cluster
become: false
Expand Down
4 changes: 2 additions & 2 deletions templates/mpi-node-config.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% for host in groups['cluster'] %}
{{ hostvars[host].ansible_default_ipv4.address }}:4
{% endfor %}
{{ hostvars[host].ansible_default_ipv4.address }}:{{ hostvars[host].ansible_processor_vcpus }}
{% endfor %}

0 comments on commit 5f0636e

Please sign in to comment.