Skip to content

Commit 0532542

Browse files
committed
Update
1 parent a17970f commit 0532542

File tree

9 files changed

+504
-56
lines changed

9 files changed

+504
-56
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ jobs:
117117
# If you want to use the branch-local source instead (should we always do this?)
118118
# spack -e . develop --path=$(pwd) palace@git."${{ github.head_ref || github.ref_name }}"=develop
119119

120+
- uses: julia-actions/cache@v2
121+
if: needs.filter.outputs.test == 'true'
122+
123+
- uses: julia-actions/setup-julia@v2
124+
if: needs.filter.outputs.test == 'true'
125+
with:
126+
version: '1'
127+
120128
- name: Build and deploy
121129
env:
122130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env python3
2+
3+
"""
4+
5+
Test Matrix Generator
6+
7+
Generates pairwise test combinations using
8+
[allpairspy](https://github.com/thombashi/allpairspy).
9+
10+
## Usage
11+
12+
```bash
13+
pip install -U pyyaml allpairspy
14+
python generate_test_matrix.py
15+
```
16+
17+
It enforces certain contrains.
18+
19+
"""
20+
from allpairspy import AllPairs
21+
import yaml
22+
23+
parameters = [
24+
# Favor x86
25+
["x86", "x86", "arm"],
26+
["gcc", "llvm", "intel-oneapi-compilers", ],
27+
["openmpi", "mpich", "intel-oneapi-mpi"],
28+
["openblas", "amdblis", "armpl-gcc", "intel-oneapi-mkl", ],
29+
["+shared", "~shared"],
30+
["+int64", "~int64"],
31+
["~openmp", "+openmp"],
32+
["+arpack", "+slepc"],
33+
["+mumps", "+superlu-dist", "+strumpack"],
34+
["~cuda"],
35+
]
36+
37+
def is_valid(combo):
38+
if len(combo) < 4:
39+
# AllPairs creates partial combinations
40+
return True
41+
42+
arch, compiler, mpi, math_libs = combo[0], combo[1], combo[2], combo[3]
43+
44+
# Intel packages must all be together and only on x86
45+
intel_packages = [compiler == "intel-oneapi-compilers",
46+
mpi == "intel-oneapi-mpi",
47+
math_libs == "intel-oneapi-mkl"]
48+
if any(intel_packages):
49+
if arch != "x86" or not all(intel_packages):
50+
return False
51+
52+
# Use ARMPL only with GCC and ARM
53+
if math_libs == "armpl-gcc" and (compiler != "gcc" or arch != "arm"):
54+
return False
55+
56+
# On ARM, use armpl-gcc or openblas
57+
if arch == "arm" and math_libs not in ("armpl-gcc", "openblas"):
58+
return False
59+
60+
return True
61+
62+
matrix = []
63+
for combo in AllPairs(parameters, filter_func=is_valid):
64+
matrix.append({
65+
"arch": combo[0],
66+
"compiler": combo[1],
67+
"mpi": combo[2],
68+
"math-libs": combo[3],
69+
"shared": combo[4],
70+
"int": combo[5],
71+
"openmp": combo[6],
72+
"eigensolver": combo[7],
73+
"solver": combo[8],
74+
"cuda": combo[9],
75+
})
76+
77+
print(yaml.dump(matrix, default_flow_style=False, sort_keys=False))

0 commit comments

Comments
 (0)