Skip to content

Commit

Permalink
Disable FPEs in MacOS testing
Browse files Browse the repository at this point in the history
Due to poor handling of floating point in HDF5 1.14.3, it is currently
not possible to use floating point exceptions (FPEs) whenever this
version is present.

The GitHub Actions CI nodes would randomly select either 1.14.2 or
1.14.3, and would raise an FPE error if 1.14.3 was selected.
Additionally, the homebrew installation does not provide a clean method
for selecting a different version of HDF5.

Thus, for now we disable FPEs in the MacOS testing, and hope to catch
any legitimate FP errors in the Ubuntu version.  We will restore these
tests as soon as this has been fixed in an easily-accessible version of
HDF5.

As part of this PR, I have also moved the FCFLAGS configuration to the
platform specific Actions files, allowing for independent compiler
configuration for each platform.
  • Loading branch information
marshallward authored and alperaltuntas committed Dec 20, 2023
1 parent 60e59dc commit 05cd9b9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
15 changes: 15 additions & 0 deletions .github/actions/macos-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ runs:
brew install netcdf-fortran
brew install mpich
echo "::endgroup::"
# NOTE: Floating point exceptions are currently disabled due to an error in
# HDF5 1.4.3. They will be re-enabled when the default brew version has
# been updated to a working version.

- name: Set compiler flags
shell: bash
run: |
cd .testing
echo "FCFLAGS_DEBUG = -g -O0 -Wextra -Wno-compare-reals -fbacktrace -fcheck=bounds" >> config.mk
echo "FCFLAGS_REPRO = -g -O2 -fbacktrace" >> config.mk
echo "FCFLAGS_INIT = -finit-real=snan -finit-integer=2147483647 -finit-derived" >> config.mk
echo "FCFLAGS_FMS = -g -fbacktrace -O0" >> config.mk
cat config.mk
echo "::endgroup::"
11 changes: 0 additions & 11 deletions .github/actions/testing-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ runs:
REPORT_ERROR_LOGS=true make deps/lib/libFMS.a -s -j
echo "::endgroup::"
- name: Store compiler flags used in Makefile
shell: bash
run: |
echo "::group::config.mk"
cd .testing
echo "FCFLAGS_DEBUG=-g -O0 -Wextra -Wno-compare-reals -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds" >> config.mk
echo "FCFLAGS_REPRO=-g -O2 -fbacktrace" >> config.mk
echo "FCFLAGS_INIT=-finit-real=snan -finit-integer=2147483647 -finit-derived" >> config.mk
cat config.mk
echo "::endgroup::"
- name: Compile MOM6 in symmetric memory mode
shell: bash
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/ubuntu-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@ runs:
sudo apt-get install libopenmpi-dev
sudo apt-get install linux-tools-common
echo "::endgroup::"
- name: Store compiler flags used in Makefile
shell: bash
run: |
echo "::group::config.mk"
cd .testing
echo "FCFLAGS_DEBUG = -g -O0 -Wextra -Wno-compare-reals -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds" >> config.mk
echo "FCFLAGS_REPRO = -g -O2 -fbacktrace" >> config.mk
echo "FCFLAGS_INIT = -finit-real=snan -finit-integer=2147483647 -finit-derived" >> config.mk
echo "FCFLAGS_FMS = -g -fbacktrace -O0" >> config.mk
cat config.mk
echo "::endgroup::"

0 comments on commit 05cd9b9

Please sign in to comment.