Skip to content

Commit 70ec0f4

Browse files
committed
Merge remote-tracking branch 'upstream/master' into documentation
2 parents 3110128 + 4759bd8 commit 70ec0f4

File tree

158 files changed

+7505
-1779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+7505
-1779
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/tests/**/* linguist-generated=true
2+
/toolchain/mechanisms/* linguist-generated=true

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ CMakeLists.txt @sbryngelson @henryleberre
1313
.vscode/ @sbryngelson @henryleberre
1414
.github/workflows/ @sbryngelson @henryleberre
1515

16+
# Spencer H. Bryngelson & Ben Wilfong
17+
.typos.toml @sbryngelson @wilfonba

.github/file-filter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fortran_src: &fortran_src
77

88
python_src: &python_src
99
- '**/*.py'
10-
- 'toolchain/requirements.txt'
10+
- 'toolchain/pyproject.toml'
1111

1212
cmakelist: &cmakelist
1313
- 'CMakeLists.txt'

.github/workflows/cleanliness.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Cleanliness
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
cleanliness:
7+
name: Code Cleanliness Test
8+
runs-on: "ubuntu-latest"
9+
env:
10+
pr_everything: 0
11+
master_everything: 0
12+
steps:
13+
- name: Clone - PR
14+
uses: actions/checkout@v3
15+
with:
16+
path: pr
17+
- name: Clone - Master
18+
uses: actions/checkout@v3
19+
with:
20+
repository: MFlowCode/MFC
21+
ref: master
22+
path: master
23+
24+
- name: Setup Ubuntu
25+
run: |
26+
sudo apt update -y
27+
sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
28+
29+
- name: Build
30+
run: |
31+
(cd pr && /bin/bash mfc.sh build -j $(nproc) --debug 2> ../pr.txt)
32+
(cd master && /bin/bash mfc.sh build -j $(nproc) --debug 2> ../master.txt)
33+
sed -i '/\/pr\//d' pr.txt
34+
sed -i '/\/master\//d' master.txt
35+
36+
- name: Unused Variables Diff
37+
run: |
38+
grep -F 'Wunused-variable' master.txt > mUnused.txt
39+
grep -F 'Wunused-variable' pr.txt > prUnused.txt
40+
diff prUnused.txt mUnused.txt || true
41+
42+
- name: Unused Dummy Arguments Diff
43+
run: |
44+
grep -F 'Wunused-dummy-argument' pr.txt > prDummy.txt
45+
grep -F 'Wunused-dummy-argument' master.txt > mDummy.txt
46+
diff prDummy.txt mDummy.txt || true
47+
48+
- name: Unused Value Diff
49+
run: |
50+
grep -F 'Wunused-value' pr.txt > prUnused_val.txt
51+
grep -F 'Wunused-value' master.txt > mUnused_val.txt
52+
diff prUnused_val.txt mUnused_val.txt || true
53+
54+
- name: Maybe Uninitialized Variables Diff
55+
run: |
56+
grep -F 'Wmaybe-uninitialized' pr.txt > prMaybe.txt
57+
grep -F 'Wmaybe-uninitialized' master.txt > mMaybe.txt
58+
diff prMaybe.txt mMaybe.txt || true
59+
60+
61+
- name: Everything Diff
62+
run: |
63+
grep '\-W' pr.txt > pr_every.txt
64+
grep '\-W' master.txt > m_every.txt
65+
diff pr_every.txt m_every.txt || true
66+
67+
- name: List of Warnings
68+
run: |
69+
cat pr_every.txt
70+
71+
72+
- name: Summary
73+
run: |
74+
pr_variable=$(grep -c -F 'Wunused-variable' pr.txt)
75+
pr_argument=$(grep -c -F 'Wunused-dummy-argument' pr.txt)
76+
pr_value=$(grep -c -F 'Wunused-value' pr.txt)
77+
pr_uninit=$(grep -c -F 'Wmaybe-uninitialized' pr.txt)
78+
pr_everything=$(grep -c '\-W' pr.txt)
79+
80+
master_variable=$(grep -c -F 'Wunused-variable' master.txt)
81+
master_argument=$(grep -c -F 'Wunused-dummy-argument' master.txt)
82+
master_value=$(grep -c -F 'Wunused-value' master.txt)
83+
master_uninit=$(grep -c -F 'Wmaybe-uninitialized' master.txt)
84+
master_everything=$(grep -c '\-W' master.txt )
85+
86+
echo "pr_everything=$pr_everything" >> $GITHUB_ENV
87+
echo "master_everything=$master_everything" >> $GITHUB_ENV
88+
89+
echo "Difference is how many warnings were added or removed from master to PR."
90+
echo "Negative numbers are better since you are removing warnings."
91+
echo " "
92+
echo "Unused Variable Count: $pr_variable, Difference: $((pr_variable - master_variable))"
93+
echo "Unused Dummy Argument: $pr_argument, Difference: $((pr_argument - master_argument))"
94+
echo "Unused Value: $pr_value, Difference: $((pr_value - master_value))"
95+
echo "Maybe Uninitialized: $pr_uninit, Difference: $((pr_uninit - master_uninit))"
96+
echo "Everything: $pr_everything, Difference: $((pr_everything - master_everything))"
97+
98+
99+
- name: Check Differences
100+
if: env.pr_everything > env.master_everything
101+
run: |
102+
echo "Difference between warning count in PR is greater than in master."
103+
exit 1
104+
105+

