From 5a00e430e4754f0f70715b8986f409d1235db2ac Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Wed, 30 Jul 2025 11:07:23 -0400 Subject: [PATCH 01/27] Add aux_loc to q grid output --- src/2d/valout.f90 | 57 +++++++++++++++++++++++------------------------ src/3d/valout.f90 | 1 + 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/2d/valout.f90 b/src/2d/valout.f90 index 4dc98215..0182e6a6 100644 --- a/src/2d/valout.f90 +++ b/src/2d/valout.f90 @@ -67,7 +67,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) "i6,' ndim'/," // & "i6,' nghost'/," // & "a10,' format'/,/)" - + character(len=*), parameter :: console_format = & "('AMRCLAW: Frame ',i4,' output files done at time t = ', d13.6,/)" @@ -84,7 +84,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! Note: Currently outputs all aux components if any are requested out_aux = ((output_aux_num > 0) .and. & ((.not. output_aux_onlyonce) .or. (abs(time - t0) < 1d-90))) - + ! Construct file names file_name(1) = 'fort.qxxxx' file_name(2) = 'fort.txxxx' @@ -137,10 +137,11 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) num_cells(1) = node(ndihi, grid_ptr) - node(ndilo, grid_ptr) + 1 num_cells(2) = node(ndjhi, grid_ptr) - node(ndjlo, grid_ptr) + 1 q_loc = node(store1, grid_ptr) + aux_loc = node(storeaux, grid_ptr) lower_corner = [rnode(cornxlo, grid_ptr), rnode(cornylo, grid_ptr)] - ! Write out header data - + ! Write out header data + write(out_unit, header_format_2d) grid_ptr, level, & num_cells(1), & num_cells(2), & @@ -149,8 +150,8 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) delta(1), delta(2) ! Output grids - - ! Round off if nearly zero + + ! Round off if nearly zero ! (Do this for all output_format's) forall (m = 1:num_eqn, & i=num_ghost + 1:num_cells(1) + num_ghost, & @@ -162,7 +163,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) if (output_format == 1) then ! ascii output - + do j = num_ghost + 1, num_cells(2) + num_ghost do i = num_ghost + 1, num_cells(1) + num_ghost write(out_unit, "(50e26.16)") & @@ -173,7 +174,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) else if (output_format==2 .or. output_format==3) then ! binary32 or binary64 - + ! Note: We are writing out ghost cell data also, ! so need to update this call bound(time,num_eqn,num_ghost,alloc(q_loc), & @@ -183,7 +184,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) i = (iadd(num_eqn, num_cells(1) + 2 * num_ghost, & num_cells(2) + 2 * num_ghost)) - + if (output_format == 2) then ! binary32 (shorten to 4-byte) allocate(q4(num_eqn * (num_cells(1) + 2 * num_ghost) & @@ -196,11 +197,11 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! binary64 (full 8-byte) write(out_unit + 1) alloc(iadd(1, 1, 1):i) endif - - + + else if (output_format == 4) then #ifdef HDF5 - ! Create data space - handles dimensions of the corresponding + ! Create data space - handles dimensions of the corresponding ! data set - annoyingling need to stick grid size into other ! data type dims = (/ num_eqn, num_cells(1) + 2 * num_ghost, & @@ -221,7 +222,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) #endif else print *, "Unsupported output format", output_format,"." - stop + stop endif grid_ptr = node(levelptr, grid_ptr) @@ -229,7 +230,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) end do close(out_unit) - + if (output_format==2 .or. output_format==3) then close(unit=out_unit + 1) end if @@ -253,7 +254,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) #ifdef HDF5 ! Create group for aux call h5gcreate_f(hdf_file, "/aux", aux_group, hdf_error) -#endif +#endif end if do level = level_begin, level_end @@ -274,7 +275,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! ASCII output case(1) - ! We only output header info for aux data if writing + ! We only output header info for aux data if writing ! ASCII data write(out_unit, header_format_2d) grid_ptr, level, & num_cells(1), & @@ -299,7 +300,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) end do write(out_unit, *) ' ' end do - + case(2) ! binary32 ! Note: We are writing out ghost cell data also @@ -310,19 +311,19 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) aux4 = real(alloc(iaddaux(1, 1, 1):i), kind=4) write(out_unit) aux4 deallocate(aux4) - + case(3) ! binary64 ! Note: We are writing out ghost cell data also i = (iaddaux(num_aux, num_cells(1) + 2 * num_ghost, & num_cells(2) + 2 * num_ghost)) write(out_unit) alloc(iaddaux(1, 1, 1):i) - + ! HDF5 output case(4) #ifdef HDF5 - ! Create data space - handles dimensions of the corresponding + ! Create data space - handles dimensions of the corresponding ! data set - annoyingling need to stick grid size into other ! data type dims = (/ num_aux, num_cells(1) + 2 * num_ghost, & @@ -346,18 +347,18 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) #endif case default print *, "Unsupported output format", output_format,"." - stop + stop end select grid_ptr = node(levelptr, grid_ptr) end do end do - + if ((output_format == 1) .or. (output_format == 2) .or. & (output_format == 3)) then close(out_unit) end if - + end if #ifdef HDF5 @@ -375,7 +376,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! Note: We need to print out num_ghost too in order to strip ghost cells ! from q array when reading in pyclaw.io.binary - + if (output_format == 1) then file_format = 'ascii' else if (output_format == 2) then @@ -385,7 +386,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) else if (output_format == 4) then file_format = 'hdf' endif - + write(out_unit, t_file_format) time, num_eqn, num_grids, num_aux, 2, & num_ghost, file_format close(out_unit) @@ -395,7 +396,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) open(unit=out_unit, file=timing_file_name, form='formatted', & status='unknown', action='write', position='append') !status='old', action='write', position='append') - + timing_line = "(e16.6, ', ', e16.6, ', ', e16.6" do level=1, mxnest timing_substr = ", ', ', e16.6, ', ', e16.6, ', ', e16.6" @@ -419,7 +420,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) write(out_unit, timing_line) time, timeTick_overall, t_CPU_overall, & (real(tvoll(i), kind=8) / real(clock_rate, kind=8), & tvollCPU(i), rvoll(i), i=1,mxnest) - + close(out_unit) ! ========================================================================== @@ -452,5 +453,3 @@ pure integer function iaddaux(m, i, j) end function iaddaux end subroutine valout - - diff --git a/src/3d/valout.f90 b/src/3d/valout.f90 index 7e172a5a..56cf86de 100644 --- a/src/3d/valout.f90 +++ b/src/3d/valout.f90 @@ -127,6 +127,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) num_cells(2) = node(ndjhi, grid_ptr) - node(ndjlo, grid_ptr) + 1 num_cells(3) = node(ndkhi, grid_ptr) - node(ndklo, grid_ptr) + 1 q_loc = node(store1, grid_ptr) + aux_loc = node(storeaux, grid_ptr) lower_corner = [rnode(cornxlo, grid_ptr), & rnode(cornylo, grid_ptr), & rnode(cornzlo, grid_ptr)] From 78768e1063d6362554c3b30c45c6631d5d64c53f Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 10:30:35 -0400 Subject: [PATCH 02/27] Add flags to testing action to make testing more explicit --- .github/workflows/testing.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 20ea413f..97579a93 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,6 +13,8 @@ permissions: env: CLAW: ${{ github.workspace }} + FFLAGS: "-O1 -fopenmp" + OMP_NUM_THREADS: 2 jobs: tests: @@ -26,6 +28,7 @@ jobs: run: | sudo apt-get update sudo apt-get install gfortran + gfortran --version python -m pip install --upgrade pip pip install flake8 meson-python ninja pytest numpy # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi @@ -39,7 +42,7 @@ jobs: - name: Checkout AMRClaw branch uses: actions/checkout@v4.1.5 with: - path: amrclaw + path: amrclaw - name: Install clawpack run: | From ebd65ba9d7cf3983ca70a9bc227a3d3276fe9881 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 10:58:32 -0400 Subject: [PATCH 03/27] Add matrix options for debug and optimization flags --- .github/workflows/testing.yml | 37 ++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 97579a93..3d5edeef 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,17 +13,31 @@ permissions: env: CLAW: ${{ github.workspace }} - FFLAGS: "-O1 -fopenmp" - OMP_NUM_THREADS: 2 jobs: tests: - runs-on: ubuntu-latest + name: > + Build and test a ${{ matrix.build }} version of AMRClaw on ${{ matrix.os }} with ${{ matrix.python-version }}. + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [3.10] + build: [optimized, debug] + os: [ubuntu-latest, macos-latest] + include: + - os: ubuntu-latest + build: optimized + - os: ubuntu-latest + python-version: 3.10 + build: debug + - os: macos-latest + python-version: 3.10 + build: optimized steps: - - name: Set up Python 3.10 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: ${{matrix.python-version}} - name: Install dependencies run: | sudo apt-get update @@ -45,10 +59,13 @@ jobs: path: amrclaw - name: Install clawpack + env: + run: | pip install --no-build-isolation --editable . - name: Lint with flake8 + if: ${{ matrix.build == 'debug' }} run: | cd ${CLAW}/amrclaw # stop the build if there are Python syntax errors or undefined names @@ -58,6 +75,16 @@ jobs: - name: Test with pytest run: | + if [ "${{ matrix.build }}" == "debug" ]; then + export FFLAGS="-O0 -W -Wall -fbounds-check -fcheck=all -pedantic-errors -Wunderflow -fbacktrace -ffpe-trap=invalid,zero,overflow -g" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" == "optimized" ]; then + export FFLAGS="-O1 -fopenmp" + export OMP_NUM_THREADS=2 + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + fi cd ${CLAW}/amrclaw pytest From ac5b9ce47dbb784e4cbbd1094a212411d8851060 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 11:00:11 -0400 Subject: [PATCH 04/27] Correct bug in testing script --- .github/workflows/testing.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3d5edeef..d3a024d0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -58,9 +58,7 @@ jobs: with: path: amrclaw - - name: Install clawpack - env: - + - name: Install clawpack python run: | pip install --no-build-isolation --editable . From 2f615c631800923b84b40d6a6b017de4e848f2b4 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 11:04:13 -0400 Subject: [PATCH 05/27] Modify python versions for testing --- .github/workflows/testing.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index d3a024d0..0ce2c4ac 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -21,18 +21,18 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.10] + python-version: ["3.8", "3.10"] build: [optimized, debug] os: [ubuntu-latest, macos-latest] include: - os: ubuntu-latest - build: optimized - - os: ubuntu-latest - python-version: 3.10 build: debug - - os: macos-latest - python-version: 3.10 + - os: ubuntu-latest + python-version: "3.10" build: optimized + # - os: macos-latest + # python-version: "3.10" + # build: optimized steps: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 From a2faad305155ee982ad10f29ccb074b1fbb5aedf Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 11:08:13 -0400 Subject: [PATCH 06/27] Add specific macos instructions --- .github/workflows/testing.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0ce2c4ac..a3e6ebc0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -30,9 +30,9 @@ jobs: - os: ubuntu-latest python-version: "3.10" build: optimized - # - os: macos-latest - # python-version: "3.10" - # build: optimized + - os: macos-latest + python-version: "3.10" + build: optimized steps: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 @@ -40,12 +40,20 @@ jobs: python-version: ${{matrix.python-version}} - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install gfortran - gfortran --version + if [ "${{ matrix.os }}" == "macos-latest" ]; then + brew update + brew install gfortran + gfortran --version + elif [ "${{ matrix.os }}" == "ubuntu-latest" ]; then + sudo apt-get update + sudo apt-get install -y gfortran + gfortran --version + else + echo "Unsupported OS: ${{ matrix.os }}" + exit 1 + fi python -m pip install --upgrade pip pip install flake8 meson-python ninja pytest numpy - # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Checkout Clawpack uses: actions/checkout@v4.1.5 From efb6a71124b69ece1825103e7997dfcd693a9cc3 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 11:26:13 -0400 Subject: [PATCH 07/27] Use fort-lang's fortran compiler setup action --- .github/workflows/testing.yml | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a3e6ebc0..f6a7f2a2 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,10 +20,17 @@ jobs: Build and test a ${{ matrix.build }} version of AMRClaw on ${{ matrix.os }} with ${{ matrix.python-version }}. runs-on: ${{ matrix.os }} strategy: + fail-fast: false # Probably want to turn this off for a large matrix matrix: python-version: ["3.8", "3.10"] build: [optimized, debug] os: [ubuntu-latest, macos-latest] + toolchain: + - {compiler: gcc, version: 15} + - {compiler: intel, version: '2025.0'} + - {compiler: intel-classic, version: '2021.10'} + - {compiler: nvidia-hpc, version: '25.1'} + - {compiler: lfortran, version: '0.45.0'} include: - os: ubuntu-latest build: debug @@ -33,25 +40,26 @@ jobs: - os: macos-latest python-version: "3.10" build: optimized + exclude: + - os: macos-latest + toolchain: {compiler: intel, version: '2023.2'} + - os: macos-latest + toolchain: {compiler: nvidia-hpc, version: '23.11'} + steps: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{matrix.python-version}} - - name: Install dependencies + + - name: Set up compilers + uses: fortran-lang/setup-fortran + with: + compiler: ${{ matrix.toolchain.compiler }} + version: ${{ matrix.toolchain.version }} + + - name: Install python dependencies run: | - if [ "${{ matrix.os }}" == "macos-latest" ]; then - brew update - brew install gfortran - gfortran --version - elif [ "${{ matrix.os }}" == "ubuntu-latest" ]; then - sudo apt-get update - sudo apt-get install -y gfortran - gfortran --version - else - echo "Unsupported OS: ${{ matrix.os }}" - exit 1 - fi python -m pip install --upgrade pip pip install flake8 meson-python ninja pytest numpy From ab9bebeed319521f42b8d32531f584ae77247f8a Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 11:32:34 -0400 Subject: [PATCH 08/27] Fix fortran compiler action and added options for every compiler --- .github/workflows/testing.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f6a7f2a2..437ec833 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -53,7 +53,8 @@ jobs: python-version: ${{matrix.python-version}} - name: Set up compilers - uses: fortran-lang/setup-fortran + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran with: compiler: ${{ matrix.toolchain.compiler }} version: ${{ matrix.toolchain.version }} @@ -90,10 +91,36 @@ jobs: - name: Test with pytest run: | if [ "${{ matrix.build }}" == "debug" ]; then - export FFLAGS="-O0 -W -Wall -fbounds-check -fcheck=all -pedantic-errors -Wunderflow -fbacktrace -ffpe-trap=invalid,zero,overflow -g" + if [ "${{ matrix.toolchain.compiler}}" == "gcc" ]; then + export FFLAGS="-O0 -W -Wall -fbounds-check -fcheck=all -pedantic-errors -Wunderflow -fbacktrace -ffpe-trap=invalid,zero,overflow -g" + elif [ "${{ matrix.toolchain.compiler}}" == "intel" ]; then + export FFLAGS="-O0 -g -check all -warn all -traceback" + elif [ "${{ matrix.toolchain.compiler}}" == "intel-classic" ]; then + export FFLAGS="-O0 -g -check all -warn all -traceback" + elif [ "${{ matrix.toolchain.compiler}}" == "nvidia-hpc" ]; then + export FFLAGS="-O0 -g -check all -warn all -traceback" + elif [ "${{ matrix.toolchain.compiler}}" == "lfortran" ]; then + export FFLAGS="-O0 -g -fcheck=all -fbacktrace + else + echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" + exit 1 + fi export OMP_NUM_THREADS=1 elif [ "${{ matrix.build }}" == "optimized" ]; then - export FFLAGS="-O1 -fopenmp" + if [ "${{ matrix.toolchain.compiler}}" == "gcc" ]; then + export FFLAGS="-O1 -march=native -mtune=native -fopenmp" + elif [ "${{ matrix.toolchain.compiler}}" == "intel" ]; then + export FFLAGS="-O1 -xHost -qopenmp" + elif [ "${{ matrix.toolchain.compiler}}" == "intel-classic" ]; then + export FFLAGS="-O1 -xHost -qopenmp" + elif [ "${{ matrix.toolchain.compiler}}" == "nvidia-hpc" ]; then + export FFLAGS="-O1 -xHost -qopenmp" + elif [ "${{ matrix.toolchain.compiler}}" == "lfortran" ]; then + export FFLAGS="-O1 -fopenmp" + else + echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" + exit 1 + fi export OMP_NUM_THREADS=2 else echo "Unknown build type: ${{ matrix.build }}" From 5f8ed40321e922659609db126494cb9b461fbfcd Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 11:49:17 -0400 Subject: [PATCH 09/27] Simplify testing matrix --- .github/workflows/testing.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 437ec833..2fc2abcb 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -17,20 +17,20 @@ env: jobs: tests: name: > - Build and test a ${{ matrix.build }} version of AMRClaw on ${{ matrix.os }} with ${{ matrix.python-version }}. + Build ${{ matrix.build }} - ${{ matrix.os }} with ${{ matrix.python-version }}. runs-on: ${{ matrix.os }} strategy: fail-fast: false # Probably want to turn this off for a large matrix matrix: python-version: ["3.8", "3.10"] build: [optimized, debug] - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] #, macos-latest] toolchain: - {compiler: gcc, version: 15} - - {compiler: intel, version: '2025.0'} - - {compiler: intel-classic, version: '2021.10'} - - {compiler: nvidia-hpc, version: '25.1'} - - {compiler: lfortran, version: '0.45.0'} + # - {compiler: intel, version: '2025.0'} + # - {compiler: intel-classic, version: '2021.10'} + # - {compiler: nvidia-hpc, version: '25.1'} + # - {compiler: lfortran, version: '0.45.0'} # Does not work with meson include: - os: ubuntu-latest build: debug From 14f13325e4174e045f156882c89d375a6d096518 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 12:03:59 -0400 Subject: [PATCH 10/27] Rework exclude/include lists --- .github/workflows/testing.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2fc2abcb..c97df627 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -22,10 +22,11 @@ jobs: strategy: fail-fast: false # Probably want to turn this off for a large matrix matrix: - python-version: ["3.8", "3.10"] - build: [optimized, debug] os: [ubuntu-latest] #, macos-latest] + python-version: ["3.12"] + build: [optimized] toolchain: + - {compiler: gcc, version: 14} - {compiler: gcc, version: 15} # - {compiler: intel, version: '2025.0'} # - {compiler: intel-classic, version: '2021.10'} @@ -33,18 +34,11 @@ jobs: # - {compiler: lfortran, version: '0.45.0'} # Does not work with meson include: - os: ubuntu-latest - build: debug - - os: ubuntu-latest - python-version: "3.10" - build: optimized - - os: macos-latest - python-version: "3.10" - build: optimized + build: [optimized, debug] + python-version: ["3.8", "3.12"] exclude: - - os: macos-latest - toolchain: {compiler: intel, version: '2023.2'} - - os: macos-latest - toolchain: {compiler: nvidia-hpc, version: '23.11'} + - os: ubuntu-latest + toolchain: {compiler: gcc, version: 15} steps: - name: Set up Python ${{ matrix.python-version }} From 079f65c81e797abc44d8eaba24784020e076b565 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 13:09:01 -0400 Subject: [PATCH 11/27] Fix bug in python version request --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c97df627..4b740732 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -44,7 +44,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{matrix.python-version}} + python-version: ${{ matrix.python-version }} - name: Set up compilers uses: fortran-lang/setup-fortran@v1 From e1a489722feee03f0413eda121cfc0979b92566d Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 13:26:09 -0400 Subject: [PATCH 12/27] Try to correct the python version rule again --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4b740732..8ab4d0aa 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest] #, macos-latest] - python-version: ["3.12"] + python-version: 3.12 build: [optimized] toolchain: - {compiler: gcc, version: 14} From a47420151e72ae40a4dce593cec0736df8c4b0e5 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 13:28:35 -0400 Subject: [PATCH 13/27] Fix python version syntax --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8ab4d0aa..6dd2d322 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest] #, macos-latest] - python-version: 3.12 + python-version: [3.12] build: [optimized] toolchain: - {compiler: gcc, version: 14} @@ -35,7 +35,7 @@ jobs: include: - os: ubuntu-latest build: [optimized, debug] - python-version: ["3.8", "3.12"] + python-version: [3.8, 3.12] exclude: - os: ubuntu-latest toolchain: {compiler: gcc, version: 15} From 520717091db782dc4c3399b947a8fc4003901696 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 13:38:33 -0400 Subject: [PATCH 14/27] Modify settings of action script --- .github/workflows/testing.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 6dd2d322..7542c980 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false # Probably want to turn this off for a large matrix matrix: - os: [ubuntu-latest] #, macos-latest] + os: [ubuntu-latest, macos-latest] python-version: [3.12] build: [optimized] toolchain: @@ -34,11 +34,13 @@ jobs: # - {compiler: lfortran, version: '0.45.0'} # Does not work with meson include: - os: ubuntu-latest - build: [optimized, debug] - python-version: [3.8, 3.12] + build: debug + python-version: 3.8 exclude: - os: ubuntu-latest toolchain: {compiler: gcc, version: 15} + - os: macos-latest + toolchain: {compiler: gcc, version: 14} steps: - name: Set up Python ${{ matrix.python-version }} From 129c7bc0a21b58bc6a0b09b80ac938bd93cbf97f Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 14:07:27 -0400 Subject: [PATCH 15/27] Modify settings of action script --- .github/workflows/testing.yml | 70 +++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7542c980..3ace3d86 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -86,42 +86,42 @@ jobs: - name: Test with pytest run: | - if [ "${{ matrix.build }}" == "debug" ]; then - if [ "${{ matrix.toolchain.compiler}}" == "gcc" ]; then - export FFLAGS="-O0 -W -Wall -fbounds-check -fcheck=all -pedantic-errors -Wunderflow -fbacktrace -ffpe-trap=invalid,zero,overflow -g" - elif [ "${{ matrix.toolchain.compiler}}" == "intel" ]; then - export FFLAGS="-O0 -g -check all -warn all -traceback" - elif [ "${{ matrix.toolchain.compiler}}" == "intel-classic" ]; then - export FFLAGS="-O0 -g -check all -warn all -traceback" - elif [ "${{ matrix.toolchain.compiler}}" == "nvidia-hpc" ]; then - export FFLAGS="-O0 -g -check all -warn all -traceback" - elif [ "${{ matrix.toolchain.compiler}}" == "lfortran" ]; then - export FFLAGS="-O0 -g -fcheck=all -fbacktrace - else - echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" + case "${{ matrix.toolchain.compiler }}" in + gcc) + case "${{ matrix.build }}" in + debug) + export FFLAGS="-g -Wall -Wextra -Werror" + export OMP_NUM_THREADS=1 + ;; + optimized) + export FFLAGS="-O1" + export OMP_NUM_THREADS=2 + ;; + *) + echo "ERROR: Unknown build type: ${{ matrix.build }}" + exit 1 + ;; + esac + intel) + case "${{ matrix.build }}" in + debug) + export FFLAGS="-g -Wall -Wextra -Werror" + export OMP_NUM_THREADS=1 + ;; + optimized) + export FFLAGS="-O1 -xHost -qopenmp" + export OMP_NUM_THREADS=2 + ;; + *) + echo "ERROR: Unknown build type: ${{ matrix.build }}" + exit 1 + ;; + esac + *) + echo "ERROR: Unknown compiler: ${{ matrix.toolchain.compiler }}" exit 1 - fi - export OMP_NUM_THREADS=1 - elif [ "${{ matrix.build }}" == "optimized" ]; then - if [ "${{ matrix.toolchain.compiler}}" == "gcc" ]; then - export FFLAGS="-O1 -march=native -mtune=native -fopenmp" - elif [ "${{ matrix.toolchain.compiler}}" == "intel" ]; then - export FFLAGS="-O1 -xHost -qopenmp" - elif [ "${{ matrix.toolchain.compiler}}" == "intel-classic" ]; then - export FFLAGS="-O1 -xHost -qopenmp" - elif [ "${{ matrix.toolchain.compiler}}" == "nvidia-hpc" ]; then - export FFLAGS="-O1 -xHost -qopenmp" - elif [ "${{ matrix.toolchain.compiler}}" == "lfortran" ]; then - export FFLAGS="-O1 -fopenmp" - else - echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" - exit 1 - fi - export OMP_NUM_THREADS=2 - else - echo "Unknown build type: ${{ matrix.build }}" - exit 1 - fi + ;; + esac cd ${CLAW}/amrclaw pytest From e26d46e0f1aa24f2f0dd9fb0308644e463a35acd Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 21 Aug 2025 15:19:04 -0400 Subject: [PATCH 16/27] Modify settings of action script --- .github/workflows/testing.yml | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3ace3d86..0d35fbc8 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -90,38 +90,25 @@ jobs: gcc) case "${{ matrix.build }}" in debug) - export FFLAGS="-g -Wall -Wextra -Werror" + export FFLAGS="-g -O0 -fcheck=all -fbacktrace" export OMP_NUM_THREADS=1 ;; optimized) - export FFLAGS="-O1" + export FFLAGS="-O1 -fopenmp" export OMP_NUM_THREADS=2 ;; - *) - echo "ERROR: Unknown build type: ${{ matrix.build }}" - exit 1 - ;; esac intel) - case "${{ matrix.build }}" in - debug) - export FFLAGS="-g -Wall -Wextra -Werror" - export OMP_NUM_THREADS=1 - ;; - optimized) - export FFLAGS="-O1 -xHost -qopenmp" - export OMP_NUM_THREADS=2 - ;; - *) - echo "ERROR: Unknown build type: ${{ matrix.build }}" - exit 1 - ;; - esac + echo "Using Intel compiler" + exit 1 # Temporarily disable Intel compiler testing + ;; *) - echo "ERROR: Unknown compiler: ${{ matrix.toolchain.compiler }}" + echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" exit 1 ;; esac + echo "FFLAGS: $FFLAGS" + echo "OMP_NUM_THREADS: $OMP_NUM_THREADS" cd ${CLAW}/amrclaw pytest From 61c2b0a1ebb72cc2d748fa202e838d88934c43ec Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 10:28:40 -0400 Subject: [PATCH 17/27] Modify settings of action script --- .github/workflows/testing.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0d35fbc8..b2fd4a24 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -36,6 +36,7 @@ jobs: - os: ubuntu-latest build: debug python-version: 3.8 + toolchain: {compiler: gcc, version: 14} exclude: - os: ubuntu-latest toolchain: {compiler: gcc, version: 15} @@ -97,6 +98,10 @@ jobs: export FFLAGS="-O1 -fopenmp" export OMP_NUM_THREADS=2 ;; + *) + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + ;; esac intel) echo "Using Intel compiler" From 7d6c75978dd585e4a43b0d33608d076fb9ecc8b1 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 10:35:01 -0400 Subject: [PATCH 18/27] Switch back if-else --- .github/workflows/testing.yml | 49 ++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b2fd4a24..405e70f6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -87,31 +87,32 @@ jobs: - name: Test with pytest run: | - case "${{ matrix.toolchain.compiler }}" in - gcc) - case "${{ matrix.build }}" in - debug) - export FFLAGS="-g -O0 -fcheck=all -fbacktrace" - export OMP_NUM_THREADS=1 - ;; - optimized) - export FFLAGS="-O1 -fopenmp" - export OMP_NUM_THREADS=2 - ;; - *) - echo "Unknown build type: ${{ matrix.build }}" - exit 1 - ;; - esac - intel) - echo "Using Intel compiler" - exit 1 # Temporarily disable Intel compiler testing - ;; - *) - echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" + if [ "${{ matrix.toolchain.compiler }}" = "gcc" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="-g -O0 -fcheck=all -fbacktrace" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" = "optimized" ]; then + export FFLAGS="-O1 -fopenmp" + export OMP_NUM_THREADS=2 + else + echo "Unknown build type: ${{ matrix.build }}" exit 1 - ;; - esac + fi + elif [ "${{ matrix.toolchain.compiler }}" = "intel" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="-g -O0 -check all -traceback" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" = "optimized" ]; then + export FFLAGS="-O1 -qopenmp" + export OMP_NUM_THREADS=2 + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + fi + else + echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" + exit 1 + fi echo "FFLAGS: $FFLAGS" echo "OMP_NUM_THREADS: $OMP_NUM_THREADS" cd ${CLAW}/amrclaw From b0cdf4bd99037f15c8adf34d8eac9167df8669a7 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 10:44:11 -0400 Subject: [PATCH 19/27] Add additional compiler options and remove python 3.8 --- .github/workflows/testing.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 405e70f6..bd7c6220 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -27,21 +27,20 @@ jobs: build: [optimized] toolchain: - {compiler: gcc, version: 14} - - {compiler: gcc, version: 15} - # - {compiler: intel, version: '2025.0'} - # - {compiler: intel-classic, version: '2021.10'} + - {compiler: intel, version: '2025.0'} + - {compiler: intel-classic, version: '2021.10'} # - {compiler: nvidia-hpc, version: '25.1'} # - {compiler: lfortran, version: '0.45.0'} # Does not work with meson include: - os: ubuntu-latest build: debug - python-version: 3.8 - toolchain: {compiler: gcc, version: 14} - exclude: - - os: ubuntu-latest + # python-version: 3.8 + # toolchain: {compiler: gcc, version: 14} + - os: macos-latest toolchain: {compiler: gcc, version: 15} + exclude: - os: macos-latest - toolchain: {compiler: gcc, version: 14} + toolchain: {compiler: intel, version: '2025.0'} # Intel not available on macOS runners steps: - name: Set up Python ${{ matrix.python-version }} @@ -109,6 +108,13 @@ jobs: echo "Unknown build type: ${{ matrix.build }}" exit 1 fi + elif [ "${{ matrix.toolchain.compiler }}" = "intel-classic" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="-g -O0 -check all -traceback" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" = "optimized" ]; then + export FFLAGS="-O1 -openmp" + export OMP_NUM_THREADS=2 else echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" exit 1 From 9e88f160ed8339d6a370393220676f7c229897bd Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 11:38:41 -0400 Subject: [PATCH 20/27] Add new flags and additional compilers --- .github/workflows/testing.yml | 41 ++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bd7c6220..35a1cce0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -34,10 +34,12 @@ jobs: include: - os: ubuntu-latest build: debug - # python-version: 3.8 - # toolchain: {compiler: gcc, version: 14} + toolchain: {compiler: intel, version: '2025.0'} - os: macos-latest toolchain: {compiler: gcc, version: 15} + - os: macos-latest + build: debug + toolchain: {compiler: gcc, version: 15} exclude: - os: macos-latest toolchain: {compiler: intel, version: '2025.0'} # Intel not available on macOS runners @@ -88,15 +90,23 @@ jobs: run: | if [ "${{ matrix.toolchain.compiler }}" = "gcc" ]; then if [ "${{ matrix.build }}" = "debug" ]; then - export FFLAGS="-g -O0 -fcheck=all -fbacktrace" + export FFLAGS="-O0 -g -fcheck=all -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -finit-real=nan -finit-integer=nan -Wall -Wunderflow -Wextra -Wconversion -Wuninitialized -Warray-bounds -Wshadow -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-but-set-variable" export OMP_NUM_THREADS=1 elif [ "${{ matrix.build }}" = "optimized" ]; then - export FFLAGS="-O1 -fopenmp" + export FFLAGS="-O1 -fopenmp -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong -flto -march=native" export OMP_NUM_THREADS=2 else echo "Unknown build type: ${{ matrix.build }}" exit 1 fi + elif [ "${{ matrix.toolchain.compiler }}" = "intel-classic" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" = "optimized" ]; then + export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip " + export OMP_NUM_THREADS=2 + fi elif [ "${{ matrix.toolchain.compiler }}" = "intel" ]; then if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="-g -O0 -check all -traceback" @@ -108,13 +118,32 @@ jobs: echo "Unknown build type: ${{ matrix.build }}" exit 1 fi - elif [ "${{ matrix.toolchain.compiler }}" = "intel-classic" ]; then + elif [ "${{ matrix.toolchain.compiler }}" = "nvidia-hpc" ]; then + echo "nvidia-hpc compiler not yet supported" + exit 1 if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="-g -O0 -check all -traceback" export OMP_NUM_THREADS=1 elif [ "${{ matrix.build }}" = "optimized" ]; then - export FFLAGS="-O1 -openmp" + export FFLAGS="-O1 -qopenmp" export OMP_NUM_THREADS=2 + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + fi + elif [ "${{ matrix.toolchain.compiler }}" = "lfortran" ]; then + echo "lfortran compiler not yet supported" + exit 1 + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" = "optimized" ]; then + export FFLAGS="" + export OMP_NUM_THREADS=2 + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + fi else echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" exit 1 From db3a6ba571d090c5cb8948a036c06a6187e992e6 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 11:57:22 -0400 Subject: [PATCH 21/27] Rework build matrix and fix bugs --- .github/workflows/testing.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 35a1cce0..6e6ad9c4 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -17,32 +17,34 @@ env: jobs: tests: name: > - Build ${{ matrix.build }} - ${{ matrix.os }} with ${{ matrix.python-version }}. + Build ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }}. runs-on: ${{ matrix.os }} strategy: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] python-version: [3.12] - build: [optimized] + build: [opt] toolchain: - {compiler: gcc, version: 14} - {compiler: intel, version: '2025.0'} - {compiler: intel-classic, version: '2021.10'} - # - {compiler: nvidia-hpc, version: '25.1'} - # - {compiler: lfortran, version: '0.45.0'} # Does not work with meson + - {compiler: nvidia-hpc, version: '25.1'} + # - {compiler: lfortran, version: '0.45.0'} # lfortran not yet supported + # - {compiler: flang, version: '20.1.0'} # flang not yet supported include: - os: ubuntu-latest build: debug toolchain: {compiler: intel, version: '2025.0'} - - os: macos-latest - toolchain: {compiler: gcc, version: 15} - os: macos-latest build: debug toolchain: {compiler: gcc, version: 15} exclude: + # Remove compilers not available on macOS runners + - os: macos-latest + toolchain: {compiler: intel, version: '2025.0'} - os: macos-latest - toolchain: {compiler: intel, version: '2025.0'} # Intel not available on macOS runners + toolchain: {compiler: nvidia-hpc, version: '2021.10'} steps: - name: Set up Python ${{ matrix.python-version }} @@ -92,7 +94,7 @@ jobs: if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="-O0 -g -fcheck=all -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -finit-real=nan -finit-integer=nan -Wall -Wunderflow -Wextra -Wconversion -Wuninitialized -Warray-bounds -Wshadow -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-but-set-variable" export OMP_NUM_THREADS=1 - elif [ "${{ matrix.build }}" = "optimized" ]; then + elif [ "${{ matrix.build }}" = "opt" ]; then export FFLAGS="-O1 -fopenmp -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong -flto -march=native" export OMP_NUM_THREADS=2 else @@ -103,7 +105,7 @@ jobs: if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds" export OMP_NUM_THREADS=1 - elif [ "${{ matrix.build }}" = "optimized" ]; then + elif [ "${{ matrix.build }}" = "opt" ]; then export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip " export OMP_NUM_THREADS=2 fi @@ -111,7 +113,7 @@ jobs: if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="-g -O0 -check all -traceback" export OMP_NUM_THREADS=1 - elif [ "${{ matrix.build }}" = "optimized" ]; then + elif [ "${{ matrix.build }}" = "opt" ]; then export FFLAGS="-O1 -qopenmp" export OMP_NUM_THREADS=2 else @@ -124,7 +126,7 @@ jobs: if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="-g -O0 -check all -traceback" export OMP_NUM_THREADS=1 - elif [ "${{ matrix.build }}" = "optimized" ]; then + elif [ "${{ matrix.build }}" = "opt" ]; then export FFLAGS="-O1 -qopenmp" export OMP_NUM_THREADS=2 else @@ -137,7 +139,7 @@ jobs: if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="" export OMP_NUM_THREADS=1 - elif [ "${{ matrix.build }}" = "optimized" ]; then + elif [ "${{ matrix.build }}" = "opt" ]; then export FFLAGS="" export OMP_NUM_THREADS=2 else From 3533440a73fbb589414f3e0a0ea6f62603d8645b Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 13:01:13 -0400 Subject: [PATCH 22/27] Again remove broken toolchains --- .github/workflows/testing.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 6e6ad9c4..e79aa959 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -17,7 +17,7 @@ env: jobs: tests: name: > - Build ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }}. + ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # Probably want to turn this off for a large matrix @@ -29,7 +29,7 @@ jobs: - {compiler: gcc, version: 14} - {compiler: intel, version: '2025.0'} - {compiler: intel-classic, version: '2021.10'} - - {compiler: nvidia-hpc, version: '25.1'} + # - {compiler: nvidia-hpc, version: '25.1'} # does not build python # - {compiler: lfortran, version: '0.45.0'} # lfortran not yet supported # - {compiler: flang, version: '20.1.0'} # flang not yet supported include: @@ -40,11 +40,8 @@ jobs: build: debug toolchain: {compiler: gcc, version: 15} exclude: - # Remove compilers not available on macOS runners - os: macos-latest toolchain: {compiler: intel, version: '2025.0'} - - os: macos-latest - toolchain: {compiler: nvidia-hpc, version: '2021.10'} steps: - name: Set up Python ${{ matrix.python-version }} @@ -106,15 +103,15 @@ jobs: export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds" export OMP_NUM_THREADS=1 elif [ "${{ matrix.build }}" = "opt" ]; then - export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip " + export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip" export OMP_NUM_THREADS=2 fi elif [ "${{ matrix.toolchain.compiler }}" = "intel" ]; then if [ "${{ matrix.build }}" = "debug" ]; then - export FFLAGS="-g -O0 -check all -traceback" + export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds" export OMP_NUM_THREADS=1 elif [ "${{ matrix.build }}" = "opt" ]; then - export FFLAGS="-O1 -qopenmp" + export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip" export OMP_NUM_THREADS=2 else echo "Unknown build type: ${{ matrix.build }}" @@ -133,8 +130,8 @@ jobs: echo "Unknown build type: ${{ matrix.build }}" exit 1 fi - elif [ "${{ matrix.toolchain.compiler }}" = "lfortran" ]; then - echo "lfortran compiler not yet supported" + elif [ "${{ matrix.toolchain.compiler }}" = "flang" ]; then + echo "flang compiler not yet supported" exit 1 if [ "${{ matrix.build }}" = "debug" ]; then export FFLAGS="" From 47034e1bc5cad3ad8ea75db2903d8bfd42b21606 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 15:21:43 -0400 Subject: [PATCH 23/27] Minor tweaks and removal of non-working toolchains --- .github/workflows/testing.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e79aa959..8be82ce0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -26,22 +26,23 @@ jobs: python-version: [3.12] build: [opt] toolchain: - - {compiler: gcc, version: 14} - - {compiler: intel, version: '2025.0'} - - {compiler: intel-classic, version: '2021.10'} + - {compiler: gcc, version: 10} + - {compiler: gcc, version: 15} + # - {compiler: intel, version: '2025.0'} + # - {compiler: intel-classic, version: '2021.10'} # - {compiler: nvidia-hpc, version: '25.1'} # does not build python # - {compiler: lfortran, version: '0.45.0'} # lfortran not yet supported # - {compiler: flang, version: '20.1.0'} # flang not yet supported include: - os: ubuntu-latest build: debug - toolchain: {compiler: intel, version: '2025.0'} + toolchain: {compiler: gcc, version: 14} - os: macos-latest build: debug toolchain: {compiler: gcc, version: 15} exclude: - - os: macos-latest - toolchain: {compiler: intel, version: '2025.0'} + - os: ubuntu-latest + toolchain: {compiler: gcc, version: 15} steps: - name: Set up Python ${{ matrix.python-version }} @@ -143,6 +144,17 @@ jobs: echo "Unknown build type: ${{ matrix.build }}" exit 1 fi + elif [ "${{ matrix.toolchain.compiler }}" = "lfortran" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="" + export OMP_NUM_THREADS=1 + elif [ "${{ matrix.build }}" = "opt" ]; then + export FFLAGS="--fast --openmp" + export OMP_NUM_THREADS=2 + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + fi else echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" exit 1 @@ -159,3 +171,7 @@ jobs: name: test_results path: ${{ env.CLAW }}/amrclaw/*_output if-no-files-found: ignore + + +# lfortran +# optimized = --openmp From 0bc8a878a5def8474c223f57b22295dac707d045 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 16:54:44 -0400 Subject: [PATCH 24/27] Final tweak to compiler toolchain (hopefully) --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8be82ce0..711f5100 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -26,7 +26,7 @@ jobs: python-version: [3.12] build: [opt] toolchain: - - {compiler: gcc, version: 10} + - {compiler: gcc, version: 12} - {compiler: gcc, version: 15} # - {compiler: intel, version: '2025.0'} # - {compiler: intel-classic, version: '2021.10'} From 9824e54d4474846046fa5a09a7ad1598a5a139c6 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 17:05:15 -0400 Subject: [PATCH 25/27] Remove GCC compiler version that is too old and add python versions --- .github/workflows/testing.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 711f5100..24590afd 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -17,16 +17,16 @@ env: jobs: tests: name: > - ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} + ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} - py ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] python-version: [3.12] - build: [opt] + build: [debug, opt] toolchain: - - {compiler: gcc, version: 12} + - {compiler: gcc, version: 14} - {compiler: gcc, version: 15} # - {compiler: intel, version: '2025.0'} # - {compiler: intel-classic, version: '2021.10'} @@ -35,14 +35,16 @@ jobs: # - {compiler: flang, version: '20.1.0'} # flang not yet supported include: - os: ubuntu-latest - build: debug - toolchain: {compiler: gcc, version: 14} - - os: macos-latest - build: debug - toolchain: {compiler: gcc, version: 15} + build: opt + python-version: 3.8 + # - os: macos-latest + # build: debug + # toolchain: {compiler: gcc, version: 15} exclude: - os: ubuntu-latest toolchain: {compiler: gcc, version: 15} + - os: macos-latest + toolchain: {compiler: gcc, version: 14} steps: - name: Set up Python ${{ matrix.python-version }} From b97a6623a1363b5f9b80ac5a675361f180295b64 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 18:35:53 -0400 Subject: [PATCH 26/27] Fill out include and update matrix --- .github/workflows/testing.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 24590afd..2f8a2ba6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,8 +23,8 @@ jobs: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.12] build: [debug, opt] + python-version: [3.12] toolchain: - {compiler: gcc, version: 14} - {compiler: gcc, version: 15} @@ -37,6 +37,7 @@ jobs: - os: ubuntu-latest build: opt python-version: 3.8 + toolchain: {compiler: gcc, version: 14} # - os: macos-latest # build: debug # toolchain: {compiler: gcc, version: 15} From 250c6ee541da28427d61b4c9e94c0a3a705aae4e Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 22 Aug 2025 18:43:27 -0400 Subject: [PATCH 27/27] Give up on more python versions --- .github/workflows/testing.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2f8a2ba6..3cd0bf43 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -33,14 +33,12 @@ jobs: # - {compiler: nvidia-hpc, version: '25.1'} # does not build python # - {compiler: lfortran, version: '0.45.0'} # lfortran not yet supported # - {compiler: flang, version: '20.1.0'} # flang not yet supported - include: - - os: ubuntu-latest - build: opt - python-version: 3.8 - toolchain: {compiler: gcc, version: 14} - # - os: macos-latest - # build: debug - # toolchain: {compiler: gcc, version: 15} + # include: + # 3.8 does not seem to work. + # - os: ubuntu-latest + # build: opt + # python-version: 3.8 + # toolchain: {compiler: gcc, version: 14} exclude: - os: ubuntu-latest toolchain: {compiler: gcc, version: 15} @@ -174,7 +172,3 @@ jobs: name: test_results path: ${{ env.CLAW }}/amrclaw/*_output if-no-files-found: ignore - - -# lfortran -# optimized = --openmp