Skip to content

Commit 6bd4d3f

Browse files
authored
Merge branch 'master' into runners
2 parents f7c9f89 + 635d86f commit 6bd4d3f

File tree

96 files changed

+4903
-5631
lines changed

Some content is hidden

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

96 files changed

+4903
-5631
lines changed

.github/workflows/formatting.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212

13+
- name: MFC Python setup
14+
run: ./mfc.sh init
15+
1316
- name: Check formatting
1417
run: |
1518
./mfc.sh format -j $(nproc)

.github/workflows/line-count.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ jobs:
4949
cd $BASE
5050
export MFC_PR=$PR
5151
pwd
52+
./mfc.sh init &> tmp.txt
5253
./mfc.sh count_diff
5354

.github/workflows/lint-source.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ jobs:
2929
run: pip install fortitude-lint ansi2txt
3030

3131
- name: Lint the source code
32-
run: fortitude check --ignore=E001,S001,S101,M011,F001,S041,T001 ./src/*/* || true
32+
run: fortitude check --file-extensions=f90,fpp,fypp --ignore=E001,S001,S101,M011,F001,S041,T001,S101 ./src/** || true
33+
34+
- name: Ensure kind is specified
35+
run: fortitude check --file-extensions=f90,fpp,fypp --select=P001 ./src/**
36+
37+
- name: No double precision intrinsics
38+
run: |
39+
! grep -iR 'dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|\.d0\|\dd0' --exclude-dir=syscheck ./src/*

.github/workflows/spelling.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v4
12-
13-
- name: MFC Python setup
14-
run: ./mfc.sh init
15-
12+
13+
- name: MFC Python Setup
14+
run: ./mfc.sh init
15+
1616
- name: Spell Check
1717
run: ./mfc.sh spelling

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
matrix:
2727
os: ['ubuntu', 'macos']
2828
mpi: ['mpi']
29+
precision: ['']
2930
debug: ['debug', 'no-debug']
3031
intel: [true, false]
3132
exclude:
@@ -35,6 +36,7 @@ jobs:
3536
include:
3637
- os: ubuntu
3738
mpi: no-mpi
39+
precision: single
3840
debug: no-debug
3941
intel: false
4042

@@ -86,7 +88,7 @@ jobs:
8688
- name: Build
8789
run: |
8890
if [ '${{ matrix.intel }}' == 'true' ]; then . /opt/intel/oneapi/setvars.sh; fi
89-
/bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }}
91+
/bin/bash mfc.sh build -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }} --${{ matrix.precision }}
9092
9193
- name: Test
9294
run: |
@@ -150,4 +152,4 @@ jobs:
150152
if: always()
151153
with:
152154
name: logs-${{ strategy.job-index }}-${{ matrix.device }}
153-
path: test-${{ matrix.device }}.out
155+
path: test-${{ matrix.device }}.out

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ option(MFC_POST_PROCESS "Build post_process" OFF
2626
option(MFC_SYSCHECK "Build syscheck" OFF)
2727
option(MFC_DOCUMENTATION "Build documentation" OFF)
2828
option(MFC_ALL "Build everything" OFF)
29+
option(MFC_SINGLE_PRECISION "Build single precision" OFF)
2930

3031
if (MFC_ALL)
3132
set(MFC_PRE_PROCESS ON FORCE)
@@ -34,6 +35,12 @@ if (MFC_ALL)
3435
set(MFC_DOCUMENTATION ON FORCE)
3536
endif()
3637

38+
if (MFC_SINGLE_PRECISION)
39+
add_compile_definitions(MFC_SINGLE_PRECISION)
40+
else()
41+
add_compile_definitions(MFC_DOUBLE_PRECISION)
42+
endif()
43+
3744

3845
# CMake Library Imports
3946

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ They are organized below. Just click the drop-downs!
161161
* \>66K AMD GPUs on the first exascale computer, [OLCF Frontier](https://www.olcf.ornl.gov/frontier/) (AMD MI250X-based)
162162
* Near compute roofline behavior
163163
* RDMA (remote data memory access; GPU-GPU direct communication) via GPU-aware MPI on NVIDIA (CUDA-aware MPI) and AMD GPU systems
164+
* Optional single-precision computation and storage
164165
</details>
165166

166167
<details>

docs/documentation/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ MFC can be built with support for various (compile-time) features:
126126
| **Debug** | `--debug` | `--no-debug` | Off | Requests the compiler build MFC in debug mode. |
127127
| **GCov** | `--gcov` | `--no-gcov` | Off | Builds MFC with coverage flags on. |
128128
| **Unified Memory** | `--unified` | `--no-unified` | Off | Builds MFC with unified CPU/GPU memory (GH-200 superchip only) |
129+
| **Single** | `--single` | `--no-single` | Off | Builds MFC in single precision
129130

130131
_⚠️ The `--gpu` option requires that your compiler supports OpenACC for Fortran for your target GPU architecture._
131132

docs/documentation/testing.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Testing
2-
2+
33
To run MFC's test suite, run
44
```shell
55
./mfc.sh test -j <thread count>
@@ -8,15 +8,15 @@ To run MFC's test suite, run
88
It will generate and run test cases, comparing their output to previous runs from versions of MFC considered accurate.
99
*golden files*, stored in the `tests/` directory contain this data, aggregating `.dat` files generated when running MFC.
1010
A test is considered passing when our error tolerances are met in order to maintain a high level of stability and accuracy.
11-
Run `./mfc.sh test -h` for a full list of accepted arguments.
12-
13-
Most notably, you can consult the full list of tests by running
14-
```shell
15-
./mfc.sh test -l
16-
```
11+
`./mfc.sh test` has the following unique options:
12+
- `-l` outputs the full list of tests
13+
- `--from` (`-f)` and `--to` (`t`) restrict testing to a range of contiguous slugs
14+
- `--only` (`-o`) restricts testing to a non-contiguous range of tests based on if their trace contains a certain feature
15+
- `--test-all` (`a`) test post process and ensure the Silo database files are correct
16+
- `--percent` (`%`) to specify a percentage of the test suite to select at random and test
17+
- `--max-attempts` (`-m`) the maximum number of attempts to make on a test before considering it failed
18+
- `--no-examples` skips the testing of cases in the examples folder
1719

18-
To restrict to a given range, use the `--from` (`-f`) and `--to` (`-t`) options.
19-
To run a (non-contiguous) subset of tests, use the `--only` (`-o`) option instead.
2020
To specify a computer, pass the `-c` flag to `./mfc.sh run` like so:
2121
```shell
2222
./mfc.sh test -j <thread count> -- -c <computer name>
@@ -27,15 +27,13 @@ The use of `--` in the above command passes options to the `./mfc.sh run` comman
2727

2828
### Creating Tests
2929

30-
To (re)generate *golden files*, append the `--generate` option:
31-
```shell
32-
./mfc.sh test --generate -j 8
33-
```
30+
Creating and updating test cases can be done with the following command line arguments:
31+
- `--generate` to generate golden files for a new test case
32+
- `--add-new-variables` to similar to `--generate`, but rather than generating a golden file from scratch, it generates a gold file with new variables for an updated test without changing the original golden file values.
33+
- `--remove-old-tests` to remove the directories of tests that no longer exist
3434

3535
It is recommended that a range be specified when generating golden files for new test cases, as described in the previous section, in an effort not to regenerate the golden files of existing test cases.
3636

37-
**Note:** If you output new variables and want to update the golden files to include these without modifying the original data, use the `--add-new-variables` option instead.
38-
3937
Adding a new test case can be done by modifying [cases.py](https://github.com/MFlowCode/MFC/tree/master/toolchain/mfc/test/cases.py).
4038
The function `list_cases` is responsible for generating the list of test cases.
4139
Loops and conditionals are used to vary parameters, whose defaults can be found in the `BASE_CFG` case object within [case.py](https://github.com/MFlowCode/MFC/tree/master/toolchain/mfc/test/case.py).
@@ -44,7 +42,7 @@ The function operates on two variables:
4442
- `stack`: A stack that holds the variations to the default case parameters.
4543
By pushing and popping the stack inside loops and conditionals, it is easier to nest test case descriptions, as it holds the variations that are common to all future test cases within the same indentation level (in most scenarios).
4644

47-
- `cases`: A list that holds fully-formed `Case` objects, that will be returned at the end of the function.
45+
- `cases`: A list that holds fully-formed `Case` objects, that will be returned at the end of the function.
4846

4947
Internally a test case is described as:
5048
```python
@@ -93,13 +91,13 @@ Finally, the case is appended to the `cases` list, which will be returned by the
9391

9492
### Testing Post Process
9593

96-
To test the post-processing code, append the `-a` or `--test-all` option:
94+
To test the post-processing code, append the `-a` or `--test-all` option:
9795
```shell
9896
./mfc.sh test -a -j 8
9997
```
10098

10199
This argument will re-run the test stack with `parallel_io='T'`, which generates silo_hdf5 files.
102100
It will also turn most write parameters (`*_wrt`) on.
103101
Then, it searches through the silo files using `h5dump` to ensure that there are no `NaN`s or `Infinity`s.
104-
Although adding this option does not guarantee that accurate `.silo` files are generated, it does ensure that the post-process code does not fail or produce malformed data.
102+
Although adding this option does not guarantee that accurate `.silo` files are generated, it does ensure that the post-process code does not fail or produce malformed data.
105103

examples/nD_perfect_reactor/case.py

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

2727
sol.TPX = 1_600, ct.one_atm, 'H2:0.04, O2:0.02, AR:0.94'
2828

29-
Nx = 25 * args.scale
29+
Nx = int(25 * args.scale)
3030
Tend = 1e-4
3131
s = 1e-2
3232
dt = 1e-7

0 commit comments

Comments
 (0)