generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 85
Compile MFEM externally #550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sbozzolo
wants to merge
7
commits into
main
Choose a base branch
from
gbozzola/external_mfem
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a17970f
Compile MFEM externally
Sbozzolo 4fa8eaf
Update
Sbozzolo 953f9e7
Workaround OpenMP problem
Sbozzolo 87fc84d
Address some PR comments
Sbozzolo 854e9ea
Fix static builds
Sbozzolo 6c63e6d
SUNDAILS commit hash is broken on released spack-packages
Sbozzolo 581d320
Address more comments
Sbozzolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,89 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| """Test Matrix Generator | ||
|
|
||
| Generates pairwise test combinations used in spack.yml using | ||
| [allpairspy](https://github.com/thombashi/allpairspy). | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| pip install -U pyyaml allpairspy | ||
| python generate_test_matrix.py | ||
| ``` | ||
|
|
||
| It enforces certain constrains. | ||
|
|
||
| """ | ||
| from allpairspy import AllPairs | ||
| import yaml | ||
|
|
||
| parameters = [ | ||
| ["x86", "x86", "arm"], # Favor x86 | ||
| ["gcc", "llvm", "intel-oneapi-compilers"], | ||
| ["openmpi", "mpich", "intel-oneapi-mpi"], | ||
| ["openblas", "amdblis", "armpl-gcc", "intel-oneapi-mkl"], | ||
| ["+shared", "~shared"], | ||
| ["+int64", "~int64"], | ||
| ["~openmp", "+openmp"], | ||
| ["+arpack", "+slepc"], | ||
| ["+mumps", "+superlu-dist", "+strumpack"], | ||
| ["~cuda"], | ||
| ] | ||
|
|
||
| def is_valid(combo): | ||
| if len(combo) < 4: | ||
| # AllPairs creates partial combinations | ||
| return True | ||
|
|
||
| arch, compiler, mpi, math_libs = combo[0], combo[1], combo[2], combo[3] | ||
|
|
||
| # Intel packages must all be together and only on x86 | ||
| intel_packages = [compiler == "intel-oneapi-compilers", | ||
| mpi == "intel-oneapi-mpi", | ||
| math_libs == "intel-oneapi-mkl"] | ||
| if any(intel_packages): | ||
| if arch != "x86" or not all(intel_packages): | ||
| return False | ||
|
|
||
| # Use ARMPL only with GCC and ARM | ||
| if math_libs == "armpl-gcc" and (compiler != "gcc" or arch != "arm"): | ||
| return False | ||
|
|
||
| # On ARM, use armpl-gcc or openblas | ||
| if arch == "arm" and math_libs not in ("armpl-gcc", "openblas"): | ||
| return False | ||
|
|
||
| return True | ||
|
|
||
| matrix = [] | ||
| for combo in AllPairs(parameters, filter_func=is_valid): | ||
| matrix.append({ | ||
| "arch": combo[0], | ||
| "compiler": combo[1], | ||
| "mpi": combo[2], | ||
| "math-libs": combo[3], | ||
| "shared": combo[4], | ||
| "int": combo[5], | ||
| "openmp": combo[6], | ||
| "eigensolver": combo[7], | ||
| "solver": combo[8], | ||
| "cuda": combo[9], | ||
| }) | ||
|
|
||
| # Add one case where we turn a multiple solvers (to check that there's no | ||
| # problem with compiling multiple solvers) | ||
| matrix.append({ | ||
| "arch": "x86", | ||
| "compiler": "gcc", | ||
| "mpi": "openmpi", | ||
| "math-libs": "openblas", | ||
| "shared": "~shared", | ||
| "int": "~int64", | ||
| "openmp": "+openmp", | ||
| "eigensolver": "+slepc+arpack", | ||
| "solver": "+superlu-dist+mumps+sundials+strumpack", | ||
| "cuda": "~cuda" | ||
| }) | ||
|
|
||
| print(yaml.dump(matrix, default_flow_style=False, sort_keys=False)) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment in
spack.yaml, but it's unclear how this is used in relation to the GitHub workflow.