Skip to content

Commit

Permalink
CI: Update macOS Runner (Latest) (#54)
Browse files Browse the repository at this point in the history
* CI: Update macOS Runner (Latest)

The old `macos-11` image is now removed. Update to
running release `macos-latest`.

* `test_picsar_tables.cpp`: Bump Tolerance 2x

* `test_picsar_tables.cpp`: Bump Tolerance 5x

* `test_picsar_tables.cpp`: Bump Tolerance 10x

* `test_picsar_tables.cpp`: Bump Tolerance 20x

* `test_picsar_tables.cpp`: Bump Tolerance 50x

* `test_picsar_tables.cpp`: Bump Tolerance 100x

* `test_picsar_tables.cpp`: Bump Tolerance 200x

* `test_picsar_tables.cpp`: Bump Tolerance 500x

* `test_picsar_tables.cpp`: Bump Tolerance 1000x

* Reset Tolerance

* `linear_function`: Add Tolerance
  • Loading branch information
ax3l authored Aug 30, 2024
1 parent 44a2dfd commit 6b46dbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ name: macos
on: [push, pull_request]

env:
CXX: "/usr/local/opt/llvm/bin/clang++"
LDFLAGS: "-L/usr/local/opt/llvm/lib"
CXXFLAGS: "-I/usr/local/opt/llvm/include -Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fsanitize=address -fsanitize=undefined"
CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fsanitize=address -fsanitize=undefined"

jobs:
# Build PICSAR tests, PICSAR python bindings, and Kokkos examples
tutorials-macos:
name: QED with tests, python bindings, Kokkos examples
runs-on: macos-11
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Dependencies
Expand All @@ -26,4 +24,4 @@ jobs:
-DKokkos_ENABLE_OPENMP=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
cmake --build build -j 2
cmake --build build --target test
ctest --test-dir build --output-on-failure
24 changes: 12 additions & 12 deletions multi_physics/QED/QED_tests/test_picsar_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ void check_table_1d(
const auto v0 = tab.get_val(0);
const auto v1 = tab.get_val(xsize/2);
const auto v2 = tab.get_val(xsize-1);
BOOST_CHECK_EQUAL(v0, linear_function(x0));
BOOST_CHECK_EQUAL(v1, linear_function(x1));
BOOST_CHECK_EQUAL(v2, linear_function(x2));
BOOST_CHECK_SMALL((linear_function(x0)-v0)/v0, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x1)-v1)/v1, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x2)-v2)/v2, tolerance<double>());

const auto xarr = std::array<double, 5>{x0,x1,x2,x3,x4};
for (const auto& xx : xarr)
Expand Down Expand Up @@ -394,15 +394,15 @@ void check_table_2d(
const auto v02 = tab.get_val(0, ysize-1);
const auto v12 = tab.get_val(xsize/2, ysize-1);
const auto v22 = tab.get_val(xsize-1, ysize-1);
BOOST_CHECK_EQUAL(v00, linear_function(x0,y0));
BOOST_CHECK_EQUAL(v10, linear_function(x1,y0));
BOOST_CHECK_EQUAL(v20, linear_function(x2,y0));
BOOST_CHECK_EQUAL(v01, linear_function(x0,y1));
BOOST_CHECK_EQUAL(v11, linear_function(x1,y1));
BOOST_CHECK_EQUAL(v21, linear_function(x2,y1));
BOOST_CHECK_EQUAL(v02, linear_function(x0,y2));
BOOST_CHECK_EQUAL(v12, linear_function(x1,y2));
BOOST_CHECK_EQUAL(v22, linear_function(x2,y2));
BOOST_CHECK_SMALL((linear_function(x0,y0)-v00)/v00, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x1,y0)-v10)/v10, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x2,y0)-v20)/v20, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x0,y1)-v01)/v01, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x1,y1)-v11)/v11, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x2,y1)-v21)/v21, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x0,y2)-v02)/v02, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x1,y2)-v12)/v12, tolerance<double>());
BOOST_CHECK_SMALL((linear_function(x2,y2)-v22)/v22, tolerance<double>());

const auto y3 = 0.8569*(y1-y0) + y0;
const auto y4 = 0.3467*(y2-y1) + y1;
Expand Down

0 comments on commit 6b46dbe

Please sign in to comment.