Skip to content

Commit

Permalink
Add CI test
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Jan 4, 2024
1 parent ed71097 commit 25f4e2e
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 14 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,77 @@ 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: 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: Install openPMD
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=40M
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 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
make -j2
sudo make install
- 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=40M
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z
mkdir build
cd build
cmake .. \
-DAMReX_OPENPMD_API=ON \
-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 -k -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
Expand Down
4 changes: 4 additions & 0 deletions Tests/Amr/Advection_AmrLevel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if (NOT AMReX_AMRLEVEL)
return()
endif ()

foreach(D IN LISTS AMReX_SPACEDIM)
if (D EQUAL 1)
continue()
Expand Down
4 changes: 4 additions & 0 deletions Tests/EB/CNS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if (NOT AMReX_AMRLEVEL)
return()
endif ()

if (NOT (3 IN_LIST AMReX_SPACEDIM) OR NOT CMAKE_Fortran_COMPILER_LOADED)
return()
endif ()
Expand Down
4 changes: 4 additions & 0 deletions Tests/EB_CNS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if (NOT AMReX_AMRLEVEL)
return()
endif ()

foreach(D IN LISTS AMReX_SPACEDIM)
set(_sources main.cpp CNS_advance.cpp CNS_advance_box.cpp CNS_advance_box_eb.cpp CNS_bcfill.cpp
CNSBld.cpp CNS.cpp CNS.H CNS_derive.cpp CNS_derive.H CNS_index_macros.H CNS_init_eb2.cpp CNS_io.cpp
Expand Down
4 changes: 4 additions & 0 deletions Tests/GPU/CNS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if (NOT AMReX_AMRLEVEL)
return()
endif ()

if (NOT 3 IN_LIST AMReX_SPACEDIM)
return()
endif ()
Expand Down
5 changes: 0 additions & 5 deletions Tests/openPMDTests/fields/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# This tests requires particle support
#if (NOT AMReX_PARTICLES)
# return()
#endif ()

foreach(D IN LISTS AMReX_SPACEDIM)
set(_sources main.cpp)
set(_input_files inputs )
Expand Down
18 changes: 9 additions & 9 deletions Tests/openPMDTests/ptls/inputs
Original file line number Diff line number Diff line change
@@ -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
nlevs=2

0 comments on commit 25f4e2e

Please sign in to comment.