From f78880b794ac3c0895d4d97a2a31d63c63598d58 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Thu, 4 Jan 2024 09:50:49 -0800 Subject: [PATCH] Add CI test --- .github/workflows/clang.yml | 66 ++++++++++++++++++++++++++++++++++ Tests/openPMDTests/ptls/inputs | 18 +++++----- 2 files changed, 75 insertions(+), 9 deletions(-) diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml index ec469bb5de6..dfa0081ef4f 100644 --- a/.github/workflows/clang.yml +++ b/.github/workflows/clang.yml @@ -166,6 +166,72 @@ jobs: ccache -s du -hs ~/.cache/ccache + test_openpmd: + name: openPMD I/O Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Dependencies + run: | + .github/workflows/dependencies/dependencies_clang.sh 15 + .github/workflows/dependencies/dependencies_clang-tidy.sh 15 + .github/workflows/dependencies/dependencies_ccache.sh + - name: Install openPMD + run: | + sudo apt-get install -y --no-install-recommends libhdf5-mpi-dev + wget -q https://github.com/openPMD/openPMD-api/archive/refs/tags/0.15.2.tar.gz + tar xfz 0.15.2.tar.gz + cd openPMD-api-0.15.2 + mkdir build + cd build + cmake .. -DopenPMD_USE_PYTHON=OFF + make -j2 + sudo make install + - name: Set Up Cache + uses: actions/cache@v3 + with: + path: ~/.cache/ccache + key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} + restore-keys: | + ccache-${{ github.workflow }}-${{ github.job }}-git- + - name: Build & Test + env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor"} + run: | + export CCACHE_COMPRESS=1 + export CCACHE_COMPRESSLEVEL=10 + export CCACHE_MAXSIZE=200M + export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy + export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt + ccache -z + + mkdir build + cd build + cmake .. \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DAMReX_ENABLE_TESTS=ON \ + -DAMReX_SPACEDIM=3 \ + -DAMReX_MPI=ON \ + -DAMReX_OMP=OFF \ + -DAMReX_FORTRAN=OFF \ + -DAMReX_EB=OFF \ + -DAMReX_LINEAR_SOLVERS=OFF \ + -DAMReX_AMRLEVEL=OFF \ + -DAMReX_PARTICLES=ON \ + -DCMAKE_C_COMPILER=$(which clang-15) \ + -DCMAKE_CXX_COMPILER=$(which clang++-15) \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + make -j 2 + + ${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt + make -j2 -f clang-tidy-ccache-misses.mak \ + CLANG_TIDY=clang-tidy-15 \ + CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" + + ctest --output-on-failure + + ccache -s + du -hs ~/.cache/ccache + save_pr_number: if: github.event_name == 'pull_request' runs-on: ubuntu-latest diff --git a/Tests/openPMDTests/ptls/inputs b/Tests/openPMDTests/ptls/inputs index 7a60946415a..15791c46d4b 100644 --- a/Tests/openPMDTests/ptls/inputs +++ b/Tests/openPMDTests/ptls/inputs @@ -1,26 +1,26 @@ # Domain size -#nx = 32 # number of grid points along the x axis -#ny = 32 # number of grid points along the y axis -#nz = 32 # number of grid points along the z axis +nx = 32 # number of grid points along the x axis +ny = 32 # number of grid points along the y axis +nz = 32 # number of grid points along the z axis #nx = 64 # number of grid points along the x axis #ny = 64 # number of grid points along the y axis #nz = 64 # number of grid points along the z axis -nx = 128 # number of grid points along the x axis -ny = 128 # number of grid points along the y axis -nz = 128 # number of grid points along the z axis +#nx = 128 # number of grid points along the x axis +#ny = 128 # number of grid points along the y axis +#nz = 128 # number of grid points along the z axis # Maximum allowable size of each subdomain in the problem domain; # this is used to decompose the domain for parallel calculations. -max_grid_size = 32 +max_grid_size = 16 # Number of particles per cell -nppc = 10 +nppc = 2 # Verbosity verbose = true # set to true to get more verbosity -nlevs=2 \ No newline at end of file +nlevs=2