-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (143 loc) · 5.81 KB
/
Copy pathopenmpi-integration.yml
File metadata and controls
147 lines (143 loc) · 5.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Open MPI Integration
on:
workflow_call:
push:
branches:
- main
- release/*
workflow_dispatch:
permissions:
contents: read
concurrency:
group: openmpi-integration-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
openmpi:
name: Open MPI mpi_f08 · ${{ matrix.version }} · ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
# One release per module layout: 4.1 declares the handle types in
# mpi_f08_types, 5.0 re-exports them from a configured mpi_types.
- version: "4.1.8"
series: "v4.1"
target: Ubuntu 24.04
runner: ubuntu-24.04
- version: "5.0.11"
series: "v5.0"
target: Ubuntu 24.04
runner: ubuntu-24.04
- version: "4.1.8"
series: "v4.1"
target: macOS 15 ARM64
runner: macos-15
- version: "5.0.11"
series: "v5.0"
target: macOS 15 ARM64
runner: macos-15
env:
OPENMPI_VERSION: ${{ matrix.version }}
OPENMPI_SERIES: ${{ matrix.series }}
PRIK_GFORTRAN_BINARY: gfortran-13
PRIK_GCC_BINARY: gcc-13
PYTHONPATH: .
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Install pinned GFortran on Ubuntu
if: runner.os == 'Linux'
shell: bash
run: |
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1 || \
! command -v "$PRIK_GCC_BINARY" >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --yes gfortran-13 gcc-13
fi
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
ln -sf "$(command -v "$PRIK_GCC_BINARY")" "$compiler_dir/gcc"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
"$compiler_dir/gcc" --version
- name: Install pinned GFortran on macOS
if: runner.os == 'macOS'
shell: bash
run: |
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1 || \
! command -v "$PRIK_GCC_BINARY" >/dev/null 2>&1; then
brew install gcc@13
fi
compiler_dir="$RUNNER_TEMP/prik-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
ln -sf "$(command -v "$PRIK_GCC_BINARY")" "$compiler_dir/gcc"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
"$compiler_dir/gcc" --version
- name: Restore the Open MPI source, configured build, and installation
id: openmpi-cache
uses: actions/cache@v4
with:
path: ~/prik-openmpi/${{ matrix.version }}
key: openmpi-${{ matrix.version }}-${{ matrix.runner }}-gcc-gfortran-13-v2
- name: Build and install Open MPI
if: steps.openmpi-cache.outputs.cache-hit != 'true'
shell: bash
run: |
root="$HOME/prik-openmpi/$OPENMPI_VERSION"
mkdir -p "$root/build"
curl -fsSL "https://download.open-mpi.org/release/open-mpi/$OPENMPI_SERIES/openmpi-$OPENMPI_VERSION.tar.bz2" \
| tar -xj -C "$root"
mv "$root/openmpi-$OPENMPI_VERSION" "$root/source"
cd "$root/build"
../source/configure --prefix="$root/install" --enable-mpi-fortran=usempif08 CC=gcc FC=gfortran
make -j2
make install
# The test reads sources and generated headers from these trees and
# links the installation, so build objects are not cached.
find . \( -name '*.o' -o -name '*.lo' -o -name '*.a' -o -name '*.la' \) -delete
find . -type d -name .libs -prune -exec rm -rf {} +
- name: Build mpi4py against this Open MPI installation
shell: bash
run: |
root="$HOME/prik-openmpi/$OPENMPI_VERSION"
export PATH="$root/install/bin:$PATH"
export LD_LIBRARY_PATH="$root/install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH="$root/install/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}"
export MPI4PY_BUILD_MPICC="$root/install/bin/mpicc"
python -m pip install --no-cache-dir --no-binary=mpi4py mpi4py==4.1.2
- name: Run the Open MPI mpi_f08 workflow test
shell: bash
env:
PRIK_OPENMPI_REQUIRED: "1"
PRIK_OPENMPI_BENCHMARK: "1"
PRIK_OPENMPI_BENCHMARK_DIR: ${{ runner.temp }}/openmpi-benchmark
run: |
root="$HOME/prik-openmpi/$OPENMPI_VERSION"
export PATH="$root/install/bin:$PATH"
export LD_LIBRARY_PATH="$root/install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH="$root/install/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}"
export PRIK_OPENMPI_SOURCE="$root/source"
export PRIK_OPENMPI_BUILD="$root/build"
export PRIK_OPENMPI_MPIFORT="$root/install/bin/mpifort"
export PRIK_OPENMPI_LAUNCHER="$root/install/bin/mpirun"
python -m pytest -q -rs -s tests/fortran/assumed_types/end_to_end/test_openmpi_f08.py
- name: Upload matched Open MPI benchmark results
if: always()
uses: actions/upload-artifact@v4
with:
name: openmpi-benchmark-${{ matrix.version }}-${{ matrix.runner }}
path: ${{ runner.temp }}/openmpi-benchmark/*.json
if-no-files-found: ignore