diff --git a/.github/workflows/test_t8code_advection.yml b/.github/workflows/test_t8code_advection.yml new file mode 100644 index 0000000000..0a38678980 --- /dev/null +++ b/.github/workflows/test_t8code_advection.yml @@ -0,0 +1,125 @@ +name: test t8code advection examples + + +# This file is part of t8code. +# t8code is a C library to manage a collection (a forest) of multiple +# connected adaptive space-trees of general element types in parallel. +# +# Copyright (C) 2026 the developers +# +# t8code is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# t8code is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with t8code; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +env: + DEBUG_CONFIG: "-O1" + +on: + workflow_call: + inputs: + MAKEFLAGS: + required: true + type: string + description: 'Make flags to use for compilation (like -j4)' + MPIFLAGS: + required: true + type: string + description: 'Flags passed to mpirun when executing tests (like -np 4)' + MPI: + required: true + type: string + description: 'Use MPI for compilation (ON/OFF)' + BUILD_TYPE: + required: true + type: string + description: 'Build type (Release/Debug)' + TEST_LEVEL: + required: true + type: string + description: 'Test level used for configuring' + default: 'T8_TEST_LEVEL_FULL' + +jobs: + t8code_advection_test: + timeout-minutes: 25 + runs-on: ubuntu-latest + container: dlramr/t8code-dependencies:t8-dependencies-ubuntu-gcc + steps: +# +# Setup +# + - name: Download artifacts + uses: actions/download-artifact@v8 + with: + name: SC_P4EST_MPI_${{ inputs.MPI }} + - name: untar artifact + run: tar -xf artifact.tar && rm artifact.tar + # This seems to be necessary because of the docker container + - name: disable ownership checks + run: git config --global --add safe.directory '*' + - name: Get input vars + run: export MAKEFLAGS="${{ inputs.MAKEFLAGS }}" + && export MPIFLAGS="${{ inputs.MPIFLAGS }}" + && export MPI="${{ inputs.MPI }}" + && export BUILD_TYPE="${{ inputs.BUILD_TYPE }}" + && export SC_PATH=$PWD/sc/build/$BUILD_TYPE + && export P4EST_PATH=$PWD/p4est/build/$BUILD_TYPE + && echo MAKEFLAGS="$MAKEFLAGS" >> $GITHUB_ENV + && echo MPIFLAGS="$MPIFLAGS" >> $GITHUB_ENV + && echo MPI="$MPI" >> $GITHUB_ENV + && echo BUILD_TYPE="$BUILD_TYPE" >> $GITHUB_ENV + && echo SC_PATH="$SC_PATH" >> $GITHUB_ENV + && echo P4EST_PATH="$P4EST_PATH" >> $GITHUB_ENV + +# +# T8CODE +# +# + # build config vars + - name: Set test level + run: export TEST_LEVEL_FLAG="-DT8CODE_TEST_LEVEL=${{ inputs.TEST_LEVEL }}" + && echo TEST_LEVEL_FLAG="$TEST_LEVEL_FLAG" >> $GITHUB_ENV + - name: build config variables + run: export CONFIG_OPTIONS="${TEST_LEVEL_FLAG} -GNinja -DCMAKE_C_FLAGS_DEBUG=${DEBUG_CONFIG} -DCMAKE_CXX_FLAGS_DEBUG=${DEBUG_CONFIG} -DT8CODE_BUILD_MESH_HANDLE=ON -DT8CODE_USE_SYSTEM_SC=ON -DT8CODE_USE_SYSTEM_P4EST=ON -DT8CODE_BUILD_PEDANTIC=ON -DT8CODE_BUILD_WALL=ON -DT8CODE_BUILD_WERROR=ON -DT8CODE_BUILD_WEXTRA=ON -DT8CODE_ENABLE_MPI=$MPI -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSC_DIR=$SC_PATH/install/cmake -DP4EST_DIR=$P4EST_PATH/install/cmake" + && echo CONFIG_OPTIONS="$CONFIG_OPTIONS" >> $GITHUB_ENV + # cmake and test with api options + - name: echo cmake line + run: echo cmake ../ $CONFIG_OPTIONS + - name: cmake + run: mkdir build && cd build && cmake ../ $CONFIG_OPTIONS + - name: OnFailUploadLog + if: failure() + uses: actions/upload-artifact@v7 + with: + name: cmake_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_api.log + path: build/CMakeFiles/CMakeOutput.log + - name: ninja + run: cd build && ninja $MAKEFLAGS + - name: ninja install + run: cd build && ninja install $MAKEFLAGS + - name: OnFailUploadLog + if: failure() + uses: actions/upload-artifact@v7 + with: + name: test-suite_${{ inputs.BUILD_TYPE }}_MPI_${{ inputs.MPI }}_api.log + path: build/Testing/Temporary/LastTest.log + + - name: run advection test 1D Mesh Constant 1 in x-direction + working-directory: build/example/advect + run: mpirun $MPIFLAGS ./t8_advection -u 1 -e 1 -l 2 -r 1 -T 0.5 -C 0.5 -a 1 -o + - name: run advection test 2D Mesh Constant 1 in x,y, and z. + working-directory: build/example/advect + run: mpirun $MPIFLAGS ./t8_advection -u 2 -e 7 -l 2 -r 1 -T 0.5 -C 0.5 -a 1 -o + - name: run advection test 3D Mesh with turbulent flow + working-directory: build/example/advect + run: mpirun $MPIFLAGS ./t8_advection -u 3 -e 8 -l 2 -r 1 -T 0.5 -C 0.5 -a 1 -o diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 92c72c8853..868785f89c 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -188,6 +188,25 @@ jobs: BUILD_TYPE: ${{ matrix.BUILD_TYPE }} TEST_LEVEL: ${{ github.event_name == 'pull_request' && 'T8_TEST_LEVEL_MEDIUM' || 'T8_TEST_LEVEL_FULL' }} # Set TEST_LEVEL to medium if the event is a PR, otherwise full. + t8code_advection_test: + needs: preparation + uses: ./.github/workflows/test_t8code_advection.yml + strategy: + fail-fast: false + matrix: + MPI: [ON] # For now the fortran API only supports building with MPI + BUILD_TYPE: [Release] + include: + - MAKEFLAGS: -j4 + MPIFLAGS: -np 4 + with: + MAKEFLAGS: ${{ matrix.MAKEFLAGS }} + MPIFLAGS: ${{ matrix.MPIFLAGS }} + MPI: ${{ matrix.MPI }} + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + TEST_LEVEL: ${{ github.event_name == 'pull_request' && 'T8_TEST_LEVEL_MEDIUM' || 'T8_TEST_LEVEL_FULL' }} # Set TEST_LEVEL to medium if the event is a PR, otherwise full. + + # Run Valgrind check for every t8code test binary. t8code_valgrind_tests: if: (github.event_name == 'schedule' && github.repository == 'DLR-AMR/t8code') # Only run the Valgrind check in the scheduled run.