Skip to content

Commit 25f4e2e

Browse files
committed
Add CI test
1 parent ed71097 commit 25f4e2e

File tree

7 files changed

+96
-14
lines changed

7 files changed

+96
-14
lines changed

.github/workflows/clang.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,77 @@ jobs:
166166
ccache -s
167167
du -hs ~/.cache/ccache
168168
169+
test_openpmd:
170+
name: openPMD I/O Test
171+
runs-on: ubuntu-latest
172+
steps:
173+
- uses: actions/checkout@v4
174+
- name: Dependencies
175+
run: |
176+
.github/workflows/dependencies/dependencies_clang.sh 15
177+
.github/workflows/dependencies/dependencies_clang-tidy.sh 15
178+
.github/workflows/dependencies/dependencies_ccache.sh
179+
- name: Set Up Cache
180+
uses: actions/cache@v3
181+
with:
182+
path: ~/.cache/ccache
183+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
184+
restore-keys: |
185+
ccache-${{ github.workflow }}-${{ github.job }}-git-
186+
- name: Install openPMD
187+
run: |
188+
export CCACHE_COMPRESS=1
189+
export CCACHE_COMPRESSLEVEL=10
190+
export CCACHE_MAXSIZE=40M
191+
192+
sudo apt-get install -y --no-install-recommends libhdf5-mpi-dev
193+
wget -q https://github.com/openPMD/openPMD-api/archive/refs/tags/0.15.2.tar.gz
194+
tar xfz 0.15.2.tar.gz
195+
cd openPMD-api-0.15.2
196+
mkdir build
197+
cd build
198+
cmake .. -DopenPMD_USE_PYTHON=OFF -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
199+
make -j2
200+
sudo make install
201+
- name: Build & Test
202+
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -Wnon-virtual-dtor"}
203+
run: |
204+
export CCACHE_COMPRESS=1
205+
export CCACHE_COMPRESSLEVEL=10
206+
export CCACHE_MAXSIZE=40M
207+
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy
208+
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
209+
ccache -z
210+
211+
mkdir build
212+
cd build
213+
cmake .. \
214+
-DAMReX_OPENPMD_API=ON \
215+
-DCMAKE_VERBOSE_MAKEFILE=ON \
216+
-DAMReX_ENABLE_TESTS=ON \
217+
-DAMReX_SPACEDIM=3 \
218+
-DAMReX_MPI=ON \
219+
-DAMReX_OMP=OFF \
220+
-DAMReX_FORTRAN=OFF \
221+
-DAMReX_EB=OFF \
222+
-DAMReX_LINEAR_SOLVERS=OFF \
223+
-DAMReX_AMRLEVEL=OFF \
224+
-DAMReX_PARTICLES=ON \
225+
-DCMAKE_C_COMPILER=$(which clang-15) \
226+
-DCMAKE_CXX_COMPILER=$(which clang++-15) \
227+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
228+
make -j 2
229+
230+
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
231+
make -j2 -k -f clang-tidy-ccache-misses.mak \
232+
CLANG_TIDY=clang-tidy-15 \
233+
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
234+
235+
ctest --output-on-failure
236+
237+
ccache -s
238+
du -hs ~/.cache/ccache
239+
169240
save_pr_number:
170241
if: github.event_name == 'pull_request'
171242
runs-on: ubuntu-latest

Tests/Amr/Advection_AmrLevel/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if (NOT AMReX_AMRLEVEL)
2+
return()
3+
endif ()
4+
15
foreach(D IN LISTS AMReX_SPACEDIM)
26
if (D EQUAL 1)
37
continue()

Tests/EB/CNS/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if (NOT AMReX_AMRLEVEL)
2+
return()
3+
endif ()
4+
15
if (NOT (3 IN_LIST AMReX_SPACEDIM) OR NOT CMAKE_Fortran_COMPILER_LOADED)
26
return()
37
endif ()

Tests/EB_CNS/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if (NOT AMReX_AMRLEVEL)
2+
return()
3+
endif ()
4+
15
foreach(D IN LISTS AMReX_SPACEDIM)
26
set(_sources main.cpp CNS_advance.cpp CNS_advance_box.cpp CNS_advance_box_eb.cpp CNS_bcfill.cpp
37
CNSBld.cpp CNS.cpp CNS.H CNS_derive.cpp CNS_derive.H CNS_index_macros.H CNS_init_eb2.cpp CNS_io.cpp

Tests/GPU/CNS/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if (NOT AMReX_AMRLEVEL)
2+
return()
3+
endif ()
4+
15
if (NOT 3 IN_LIST AMReX_SPACEDIM)
26
return()
37
endif ()

Tests/openPMDTests/fields/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# This tests requires particle support
2-
#if (NOT AMReX_PARTICLES)
3-
# return()
4-
#endif ()
5-
61
foreach(D IN LISTS AMReX_SPACEDIM)
72
set(_sources main.cpp)
83
set(_input_files inputs )

Tests/openPMDTests/ptls/inputs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11

22
# Domain size
33

4-
#nx = 32 # number of grid points along the x axis
5-
#ny = 32 # number of grid points along the y axis
6-
#nz = 32 # number of grid points along the z axis
4+
nx = 32 # number of grid points along the x axis
5+
ny = 32 # number of grid points along the y axis
6+
nz = 32 # number of grid points along the z axis
77

88
#nx = 64 # number of grid points along the x axis
99
#ny = 64 # number of grid points along the y axis
1010
#nz = 64 # number of grid points along the z axis
1111

12-
nx = 128 # number of grid points along the x axis
13-
ny = 128 # number of grid points along the y axis
14-
nz = 128 # number of grid points along the z axis
12+
#nx = 128 # number of grid points along the x axis
13+
#ny = 128 # number of grid points along the y axis
14+
#nz = 128 # number of grid points along the z axis
1515

1616
# Maximum allowable size of each subdomain in the problem domain;
1717
# this is used to decompose the domain for parallel calculations.
18-
max_grid_size = 32
18+
max_grid_size = 16
1919

2020
# Number of particles per cell
21-
nppc = 10
21+
nppc = 2
2222

2323
# Verbosity
2424
verbose = true # set to true to get more verbosity
2525

26-
nlevs=2
26+
nlevs=2

0 commit comments

Comments
 (0)