Skip to content

CI: Build fcompare on csd3-dawn test job #435

CI: Build fcompare on csd3-dawn test job

CI: Build fcompare on csd3-dawn test job #435

name: Regression Tests
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
binarybh:
name: BinaryBH
runs-on: ubuntu-24.04
env:
AMREX_HOME: ${{ github.workspace }}/amrex
BINARYBH_EXAMPLE_DIR: ${{ github.workspace }}/GRTeclyn/Examples/BinaryBH
GCC_VERSION: 14
BUILD_ARGS: >
COMP=gnu
USE_MPI=TRUE
USE_CCACHE=TRUE
steps:
- name: Checkout AMReX
uses: actions/checkout@v4
with:
repository: AMReX-Codes/amrex
path: amrex
- name: Checkout GRTeclyn
uses: actions/checkout@v4
with:
path: GRTeclyn
- name: Set Up Cache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- name: Update package manager database
id: update-database
continue-on-error: true
run: sudo apt-get update
# This is quite slow so only do this if the previous command fails
- name: Update package repository mirrors if necessary
if: steps.update-database.outcome == 'failure'
run: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
sudo apt-get update
- name: Install dependencies
run: sudo apt-get -y --no-install-recommends install libopenmpi-dev cpp-${{ env.GCC_VERSION }} ccache
- name: Set Compilers
run: |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${{ env.GCC_VERSION }} 1000
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ env.GCC_VERSION }} 100
# workaround for https://answers.launchpad.net/ubuntu/+question/816000
sudo update-alternatives --remove-all cpp
sudo rm -rf /etc/alternatives/cpp
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-${{ env.GCC_VERSION }} 1000
- name: Build BinaryBH example
run: make -j 4 ${{ env.BUILD_ARGS }}
working-directory: ${{ env.BINARYBH_EXAMPLE_DIR }}
- name: Build fcompare tool
run: make -j 4 ${{ env.BUILD_ARGS }}
working-directory: ${{ env.AMREX_HOME }}/Tools/Plotfile
- name: Run BinaryBH example using test parameters
run: mpiexec -n 2 ./main3d.gnu.MPI.ex ./params_test.txt
working-directory: ${{ env.BINARYBH_EXAMPLE_DIR }}
- name: Compare plotfile from final step with saved plotfile
run: |
mpiexec -n 1 \
${AMREX_HOME}/Tools/Plotfile/fcompare.gnu.MPI.ex \
--abs_tol 1e-10 \
--rel_tol 1e-10 \
--abort_if_not_all_found \
${GITHUB_WORKSPACE}/GRTeclyn/.github/workflows/data/plt00008_compare \
${BINARYBH_EXAMPLE_DIR}/plt00008
- name: Restart from last checkpoint and evolve for a few more steps
run: >
mpiexec -n 2 ./main3d.gnu.MPI.ex ./params_test.txt
amr.restart=chk00008 max_steps=12
working-directory: ${{ env.BINARYBH_EXAMPLE_DIR }}