From 67b04a9ab4f2dda453f6f75a5ef01c2637b70b33 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 8 Nov 2022 20:42:34 -0600 Subject: [PATCH] Initial commit. --- .github/FUNDING.yml | 4 + .github/stale.yml | 56 +++++++++ .github/workflows/ci.yml | 31 +++++ .gitignore | 1 + .yamllint | 11 ++ README.md | 70 +++++++++++ ansible.cfg | 5 + config.yml | 15 +++ example.hosts.ini | 14 +++ main.yml | 207 ++++++++++++++++++++++++++++++++ templates/HPL.dat.j2 | 37 ++++++ templates/benchmark-Make.rpi.j2 | 180 +++++++++++++++++++++++++++ templates/mpi-node-config.j2 | 3 + 13 files changed, 634 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/stale.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 .yamllint create mode 100644 README.md create mode 100644 ansible.cfg create mode 100644 config.yml create mode 100644 example.hosts.ini create mode 100644 main.yml create mode 100644 templates/HPL.dat.j2 create mode 100644 templates/benchmark-Make.rpi.j2 create mode 100644 templates/mpi-node-config.j2 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..96b4938 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms +--- +github: geerlingguy +patreon: geerlingguy diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..c7ff127 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,56 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 90 + +# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +daysUntilClose: 30 + +# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) +onlyLabels: [] + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - pinned + - security + - planned + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: false + +# Set to true to ignore issues with an assignee (defaults to false) +exemptAssignees: false + +# Label to use when marking as stale +staleLabel: stale + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +pulls: + markComment: |- + This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution! + + Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale. + + unmarkComment: >- + This pull request is no longer marked for closure. + + closeComment: >- + This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details. + +issues: + markComment: |- + This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! + + Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale. + + unmarkComment: >- + This issue is no longer marked for closure. + + closeComment: >- + This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..314a930 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +--- +name: CI +'on': + pull_request: + push: + branches: + - master + +jobs: + + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Check out the codebase. + uses: actions/checkout@v2 + + - name: Set up Python 3. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install test dependencies. + run: pip3 install yamllint ansible + + - name: Lint all the YAMLs. + run: yamllint . + + - name: Run the HPL benchmark playbook without networking. + run: ansible-playbook main.yml --tags "setup,benchmark" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..788482a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hosts.ini diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..f242855 --- /dev/null +++ b/.yamllint @@ -0,0 +1,11 @@ +--- +extends: default +rules: + line-length: + max: 140 + level: warning + truthy: false + +ignore: | + **/.github/workflows/ci.yml + **/stale.yml diff --git a/README.md b/README.md new file mode 100644 index 0000000..12d831a --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# Top500 Benchmark - HPL Linpack + +[![CI](https://github.com/geerlingguy/top500-benchmark/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/geerlingguy/top500-benchmark/actions?query=workflow%3ACI) + +A common generic benchmark for clusters (or extremly powerful single node workstations) is Linpack, or HPL (High Performance Linpack), which is famous for its use in rankings in the [Top500 supercomputer list](https://top500.org) over the past few decades. + +I wanted to see where my various clusters and workstations would rank, historically ([you can compare to past lists here](https://hpl-calculator.sourceforge.net/hpl-calculations.php)), so I built this Ansible playbook which installs all the necessary tooling for HPL to run, connects all the nodes together via SSH, then runs the benchmark and outputs the result. + +## Why not PTS? + +Phoronix Test Suite includes [HPL Linpack](https://openbenchmarking.org/test/pts/hpl) and [HPCC](https://openbenchmarking.org/test/pts/hpcc) test suites. I may see how they compare in the future. + +When I initially started down this journey, the PTS versions didn't play nicely with the Pi, especially when clustered. And the PTS versions don't seem to support clustered usage at all! + +## Benchmarking - Cluster + +Make sure you have Ansible installed (`pip3 install ansible`), then set up a `hosts.ini` file in this directory based on the `example.hosts.ini` file. + +Each host should be reachable via SSH using the username set in `ansible_user`. Other Ansible options can be set under `[cluster:vars]` to connect in more exotic clustering scenarios (e.g. via bastion/jump-host). + +Tweak any settings inside `config.yml` as desired (the most important being `hpl_root`—this is where the compiled MPI, ATLAS, and HPL benchmarking code will live). + +Then run the benchmarking playbook inside this directory: + +``` +ansible-playbook main.yml +``` + +This will run three separate plays: + + 1. Setup: downloads and compiles all the code required to run HPL. (This play takes a long time—up to many hours on a slower Raspberry Pi!) + 2. SSH: configures the nodes to be able to communicate with each other. + 3. Benchmark: creates an `HPL.dat` file and runs the benchmark, outputting the results in your console. + +After the entire playbook is complete, you can also log directly into any of the nodes (though I generally do things on node 1), and run the following commands to kick off a benchmarking run: + +``` +cd ~/tmp/hpl-2.3/bin/rpi +mpirun -f cluster-hosts ./xhpl +``` + +> The configuration here was tested on smaller 1, 4, and 6-node clusters with 6-64 GB of RAM. Some settings in the `config.yml` file that affect the generated `HPL.dat` file may need diffent tuning for different cluster layouts! + +### Benchmarking a Single Node + +To run locally on a single node, clone or download this repository to the node where you want to run HPL. Make sure the `hosts.ini` is set up with the default options (with just one node, `127.0.0.1`). + +Then, run the following command so the cluster networking portion of the playbook is not run: + +``` +ansible-playbook main.yml --tags "setup,benchmark" +``` + +> For testing, you can start an Ubuntu docker container: +> +> ``` +> docker run -it --rm -v $PWD:/code geerlingguy/docker-ubuntu2204-ansible:latest bash +> ``` +> +> Then go into the code directory (`cd /code`) and run the playbook using the command above. + +## Results + +In my testing on Raspberry Pi OS Bullseye, in November 2021, I got the following results: + +| Benchmark | Configuration | Result | Wattage | Gflops/W | +| --- | --- | --- | --- | --- | +| HPL (1.5 GHz default clock) | Turing Pi 2 (4x CM4) | 44.942 Gflops | 24.5W | 1.83 Gflops/W | +| HPL (2.0 GHz overclock) | Turing Pi 2 (4x CM4) | 51.327 Gflops | 33W | 1.54 Gflops/W | +| HPL (1.5 GHz default clock) | DeskPi Super6c (6x CM4) | TODO Gflops | TODOW | TODO Gflops/W | diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..0cf488d --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,5 @@ +[defaults] +nocows = true +inventory = hosts.ini +interpreter_python = /usr/bin/python3 +stdout_callback = yaml diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..14c3a88 --- /dev/null +++ b/config.yml @@ -0,0 +1,15 @@ +--- +# Working directory where HPL and associated applications will be compiled. +hpl_root: /home/pi + +# HPL.dat configuration options. +# See: https://www.advancedclustering.com/act_kb/tune-hpl-dat-file/ +# See also: https://hpl-calculator.sourceforge.net/HPL-HowTo.pdf +nodecount: "{{ ansible_play_hosts | length | int }}" +ram_in_gb: "{{ ( ansible_memtotal_mb / 1024 * 0.75 ) | int | abs }}" +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 diff --git a/example.hosts.ini b/example.hosts.ini new file mode 100644 index 0000000..58edc03 --- /dev/null +++ b/example.hosts.ini @@ -0,0 +1,14 @@ +# For single node benchmarking (default), use this: +[cluster] +127.0.0.1 ansible_connection=local + +# For cluster benchmarking, delete everything above this line and uncomment: +# [cluster] +# node-01.local +# node-02.local +# node-03.local +# node-04.local +# node-05.local +# +# [cluster:vars] +# ansible_user=username diff --git a/main.yml b/main.yml new file mode 100644 index 0000000..cdcb1a3 --- /dev/null +++ b/main.yml @@ -0,0 +1,207 @@ +--- +# Automated setup of distributed Linpack benchmark. +# +# Inspired by: https://mikejmcfarlane.github.io/blog/2020/09/17/High-Performance-Linpack-for-raspberry-pi-supercomputer +# See also: https://www.sci-pi.org.uk/bench/linpack.html + +- name: Install linpack benchmark. + hosts: cluster + become: false + tags: ['setup'] + + vars_files: ['config.yml'] + + tasks: + - name: Update apt cache. + apt: + update_cache: true + cache_valid_time: 600 + when: ansible_os_family == 'Debian' + + - name: Install dependencies. + ansible.builtin.apt: + name: + - gfortran + - automake + state: present + become: true + + - name: Create required temporary directories. + ansible.builtin.file: + path: "{{ item }}" + state: directory + mode: 0755 + loop: + - "{{ hpl_root }}/tmp" + - "{{ hpl_root }}/tmp/atlas-build" + + - name: Download MPI (Message Passing Interface). + ansible.builtin.unarchive: + src: https://www.mpich.org/static/downloads/3.4.2/mpich-3.4.2.tar.gz + dest: "{{ hpl_root }}/tmp" + remote_src: true + creates: "{{ hpl_root }}/tmp/mpich-3.4.2/README" + + - name: Build MPI (takes a while). + ansible.builtin.command: "{{ item }}" + args: + chdir: "{{ hpl_root }}/tmp/mpich-3.4.2" + creates: "{{ hpl_root }}/tmp/COMPILE_MPI_COMPLETE" + loop: + - ./configure --with-device=ch3:sock FFLAGS=-fallow-argument-mismatch + - make -j4 + + - name: Install MPI. + ansible.builtin.command: make install + args: + chdir: "{{ hpl_root }}/tmp/mpich-3.4.2" + creates: "{{ hpl_root }}/tmp/COMPILE_MPI_COMPLETE" + become: true + + - name: Create 'COMPILE_MPI_COMPLETE' file. + file: + path: "{{ hpl_root }}/tmp/COMPILE_MPI_COMPLETE" + state: touch + mode: 0644 + + - name: Test if we can set CPU scaling parameters. + ansible.builtin.command: >- + ls /sys/devices/system/cpu/cpu0/cpufreq + failed_when: false + changed_when: false + register: cpufreq_exists + + # Note: There was no simpler way to do this besides `shell`. + - name: Ensure CPU scaling is set to 'performance'. + ansible.builtin.shell: >- + echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + when: cpufreq_exists.rc == 0 + + - name: Download ATLAS linear algebra library. + ansible.builtin.unarchive: + src: https://sourceforge.net/projects/math-atlas/files/Stable/3.10.3/atlas3.10.3.tar.bz2 + dest: "{{ hpl_root }}/tmp" + remote_src: true + creates: "{{ hpl_root }}/tmp/ATLAS/README" + + - name: Install ATLAS (takes a LONG time). + ansible.builtin.command: "{{ item }}" + args: + chdir: "{{ hpl_root }}/tmp/atlas-build" + creates: "{{ hpl_root }}/tmp/COMPILE_ATLAS_COMPLETE" + loop: + - ../ATLAS/configure + - make + + - name: Create 'COMPILE_ATLAS_COMPLETE' file. + file: + path: "{{ hpl_root }}/tmp/COMPILE_ATLAS_COMPLETE" + state: touch + mode: 0644 + + - name: Download HPL (High Performance Linpack). + ansible.builtin.unarchive: + src: http://www.netlib.org/benchmark/hpl/hpl-2.3.tar.gz + dest: "{{ hpl_root }}/tmp" + remote_src: true + creates: "{{ hpl_root }}/tmp/hpl-2.3/README" + + - name: Set up HPL makefile. + ansible.builtin.shell: sh make_generic + args: + chdir: "{{ hpl_root }}/tmp/hpl-2.3/setup" + creates: "{{ hpl_root }}/tmp/COMPILE_HPL_COMPLETE" + + - name: Copy rpi makefile into place. + ansible.builtin.template: + src: templates/benchmark-Make.rpi.j2 + dest: "{{ hpl_root }}/tmp/hpl-2.3/Make.rpi" + mode: 0644 + + - name: Install HPL. + ansible.builtin.command: >- + make arch=rpi + args: + chdir: "{{ hpl_root }}/tmp/hpl-2.3" + creates: "{{ hpl_root }}/tmp/COMPILE_HPL_COMPLETE" + + - name: Create COMPILE_HPL_COMPLETE file. + ansible.builtin.file: + path: "{{ hpl_root }}/tmp/COMPILE_HPL_COMPLETE" + state: touch + mode: 0644 + +# See: https://github.com/geerlingguy/top500-benchmark/issues/1 +- name: Configure SSH connections between nodes. + hosts: cluster + become: false + tags: ['ssh'] + + vars_files: ['config.yml'] + vars: + host_ips: [] + + tasks: + - name: Generate an OpenSSH keypair. + community.crypto.openssh_keypair: + path: /home/pi/.ssh/id_rsa + size: 2048 + + - name: Read out ssh pubkey from each host. + ansible.builtin.command: cat /home/pi/.ssh/id_rsa.pub + changed_when: false + register: ssh_pubkey + + - name: Combine pubkeys into single list. + ansible.builtin.set_fact: + combined_ssh_pubkeys: "{{ ansible_play_hosts | map('extract', hostvars, 'ssh_pubkey') | map(attribute='stdout') | list }}" + run_once: true + + - name: Write all pubkeys to each host. + ansible.posix.authorized_key: + user: pi + state: present + key: "{{ item }}" + loop: "{{ combined_ssh_pubkeys }}" + + - name: Generate list of host IP addresses. + ansible.builtin.set_fact: + host_ips: "{{ host_ips + [ hostvars[item].ansible_default_ipv4.address ] }}" + loop: "{{ groups['cluster'] }}" + + - name: Accept hostkeys for each host on each host. + ansible.builtin.command: >- + ssh pi@{{ item }} -o StrictHostKeyChecking=accept-new date + loop: "{{ host_ips }}" + +- name: Run linpack benchmark. + hosts: cluster + become: false + tags: ['benchmark'] + + vars_files: ['config.yml'] + + tasks: + - name: Create a file describing nodes for MPI execution. + ansible.builtin.template: + src: templates/mpi-node-config.j2 + dest: "{{ hpl_root }}/tmp/hpl-2.3/bin/rpi/cluster-hosts" + mode: 0644 + + # Template originally generated using this website: + # https://www.advancedclustering.com/act_kb/tune-hpl-dat-file/ + - name: Create HPL.dat file. + ansible.builtin.template: + src: templates/HPL.dat.j2 + dest: "{{ hpl_root }}/tmp/hpl-2.3/bin/rpi/HPL.dat" + mode: 0644 + + - name: Run the benchmark. + ansible.builtin.command: mpirun -f cluster-hosts ./xhpl + args: + chdir: "{{ hpl_root }}/tmp/hpl-2.3/bin/rpi" + register: mpirun_output + run_once: true + + - name: Output the results. + debug: var=mpirun_output.stdout diff --git a/templates/HPL.dat.j2 b/templates/HPL.dat.j2 new file mode 100644 index 0000000..9ab0a1d --- /dev/null +++ b/templates/HPL.dat.j2 @@ -0,0 +1,37 @@ +{# https://www.advancedclustering.com/act_kb/tune-hpl-dat-file/ #} +HPLinpack benchmark input file +Innovative Computing Laboratory, University of Tennessee +HPL.out output file name (if any) +6 device out (6=stdout,7=stderr,file) +1 # of problems sizes (N) +{{ hpl_dat_opts.Ns }} Ns +1 # of NBs +{{ hpl_dat_opts.NBs }} NBs +0 PMAP process mapping (0=Row-,1=Column-major) +1 # of process grids (P x Q) +{{ hpl_dat_opts.Ps }} Ps +{{ hpl_dat_opts.Qs }} Qs +16.0 threshold +1 # of panel fact +2 PFACTs (0=left, 1=Crout, 2=Right) +1 # of recursive stopping criterium +4 NBMINs (>= 1) +1 # of panels in recursion +2 NDIVs +1 # of recursive panel fact. +1 RFACTs (0=left, 1=Crout, 2=Right) +1 # of broadcast +1 BCASTs (0=1rg,1=1rM,2=2rg,3=2rM,4=Lng,5=LnM) +1 # of lookahead depth +1 DEPTHs (>=0) +2 SWAP (0=bin-exch,1=long,2=mix) +64 swapping threshold +0 L1 in (0=transposed,1=no-transposed) form +0 U in (0=transposed,1=no-transposed) form +1 Equilibration (0=no,1=yes) +8 memory alignment in double (> 0) +##### This line (no. 32) is ignored (it serves as a separator). ###### +0 Number of additional problem sizes for PTRANS +1200 10000 30000 values of N +0 number of additional blocking sizes for PTRANS +40 9 8 13 13 20 16 32 64 values of NB diff --git a/templates/benchmark-Make.rpi.j2 b/templates/benchmark-Make.rpi.j2 new file mode 100644 index 0000000..c60c8a9 --- /dev/null +++ b/templates/benchmark-Make.rpi.j2 @@ -0,0 +1,180 @@ +# +# -- High Performance Computing Linpack Benchmark (HPL) +# HPL - 2.3 - December 2, 2018 +# Antoine P. Petitet +# University of Tennessee, Knoxville +# Innovative Computing Laboratory +# (C) Copyright 2000-2008 All Rights Reserved +# +# -- Copyright notice and Licensing terms: +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions, and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgement: +# This product includes software developed at the University of +# Tennessee, Knoxville, Innovative Computing Laboratory. +# +# 4. The name of the University, the name of the Laboratory, or the +# names of its contributors may not be used to endorse or promote +# products derived from this software without specific written +# permission. +# +# -- Disclaimer: +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ###################################################################### +# +# ---------------------------------------------------------------------- +# - shell -------------------------------------------------------------- +# ---------------------------------------------------------------------- +# +SHELL = /bin/sh +# +CD = cd +CP = cp +LN_S = ln -s +MKDIR = mkdir +RM = /bin/rm -f +TOUCH = touch +# +# ---------------------------------------------------------------------- +# - Platform identifier ------------------------------------------------ +# ---------------------------------------------------------------------- +# +ARCH = rpi +# +# ---------------------------------------------------------------------- +# - HPL Directory Structure / HPL library ------------------------------ +# ---------------------------------------------------------------------- +# +TOPdir = {{ hpl_root }}/tmp/hpl-2.3 +INCdir = $(TOPdir)/include +BINdir = $(TOPdir)/bin/$(ARCH) +LIBdir = $(TOPdir)/lib/$(ARCH) +# +HPLlib = $(LIBdir)/libhpl.a +# +# ---------------------------------------------------------------------- +# - Message Passing library (MPI) -------------------------------------- +# ---------------------------------------------------------------------- +# MPinc tells the C compiler where to find the Message Passing library +# header files, MPlib is defined to be the name of the library to be +# used. The variable MPdir is only used for defining MPinc and MPlib. +# +MPdir = /usr/local +MPinc = -I /usr/local/include +MPlib = /usr/local/lib/libmpich.so +# +# ---------------------------------------------------------------------- +# - Linear Algebra library (BLAS or VSIPL) ----------------------------- +# ---------------------------------------------------------------------- +# LAinc tells the C compiler where to find the Linear Algebra library +# header files, LAlib is defined to be the name of the library to be +# used. The variable LAdir is only used for defining LAinc and LAlib. +# +LAdir = {{ hpl_root }}/tmp/atlas-build +LAinc = +LAlib = $(LAdir)/lib/libf77blas.a $(LAdir)/lib/libatlas.a +# +# ---------------------------------------------------------------------- +# - F77 / C interface -------------------------------------------------- +# ---------------------------------------------------------------------- +# You can skip this section if and only if you are not planning to use +# a BLAS library featuring a Fortran 77 interface. Otherwise, it is +# necessary to fill out the F2CDEFS variable with the appropriate +# options. **One and only one** option should be chosen in **each** of +# the 3 following categories: +# +# 1) name space (How C calls a Fortran 77 routine) +# +# -DAdd_ : all lower case and a suffixed underscore (Suns, +# Intel, ...), [default] +# -DNoChange : all lower case (IBM RS6000), +# -DUpCase : all upper case (Cray), +# -DAdd__ : the FORTRAN compiler in use is f2c. +# +# 2) C and Fortran 77 integer mapping +# +# -DF77_INTEGER=int : Fortran 77 INTEGER is a C int, [default] +# -DF77_INTEGER=long : Fortran 77 INTEGER is a C long, +# -DF77_INTEGER=short : Fortran 77 INTEGER is a C short. +# +# 3) Fortran 77 string handling +# +# -DStringSunStyle : The string address is passed at the string loca- +# tion on the stack, and the string length is then +# passed as an F77_INTEGER after all explicit +# stack arguments, [default] +# -DStringStructPtr : The address of a structure is passed by a +# Fortran 77 string, and the structure is of the +# form: struct {char *cp; F77_INTEGER len;}, +# -DStringStructVal : A structure is passed by value for each Fortran +# 77 string, and the structure is of the form: +# struct {char *cp; F77_INTEGER len;}, +# -DStringCrayStyle : Special option for Cray machines, which uses +# Cray fcd (fortran character descriptor) for +# interoperation. +# +F2CDEFS = -DAdd_ -DF77_INTEGER=int -DStringSunStyle +# +# ---------------------------------------------------------------------- +# - HPL includes / libraries / specifics ------------------------------- +# ---------------------------------------------------------------------- +# +HPL_INCLUDES = -I$(INCdir) -I$(INCdir)/$(ARCH) $(LAinc) $(MPinc) +HPL_LIBS = $(HPLlib) $(LAlib) $(MPlib) +# +# - Compile time options ----------------------------------------------- +# +# -DHPL_COPY_L force the copy of the panel L before bcast; +# -DHPL_CALL_CBLAS call the cblas interface; +# -DHPL_CALL_VSIPL call the vsip library; +# -DHPL_DETAILED_TIMING enable detailed timers; +# +# By default HPL will: +# *) not copy L before broadcast, +# *) call the BLAS Fortran 77 interface, +# *) not display detailed timing information. +# +HPL_OPTS = +# +# ---------------------------------------------------------------------- +# +HPL_DEFS = $(F2CDEFS) $(HPL_OPTS) $(HPL_INCLUDES) +# +# ---------------------------------------------------------------------- +# - Compilers / linkers - Optimization flags --------------------------- +# ---------------------------------------------------------------------- +# +CC = mpicc +CCNOOPT = $(HPL_DEFS) +CCFLAGS = $(HPL_DEFS) +# +LINKER = mpif77 +LINKFLAGS = +# +ARCHIVER = ar +ARFLAGS = r +RANLIB = echo +# +# ---------------------------------------------------------------------- diff --git a/templates/mpi-node-config.j2 b/templates/mpi-node-config.j2 new file mode 100644 index 0000000..cb689cf --- /dev/null +++ b/templates/mpi-node-config.j2 @@ -0,0 +1,3 @@ +{% for host in groups['cluster'] %} +{{ hostvars[host].ansible_default_ipv4.address }}:4 +{% endfor %} \ No newline at end of file