.github/workflows/docs.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
name: Documentation
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
8-
workflow_dispatch:
3+
on: [push, pull_request, workflow_dispatch]
94

105
jobs:
116
docs:
127
name: Build & Publish
138
runs-on: ubuntu-latest
149

15-
if: github.repository == 'MFlowCode/MFC'
1610
concurrency:
1711
group: docs-publish
1812
cancel-in-progress: true
@@ -53,6 +47,7 @@ jobs:
5347
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
5448
5549
- name: Publish Documentation
50+
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && github.event_name == 'push'
5651
run: |
5752
set +e
5853
git ls-remote "${{ secrets.DOC_PUSH_URL }}" -q

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ jobs:
4949
- name: Setup MacOS
5050
if: matrix.os == 'macos'
5151
run: |
52-
brew install coreutils python cmake fftw hdf5 gcc@14 open-mpi
52+
brew install coreutils python cmake fftw hdf5 gcc@14 boost open-mpi
5353
echo "FC=gfortran-14" >> $GITHUB_ENV
54+
echo "BOOST_INCLUDE=/opt/homebrew/include/" >> $GITHUB_ENV
5455
5556
- name: Setup Ubuntu
5657
if: matrix.os == 'ubuntu' && matrix.intel == false
@@ -138,4 +139,3 @@ jobs:
138139
with:
139140
name: logs
140141
path: test-${{ matrix.device }}.out
141-

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
133133
-fimplicit-none
134134
#-ffpe-trap=invalid,zero,denormal,overflow
135135
-fsignaling-nans
136+
-finit-real=snan
137+
-finit-integer=-99999999
136138
)
137139
endif()
138140

@@ -340,6 +342,7 @@ macro(HANDLE_SOURCES target useCommon)
340342
-D MFC_${${target}_UPPER}
341343
-D MFC_COMPILER="${CMAKE_Fortran_COMPILER_ID}"
342344
-D MFC_CASE_OPTIMIZATION=False
345+
-D chemistry=False
343346
--line-numbering
344347
--no-folding
345348
"${fpp}" "${f90}"

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,20 @@ It's rather straightforward.
5858
We'll give a brief intro. here for MacOS.
5959
Using [brew](https://brew.sh), install MFC's dependencies:
6060
```shell
61-
brew install coreutils python cmake fftw hdf5 gcc open-mpi
61+
brew install coreutils python cmake fftw hdf5 gcc boost open-mpi
6262
```
6363
You're now ready to build and test MFC!
6464
Put it to a convenient directory via
6565
```shell
6666
git clone https://github.com/MFlowCode/MFC
6767
cd MFC
6868
```
69+
and be sure MFC knows where to find Boost by appending to your dotfiles and sourcing them again
70+
```shell
71+
echo -e "export BOOST_INCLUDE='$(brew --prefix --installed boost)/include'" | tee -a ~/.bash_profile ~/.zshrc
72+
. ~/.bash_profile 2>/dev/null || . ~/.zshrc 2>/dev/null
73+
! [ -z "${BOOST_INCLUDE+x}" ] && echo 'Environment is ready!' || echo 'Error: $BOOST_INCLUDE is unset. Please adjust the previous commands to fit with your environment.'
74+
```
6975
then you can build MFC and run the test suite!
7076
```shell
7177
./mfc.sh build -j $(nproc)
@@ -126,7 +132,7 @@ They are organized below. Just click the drop-downs!
126132

127133
* Shock and interface capturing schemes
128134
* First-order upwinding
129-
* WENO reconstructions of order 3 and 5
135+
* WENO reconstructions of order 3, 5, and 7
130136
* WENO variants: WENO-JS, WENO-M, WENO-Z, TENO
131137
* Monotonicity-preserving reconstructions
132138
* Reliable handling of high density ratios

benchmarks/5eq_rk3_weno3_hllc/case.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
description="This MFC case was created for the purposes of benchmarking MFC.",
1515
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1616

17-
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
18-
parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
17+
parser.add_argument("--mfc", type=json.loads, default='{}', metavar="DICT",
18+
help="MFC's toolchain's internal state.")
19+
parser.add_argument("--gbpp", type=int, metavar="MEM", default=16,
20+
help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
1921

2022
ARGS = vars(parser.parse_args())
21-
DICT = json.loads(ARGS["dict"])
23+
DICT = ARGS["mfc"]
2224

2325
size = 1 if DICT["gpu"] else 0
2426

benchmarks/hypo_hll/case.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
description="This MFC case was created for the purposes of benchmarking MFC.",
1313
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1414

15-
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
16-
parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
15+
parser.add_argument("--mfc", type=json.loads, default='{}', metavar="DICT",
16+
help="MFC's toolchain's internal state.")
17+
parser.add_argument("--gbpp", type=int, metavar="MEM", default=16,
18+
help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
1719

1820
ARGS = vars(parser.parse_args())
19-
DICT = json.loads(ARGS["dict"])
21+
DICT = ARGS["mfc"]
2022

2123
size = 1 if DICT["gpu"] else 0
2224

0 commit comments

Comments
 (0)