Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HS dev merge 24-02-28 #139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
eba3599
add start/end moving step (#4437)
zhazhajust Nov 28, 2023
39e19a3
Frontier (OLCF): cupy (#4247)
ax3l Nov 29, 2023
7e54efe
Allow multiple injection sources per species (#4196)
dpgrote Nov 29, 2023
aee8dc0
Clang-Tidy Cache (#4453)
WeiqunZhang Nov 29, 2023
6eedf2c
AMReX: Update to `development` (#4455)
ax3l Nov 30, 2023
4534db9
Set `amrex.omp_threads = "nosmt"` (#4393)
ax3l Dec 1, 2023
008dc71
Initial commit (#4460)
eebasso Dec 1, 2023
d4baf94
New Cache Strategy (#4456)
WeiqunZhang Dec 1, 2023
5e55592
Make geometry.dims abort message more user-friendly (#4459)
eebasso Dec 1, 2023
5736887
Fix typo in "write_diagnostics_on_restart" (#4463)
archermarx Dec 1, 2023
5ca5837
Bugfix in `fields.py` `mesh()` with ghost cells included (#4466)
roelof-groenewald Dec 2, 2023
d2633ba
fix preprocessor defs for 1D in two locations (#4465)
archermarx Dec 2, 2023
a393c7b
Add external current handling to Ohm's law solver (#4405)
roelof-groenewald Dec 4, 2023
ffbdd96
Release 23.12 (#4469)
ax3l Dec 5, 2023
8573551
Remove brew cache (#4470)
WeiqunZhang Dec 5, 2023
7513204
Doc: Restructure Examples (#4467)
ax3l Dec 5, 2023
c138a02
Docs: Fix Many Small Errors & Warnings
ax3l Dec 5, 2023
2566eaf
Docs: Fix Formatting in `parameters.rst`
ax3l Dec 5, 2023
ef4f922
macOS CI: export CCACHE_DEPEND=1 (#4475)
WeiqunZhang Dec 5, 2023
431bd94
Doc: Streamline Python Input (#4472)
ax3l Dec 5, 2023
60516d5
Rename Depose -> Deposit (#4474)
ax3l Dec 5, 2023
0a39c8a
Correct on-axis field boundary for RZ (#4464)
RemiLehe Dec 5, 2023
fa32500
Fix typos in comments and docs (#4471)
eebasso Dec 5, 2023
11c5904
pybind11: v2.11.1+ (#4473)
ax3l Dec 6, 2023
e43e50f
Set alpha mass directly from NIST data (#4478)
eebasso Dec 6, 2023
a2eb554
Add `latex_theory/allbibs.bib` to bibliography list and delete duplic…
eebasso Dec 6, 2023
044ab29
macOS CI: Fix brew installation (#4493)
WeiqunZhang Dec 9, 2023
1025370
sqrt -> std::sqrt (#4490)
WeiqunZhang Dec 10, 2023
a786912
Clang-Tidy: Update performance and readability (#4492)
WeiqunZhang Dec 11, 2023
8995d1b
Clang-Tidy CI: Keep Going after Errors (#4491)
WeiqunZhang Dec 11, 2023
ee98582
Tidy-Clang: performance-type-promotion-in-math-fn (#4497)
WeiqunZhang Dec 11, 2023
903a67c
Move external field parameters out of WarpX class (#4441)
lucafedeli88 Dec 11, 2023
cfce3ee
[pre-commit.ci] pre-commit autoupdate (#4500)
pre-commit-ci[bot] Dec 12, 2023
8327f23
Custom class for bibliography style (#4482)
eebasso Dec 12, 2023
c9e4d7c
AMReX/pyAMReX/PICSAR: Weekly Update (#4489)
ax3l Dec 12, 2023
fcab497
Clang-tidy: enable readability-duplicate-include check in clang-tidy …
lucafedeli88 Dec 12, 2023
5344f80
Use more consistent species types in fusion module (#4480)
RemiLehe Dec 12, 2023
a1f1d67
AMReX/pyAMReX/PICSAR: Weekly Update (#4503)
ax3l Dec 12, 2023
b1cec6e
workflow training neural network from warpx data (#4499)
RTSandberg Dec 13, 2023
654e6b3
Clang-Tidy: readability-braces-around-statements (#4511)
WeiqunZhang Dec 14, 2023
aab5c89
Clang-Tidy: readability-inconsistent-declaration-parameter-name (#4514)
WeiqunZhang Dec 14, 2023
af50790
Clang-tidy: enable no-malloc check in clang-tidy CI test (#4518)
lucafedeli88 Dec 14, 2023
e973303
Update descriptions of hybrid-PIC examples (#4479)
roelof-groenewald Dec 14, 2023
38794d1
Bibliography: improved citations (#4513)
eebasso Dec 14, 2023
a2022bb
Doc: Fix Sphinx Warnings
ax3l Dec 14, 2023
af00348
Doc: Examples Before APIs
ax3l Dec 14, 2023
262895b
Bibliography: make author family names appear last (#4506)
eebasso Dec 15, 2023
832c6ed
Clang-Tidy: performance-noexcept-move-constructor (#4504)
WeiqunZhang Dec 15, 2023
3c627da
Clang-Tidy: readability-qualified-auto (#4507)
WeiqunZhang Dec 15, 2023
7233e4b
Add ability to run checksum on openPMD files (#4519)
RemiLehe Dec 15, 2023
50e04bf
move function definition to cpp file (#4522)
lucafedeli88 Dec 15, 2023
56a5e63
Improve documentation for laser chirp (#4525)
RemiLehe Dec 15, 2023
ade2df1
Doc: Fix ChecksumAPI `autofunction` (#4524)
ax3l Dec 15, 2023
5650b0d
WarpXSumGuardCells: move function definitions in cpp file (#4521)
lucafedeli88 Dec 16, 2023
7ad3df9
Spruce up amr.rst (#4529)
eebasso Dec 16, 2023
fe1d018
Doc: Extend a Simulation Workflow (#4520)
ax3l Dec 16, 2023
ac226bc
Fix chirp documentation (#4533)
RemiLehe Dec 16, 2023
fc3b1c7
Spruce up input_output.rst (#4532)
eebasso Dec 16, 2023
4badb9b
Spruce up cold_fluid_model.rst (#4531)
eebasso Dec 16, 2023
c98cd6b
Spruce up boosted_frame.rst (#4530)
eebasso Dec 16, 2023
7b87cdb
Documentation: numbered reference formatting (#4528)
eebasso Dec 16, 2023
e28fd2a
Fix CI for ROCm 6.0 (#4527)
WeiqunZhang Dec 16, 2023
c7c2b84
Spruce up ml_dataset_training.rst (#4512)
eebasso Dec 16, 2023
8eb30ee
Spruce up PIC theory section (#4536)
eebasso Dec 16, 2023
c1ec102
Docs: rename and spruce up boundary conditions section (#4537)
eebasso Dec 17, 2023
9af087d
Spruce up kinetic_fluid_hybrid_model.rst (#4534)
eebasso Dec 17, 2023
8c307c7
Doc: CUDA 11.7+ (#4538)
ax3l Dec 17, 2023
244ec1c
Add updated instructions for WarpX on Karolina (#4477)
berceanu Dec 17, 2023
e8f54f2
[pre-commit.ci] pre-commit autoupdate (#4539)
pre-commit-ci[bot] Dec 19, 2023
e460e60
AMReX/pyAMReX/PICSAR: Weekly Update (#4541)
ax3l Dec 19, 2023
b41869c
WarpXAMReXInit: move include directive from header to cpp file (#4543)
lucafedeli88 Dec 20, 2023
8885be5
Adding user defined keywords in Hybrid PIC Python class to allow for …
clarkse Dec 20, 2023
522cbf0
Clean up doc to improve readability (#4555)
dpgrote Dec 21, 2023
bf3303c
add hybrid-PIC PoP reference to docs (#4551)
roelof-groenewald Dec 21, 2023
1603278
Fix reference (#4552)
dpgrote Dec 21, 2023
3fd5b5f
AMReX/pyAMReX/PICSAR: Weekly Update (#4559)
ax3l Dec 22, 2023
bb42b28
Add updated instructions for WarpX on Karolina (#4545)
berceanu Dec 22, 2023
f05cf71
Add DSMC module (#4125)
roelof-groenewald Dec 22, 2023
d318a76
Fix: BeamRelevant 1D, 2D (#4558)
ax3l Dec 22, 2023
2209087
Update documentation for checksum (#4561)
RemiLehe Dec 23, 2023
a32b561
Implicit electromagnetic solver using Picard iterations (#4071)
dpgrote Dec 23, 2023
f275c7a
Fix default initialization of runtime attributes. (#4508)
atmyers Dec 23, 2023
ae600b8
Update explanation of why 2D simulations are not suitable for plasma-…
RemiLehe Dec 23, 2023
5cff5e0
Change the sign of laser particles (#4568)
WeiqunZhang Jan 2, 2024
2444f15
Add semi-implicit CI test (#4565)
dpgrote Jan 2, 2024
8d15065
Add filters for boundary scraping diagnostics (#4371)
kale-j Jan 3, 2024
4f894c6
Update the field probe diagnostic documentation (#4564)
dpgrote Jan 3, 2024
ea8cadf
Apply particle selection to BTDiagnostics (#4570)
RemiLehe Jan 3, 2024
54486e7
Update dsmc and fusion binary collisions (#4572)
dpgrote Jan 4, 2024
6aa2fc1
Beam-beam collision example (#4546)
aeriforme Jan 4, 2024
fa2c855
Perlmutter: Load `gpu` Module (#4573)
ax3l Jan 5, 2024
685ae3f
Scale fields by a dimensionless number between 0 and 1 (#4575)
RemiLehe Jan 5, 2024
920b3e8
Beam-beam collision example follow-up (#4578)
aeriforme Jan 5, 2024
5b765dc
Reduce tolerance for DSMC CI test (#4576)
roelof-groenewald Jan 5, 2024
9b48df9
Doc: Clean Example TODOs (#4584)
ax3l Jan 5, 2024
125ccef
Read external fields from file in restarted simulation (#4547)
RemiLehe Jan 6, 2024
0b147c7
Release 24.01 (#4586)
ax3l Jan 6, 2024
e944c7c
Clang-tidy: enforce clang-tidy_readability_make_member_function_const…
lucafedeli88 Jan 8, 2024
42e8c56
Implement correction to ADK for high fields (#4505)
MaxThevenet Jan 8, 2024
3b7bcd8
fix doc for coarsening (#4588)
RevathiJambunathan Jan 8, 2024
69e9262
AMReX/pyAMReX/PICSAR: Weekly Update (#4590)
ax3l Jan 8, 2024
82f7f1e
Fix plasma injection from file for parallel runs (#4597)
WeiqunZhang Jan 10, 2024
12a265c
Move input of galerkin_scheme upward to before the implicit check of …
dpgrote Jan 15, 2024
a3fd142
Docs: spruce up parameters.rst (#4609)
eebasso Jan 16, 2024
a8f20e3
atomicAdd -> lockAdd (#4608)
WeiqunZhang Jan 16, 2024
a3e04a7
Disambiguate the routine name initialize_inputs in picmi.py (#4554)
dpgrote Jan 16, 2024
11e2a17
Fix undefined behavior in meanParticleVelocity (#4614)
RemiLehe Jan 16, 2024
a2b9e68
Perlmutter (NERSC): January 2024 Update (#4620)
ax3l Jan 19, 2024
3b1dff5
update cupy installation in Perlmutter dependencies (#4621)
roelof-groenewald Jan 19, 2024
d248490
Use RK4 to integrate the B-field in time in the hybrid-PIC algorithm …
roelof-groenewald Jan 22, 2024
c5377b7
Update `picmi.ElectrostaticSolver` child class in external Poisson so…
roelof-groenewald Jan 23, 2024
9d35f5e
Add warpx_used_inputs_file in Python input (#4618)
dpgrote Jan 23, 2024
4ab88c5
Fix undefined behavior issue in WarpX initialization (#4615)
lucafedeli88 Jan 23, 2024
94babda
Doc: Fast, Local Compilation (#4603)
ax3l Jan 23, 2024
47e8ace
AMReX/pyAMReX/PICSAR: Weekly Update (#4630)
ax3l Jan 24, 2024
77dbf6d
Temporary fix: disable hanging CI test (`Python_background_mcc_1d_tri…
roelof-groenewald Jan 24, 2024
c1533a9
Update pyAMReX (#4633)
ax3l Jan 24, 2024
94ae119
Update Particle Container to Pure SoA (#3850)
ax3l Jan 28, 2024
67c9aa2
Remove particles that are initialized in the EB (#4585)
RemiLehe Jan 29, 2024
c9df448
Update DSMC picmi class initialization function (#4646)
roelof-groenewald Jan 29, 2024
0284b57
AMReX: Weekly Update (#4647)
ax3l Jan 30, 2024
3e551e0
Fix neutral particle got pushed (#4643)
GivenChen Jan 30, 2024
33d7b49
reactivate CI test (Python_background_mcc_1d_tridiag) (#4650)
roelof-groenewald Jan 30, 2024
2708b4f
Grammar Change in Theory Intro (#4617)
sevicky Jan 30, 2024
56e4a2a
Revert "Update Particle Container to Pure SoA (#3850)" (#4652)
ax3l Jan 30, 2024
fa422b5
AMReX: Latest `development` (#4654)
ax3l Jan 31, 2024
bcc67e1
Docs: update instructions for Adastra supercomputer (CINES, France) (…
lucafedeli88 Feb 1, 2024
d8df8f6
Fix doc for doChargeConservingDepositionShapeNImplicit (#4658)
dpgrote Feb 1, 2024
282ae83
Add WarpX_CCACHE Option (#4637)
haampie Feb 1, 2024
7a7c704
Update profile and job script for LUMI supercomputer (#4634)
lucafedeli88 Feb 1, 2024
1093f61
Fix BTD/Scrape Flush Count with Filters (#4657)
ax3l Feb 2, 2024
206b081
Release 24.02 (#4660)
ax3l Feb 2, 2024
9d8ecf9
Add install instructions for ALCF's Polaris (#4636)
roelof-groenewald Feb 2, 2024
60bf000
Implemented Villasenor and Buneman deposition routine for implicit so…
JustinRayAngus Feb 2, 2024
6e332e9
Particle Container to Pure SoA Again (#4653)
ax3l Feb 2, 2024
a9d8126
Fix: Pre-Installed AMReX w/ CUDA (#4668)
ax3l Feb 5, 2024
7e36813
Add hybrid resistivity current term (#4661)
clarkse Feb 6, 2024
83e16ee
CI: 4 Cores Linux/Win, 3 Cores macOS (#4673)
ax3l Feb 6, 2024
6e87dd5
Update GitHub Action versions (#4674)
WeiqunZhang Feb 6, 2024
85326ae
Update Polaris install instructions (#4664)
roelof-groenewald Feb 8, 2024
9c082da
Minor fix in SLURM signal forwarding description (#4665)
roelof-groenewald Feb 8, 2024
94d48fd
ParticleHistogram2D change openPMD access type (#4659)
n01r Feb 8, 2024
11aabdc
Fix docs for checksumAPI terminal call (#4677)
n01r Feb 8, 2024
c6875f4
CI: NVHPC 24.1 (#4679)
ax3l Feb 8, 2024
58bc0ba
Update pyAMReX to `development` (#4680)
ax3l Feb 8, 2024
97e90bb
AMReX: Weekly Update (#4678)
ax3l Feb 8, 2024
37a0338
Update openPMD-viewer documentation (#4682)
RemiLehe Feb 8, 2024
c9bfc7e
Apply filtering for the charge density in full diagnostics RZ PSATD …
oshapoval Feb 8, 2024
4077f8e
Add automated test for spacecraft charging (#4413)
EyaDammak Feb 9, 2024
9684a17
Fix: openPMD RZ Positions (#4686)
ax3l Feb 10, 2024
7257cd8
AMReX: Weekly Update (#4690)
ax3l Feb 12, 2024
7392bc9
Lassen (LLNL) TOSS3: Update (#4692)
ax3l Feb 12, 2024
c5aea94
Bugfix: sum guard cell values in current density diagnostic (#4596)
roelof-groenewald Feb 13, 2024
043fc63
HPC3 (UCI): `-j 8` (#4694)
ax3l Feb 13, 2024
5248fc3
Add PICMI documentation for ReducedDiagnostics (#4693)
RemiLehe Feb 13, 2024
7740464
Obtain exact point of contact of Particles with EB (#4560)
EyaDammak Feb 13, 2024
9f52a45
Removed const modifier from LPInfo object on stack that was causing a…
clarkse Feb 14, 2024
e038ef9
Adding a RZ version for the test "Point_of_contact_EB" (#4699)
EyaDammak Feb 16, 2024
a5c8f9f
Obtain exact time (real) when particles hit boundaries + test (#4695)
EyaDammak Feb 17, 2024
32c5b92
[pre-commit.ci] pre-commit autoupdate (#4707)
pre-commit-ci[bot] Feb 20, 2024
5a7c325
Docs: update instructions for Fugaku supercomputer (Riken, Japan) (#4…
lucafedeli88 Feb 20, 2024
8bb8ed9
Fix Particle Id Overflows (#4708)
ax3l Feb 21, 2024
994fedd
Implementation of 4th order particle shape beyond implicit solver cas…
kale-j Feb 21, 2024
f40084e
Cleanup some docstrings (#4714)
RemiLehe Feb 22, 2024
07738d3
Save the normal components in the particle buffer when there is EB (#…
EyaDammak Feb 22, 2024
d45d173
Add focusing position to Gaussian beam initialization (#4639)
aeriforme Feb 23, 2024
daa94bb
Update the documentation particles.rst in adding the new attributes (…
EyaDammak Feb 23, 2024
511fb37
Fix unresolved reference (#4722)
n01r Feb 23, 2024
4ef16e5
Improve Documentation for Laser-Ion Acceleration from Planar Target (…
n01r Feb 23, 2024
9a017a6
Update of the time saved for scraped particles on the boundaries (#4710)
EyaDammak Feb 24, 2024
a0a6b72
AMReX: Weekly Update (#4728)
ax3l Feb 27, 2024
1d87c26
Position keyword now adds position variables in PICMI ParticleDiagnos…
n01r Feb 27, 2024
ac2e649
openPMD: Fix Particle Weight Dims in 1D/2D (#4717)
ax3l Feb 27, 2024
1af03a1
Clang-Tidy: Fix Diagnostics Branch (#4731)
ax3l Feb 27, 2024
5e66d0e
Exchange guard cells with the electrostatic solver (#4713)
RemiLehe Feb 27, 2024
6be87d6
Adding support for pml in domain for multiple patches (#4632)
RevathiJambunathan Feb 28, 2024
45d685a
Merge remote-tracking branch 'upstream/development' into HSdevmerge_2…
hklion Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
WARPX_CI_EB: 'TRUE'

# default: 60; maximum: 360
timeoutInMinutes: 180
timeoutInMinutes: 240

steps:
# set up caches:
Expand Down
47 changes: 14 additions & 33 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Checks: '
-bugprone-unchecked-optional-access,
cert-*,
-cert-err58-cpp,
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
Expand All @@ -29,38 +29,19 @@ Checks: '
-modernize-return-braced-init-list,
-modernize-use-trailing-return-type,
mpi-*,
performance-faster-string-find,
performance-for-range-copy,
performance-implicit-conversion-in-loop,
performance-inefficient-algorithm,
performance-inefficient-string-concatenation,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-move-constructor-init,
performance-no-automatic-move,
performance-no-int-to-ptr,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-contains,
readability-container-data-pointer,
readability-container-size-empty,
readability-non-const-parameter,
readability-redundant-control-flow,
readability-redundant-declaration,
readability-redundant-function-ptr-dereference,
readability-redundant-member-init,
readability-redundant-preprocessor,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-redundant-string-init,
readability-simplify-boolean-expr,
readability-simplify-subscript-expr,
readability-static-accessed-through-instance,
readability-static-definition-in-anonymous-namespace,
readability-string-compare,
readability-suspicious-call-argument,
readability-uniqueptr-delete-release,
readability-use-anyofallof,
performance-*,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
portability-*,
readability-*,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-uppercase-literal-suffix
'

Expand Down
63 changes: 41 additions & 22 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,62 @@ jobs:
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang14.sh
- name: build WarpX using clang-tidy
- 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: build WarpX & run clang-tidy
run: |

export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=300M
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z

export CXX=$(which clang++)
export CC=$(which clang)

# The following wrapper ensures that only source files
# in WarpX/Source/* are actually processed by clang-tidy
#_______________________________
cat > clang_tidy_wrapper << EOF
#!/bin/bash
REGEX="[a-z_A-Z0-9\/]*WarpX\/Source[a-z_A-Z0-9\/]+.cpp"
if [[ \$4 =~ \$REGEX ]];then
clang-tidy \$@
fi
EOF
chmod +x clang_tidy_wrapper
#_____________________________________

cmake -S . -B build_clang_tidy \
-DCMAKE_CXX_CLANG_TIDY="$PWD/clang_tidy_wrapper;--system-headers=0;--config-file=$PWD/.clang-tidy" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DWarpX_DIMS="1;2;3;RZ" \
-DWarpX_DIMS="1;2;RZ;3" \
-DWarpX_MPI=ON \
-DWarpX_COMPUTE=OMP \
-DWarpX_PSATD=ON \
-DWarpX_QED=ON \
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_PRECISION=SINGLE
-DWarpX_PRECISION=SINGLE \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache

cmake --build build_clang_tidy -j 4

cmake --build build_clang_tidy -j 2 2> build_clang_tidy/clang-tidy.log
${{github.workspace}}/.github/workflows/source/makeMakefileForClangTidy.py --input ${{github.workspace}}/ccache.log.txt
make -j4 --keep-going -f clang-tidy-ccache-misses.mak \
CLANG_TIDY=clang-tidy \
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"

cat build_clang_tidy/clang-tidy.log
if [[ $(wc -m <build_clang_tidy/clang-tidy.log) -gt 1 ]]; then exit 1; fi
ccache -s
du -hs ~/.cache/ccache

save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
40 changes: 40 additions & 0 deletions .github/workflows/cleanup-cache-postpr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CleanUpCachePostPR

on:
workflow_run:
workflows: [PostPR]
types:
- completed

jobs:
CleanUpCcacheCachePostPR:
name: Clean Up Ccache Cache Post PR
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Clean up ccache
run: |
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}

gh run download ${{ github.event.workflow_run.id }} -n pr_number
pr_number=`cat pr_number.txt`
BRANCH=refs/pull/${pr_number}/merge

# Setting this to not fail the workflow while deleting cache keys.
set +e

keys=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH | cut -f 1)
# $keys might contain spaces. Thus we set IFS to \n.
IFS=$'\n'
for k in $keys
do
gh actions-cache delete "$k" -R $REPO -B $BRANCH --confirm
done
unset IFS
63 changes: 63 additions & 0 deletions .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CleanUpCache

on:
workflow_run:
workflows: [🧹 clang-tidy, 🔍 CodeQL, 🐧 CUDA, 🐧 HIP, 🐧 Intel, 🍏 macOS, 🐧 OpenMP]
types:
- completed

jobs:
CleanUpCcacheCache:
name: Clean Up Ccache Cache for ${{ github.event.workflow_run.name }}
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Clean up ccache
run: |
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}

# push or pull_request or schedule or ...
EVENT=${{ github.event.workflow_run.event }}

# Triggering workflow run name (e.g., LinuxClang)
WORKFLOW_NAME="${{ github.event.workflow_run.name }}"

if [[ $EVENT == "pull_request" ]]; then
gh run download ${{ github.event.workflow_run.id }} -n pr_number
pr_number=`cat pr_number.txt`
BRANCH=refs/pull/${pr_number}/merge
else
BRANCH=refs/heads/${{ github.event.workflow_run.head_branch }}
fi

# Setting this to not fail the workflow while deleting cache keys.
set +e

# In our cache keys, substring after `-git-` is git hash, substring
# before that is a unique id for jobs (e.g., `ccache-LinuxClang-configure-2d`).
# The goal is to keep the last used key of each job and delete all others.

# something like ccache-LinuxClang-
keyprefix="ccache-${WORKFLOW_NAME}-"

cached_jobs=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH --key "$keyprefix" | awk -F '-git-' '{print $1}' | sort | uniq)

# cached_jobs is something like "ccache-LinuxClang-configure-1d ccache-LinuxClang-configure-2d".
# It might also contain spaces. Thus we set IFS to \n.
IFS=$'\n'
for j in $cached_jobs
do
old_keys=$(gh actions-cache list -L 100 -R $REPO -B $BRANCH --key "${j}-git-" --sort last-used | cut -f 1 | tail -n +2)
for k in $old_keys
do
gh actions-cache delete "$k" -R $REPO -B $BRANCH --confirm
done
done
unset IFS
51 changes: 44 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,64 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Packages (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
sudo apt-get update
sudo apt-get install --yes cmake openmpi-bin libopenmpi-dev libhdf5-openmpi-dev libadios-openmpi-dev
sudo apt-get install --yes cmake openmpi-bin libopenmpi-dev libhdf5-openmpi-dev libadios-openmpi-dev ccache

python -m pip install --upgrade pip
python -m pip install --upgrade wheel
python -m pip install --upgrade cmake
export CMAKE="$HOME/.local/bin/cmake" && echo "CMAKE=$CMAKE" >> $GITHUB_ENV

- name: Set Up Cache
if: ${{ matrix.language == 'cpp' }}
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: Configure (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
$CMAKE -S . -B build -DWarpX_OPENPMD=ON

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
config-file: ./.github/codeql/warpx-codeql.yml
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Build (py)
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
if: ${{ matrix.language == 'python' }}

- name: Build (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
$CMAKE --build build -j 2
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=100M
ccache -z

$CMAKE --build build -j 4

ccache -s
du -hs ~/.cache/ccache

# Make sure CodeQL has something to do
touch Source/Utils/WarpXVersion.cpp
export CCACHE_DISABLE=1
$CMAKE --build build -j 4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
upload: False
Expand All @@ -85,6 +107,21 @@ jobs:
output: sarif-results/${{ matrix.language }}.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/${{ matrix.language }}.sarif

save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1
Loading
Loading