Skip to content

Commit

Permalink
Merge pull request #141 from hklion/HSdevmerge_240522
Browse files Browse the repository at this point in the history
HS development merge 240522
  • Loading branch information
RevathiJambunathan authored May 22, 2024
2 parents 61c83d6 + 5956ac9 commit 4005b09
Show file tree
Hide file tree
Showing 455 changed files with 9,421 additions and 5,972 deletions.
7 changes: 5 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Checks: '
-bugprone-unchecked-optional-access,
cert-*,
-cert-err58-cpp,
clang-analyzer-*,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-optin.mpi.MPI-Checker,
-clang-analyzer-osx.*,
-clang-analyzer-optin.osx.*,
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
Expand All @@ -30,8 +35,6 @@ Checks: '
-modernize-use-trailing-return-type,
mpi-*,
performance-*,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
portability-*,
readability-*,
-readability-convert-member-functions-to-static,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach 24.03 && cd -
cd ../amrex && git checkout --detach 7ca419ebb90da60fefc01d8c1816846fff8638a5 && cd -
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_PSATD=TRUE USE_CCACHE=TRUE -j 4
ccache -s
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/dependencies/hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ set -eu -o pipefail
# failed files the given number of times.
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key \
| sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' \
| sudo tee /etc/apt/sources.list.d/rocm.list
# Ref.: https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/native-install/ubuntu.html

# Make the directory if it doesn't exist yet.
# This location is recommended by the distribution maintainers.
sudo mkdir --parents --mode=0755 /etc/apt/keyrings

# Download the key, convert the signing-key to a full
# keyring required by apt and store in the keyring directory
wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null

curl -O https://repo.radeon.com/rocm/rocm.gpg.key
sudo apt-key add rocm.gpg.key

source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ...

echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" \
| sudo tee /etc/apt/sources.list.d/rocm.list
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \
| sudo tee -a /etc/profile.d/rocm.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies/icc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export CEI_TMP="/tmp/cei"
CXX=$(which icpc) CC=$(which icc) \
cmake-easyinstall \
--prefix=/usr/local \
git+https://github.com/openPMD/[email protected].1 \
git+https://github.com/openPMD/[email protected].2 \
-DopenPMD_USE_PYTHON=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
brew tap openpmd/openpmd
brew install openpmd-api
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade virtualenv
python3 -m venv py-venv
source py-venv/bin/activate
python3 -m pip install --upgrade pip
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/scripts/checkQEDTableGenerator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

#!/usr/bin/env bash
#
# Copyright 2022 Luca Fedeli
#
# License: BSD-3-Clause-LBNL

set -eu -o pipefail

export OMP_NUM_THREADS=2

#
# Generate QED lookup tables using external tool
#
./build/bin/qed_table_generator \
--table BW --mode DP --dndt_chi_min 0.01 \
--dndt_chi_max 100 --dndt_how_many 64 \
--pair_chi_min 0.01 --pair_chi_max 100 \
--pair_chi_how_many 64 --pair_frac_how_many 64 \
-o bw_table_tool
./build/bin/qed_table_generator \
--table QS --mode DP --dndt_chi_min 0.001 \
--dndt_chi_max 100 --dndt_how_many 64 \
--em_chi_min 0.001 --em_chi_max 100 \
--em_chi_how_many 64 --em_frac_how_many 64 \
--em_frac_min 1e-12 -o qs_table_tool

#
# Generate QED lookup tables using WarpX
#
./build/bin/warpx.2d \
./Examples/Tests/qed/quantum_synchrotron/inputs_2d \
qed_bw.lookup_table_mode = "generate" \
qed_bw.tab_dndt_chi_min = 0.01 \
qed_bw.tab_dndt_chi_max = 100.0 \
qed_bw.tab_dndt_how_many = 64 \
qed_bw.tab_pair_chi_min = 0.01 \
qed_bw.tab_pair_chi_max = 100.0 \
qed_bw.tab_pair_chi_how_many = 64 \
qed_bw.tab_pair_frac_how_many = 64 \
qed_bw.save_table_in = "bw_table" \
qed_qs.lookup_table_mode = "generate" \
qed_qs.tab_dndt_chi_min = 0.001 \
qed_qs.tab_dndt_chi_max = 100.0 \
qed_qs.tab_dndt_how_many = 64 \
qed_qs.tab_em_chi_min = 0.001 \
qed_qs.tab_em_frac_min = 1.0e-12 \
qed_qs.tab_em_chi_max = 100.0 \
qed_qs.tab_em_chi_how_many = 64 \
qed_qs.tab_em_frac_how_many = 64 \
qed_qs.save_table_in = "qs_table"

#
# Convert lookup tables (generated with WarpX and with the external tool) in human-readable format
#
./build/bin/qed_table_reader -i qs_table --table QS --mode DP -o qs_table
./build/bin/qed_table_reader -i qs_table_tool --table QS --mode DP -o qs_table_tool
./build/bin/qed_table_reader -i bw_table --table BW --mode DP -o bw_table
./build/bin/qed_table_reader -i bw_table_tool --table BW --mode DP -o bw_table_tool

#
# Compare the generated lookup tables
#
diff bw_table_dndt bw_table_tool_dndt
diff bw_table_pair bw_table_tool_pair
diff qs_table_phot_em qs_table_tool_phot_em
diff qs_table_dndt qs_table_tool_dndt

#
# Run a WarpX simulation using the lookup tables generated by the external tool
#
./build/bin/warpx.2d \
./Examples/Tests/qed/quantum_synchrotron/inputs_2d \
qed_bw.lookup_table_mode = "load" \
qed_bw.load_table_from = "bw_table_tool" \
qed_qs.lookup_table_mode = "load" \
qed_qs.load_table_from = "qs_table_tool"
65 changes: 63 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
du -hs ~/.cache/ccache
build_1D_2D:
name: GCC 1D & 2D w/ MPI
name: GCC 1D & 2D w/ MPI, QED tools
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
env:
Expand Down Expand Up @@ -78,14 +78,20 @@ jobs:
-DWarpX_DIMS="1;2" \
-DWarpX_EB=OFF \
-DWarpX_PSATD=ON \
-DWarpX_QED_TABLE_GEN=ON
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_QED_TOOLS=ON
cmake --build build -j 4
./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_1d
./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_2d
ccache -s
du -hs ~/.cache/ccache
- name: run QED table tools
run: |
.github/workflows/scripts/checkQEDTableGenerator.sh
build_3D_sp:
name: GCC 3D & RZ w/ MPI, single precision
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -218,6 +224,61 @@ jobs:
export OMP_NUM_THREADS=1
mpirun -n 2 Examples/Physics_applications/laser_acceleration/PICMI_inputs_3d.py
build_UB_sanitizer:
name: Clang UB sanitizer
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
env:
CC: clang
CXX: clang++
# On CI for this test, Ninja is slower than the default:
#CMAKE_GENERATOR: Ninja
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang15.sh
- name: CCache 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: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=100M
ccache -z
export CXX=$(which clang++-15)
export CC=$(which clang-15)
export CXXFLAGS="-fsanitize=undefined -fno-sanitize-recover=all"
cmake -S . -B build \
-GNinja \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DWarpX_DIMS="RZ;1;2;3" \
-DWarpX_PSATD=ON \
-DWarpX_QED=ON \
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_PRECISION=SINGLE \
-DWarpX_PARTICLE_PRECISION=SINGLE
cmake --build build -j 4
ccache -s
du -hs ~/.cache/ccache
- name: run with UB sanitizer
run: |
export OMP_NUM_THREADS=2
mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_rz
mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_1d
mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_2d
mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_3d
save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exclude: '^share/openPMD/thirdParty'
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
Expand Down Expand Up @@ -80,6 +80,7 @@ repos:
hooks:
- id: isort
name: isort (python)
args: ['--profile black']

# Python: Flake8 (checks only, does this support auto-fixes?)
#- repo: https://github.com/PyCQA/flake8
Expand Down
27 changes: 21 additions & 6 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"name": "Andriyash, Igor",
"orcid": "0000-0003-0313-4496"
},
{
"affiliation": "Lawrence Livermore National Laboratory",
"name": "Angus, Justin Ray",
"orcid": "0000-0003-1474-0002"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Belkin, Daniel",
Expand Down Expand Up @@ -93,6 +98,11 @@
"name": "Gu, Junmin",
"orcid": "0000-0002-1521-8534"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Haseeb, Muhammad",
"orcid": "0000-0002-0697-6894"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Jambunathan, Revathi",
Expand Down Expand Up @@ -155,19 +165,29 @@
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Sandberg, Ryan T.",
"name": "Sandberg, Ryan Thor",
"orcid": "0000-0001-7680-8733"
},
{
"affiliation": "Modern Electron",
"name": "Scherpelz, Peter",
"orcid": "0000-0001-8185-3387"
},
{
"affiliation": "Laboratory for Laser Energetics, University of Rochester",
"name": "Weichman, Kale",
"orcid": "0000-0002-3487-7922"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Yang, Eloise",
"orcid": "0000-0002-9319-4216"
},
{
"affiliation": "LIDYL, CEA-Universit\u00e9 Paris-Saclay, CEA Saclay",
"name": "Zaim, Ne\u00efl",
"orcid": "0000-0003-0313-4496"
},
{
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Zhang, Weiqun",
Expand All @@ -187,11 +207,6 @@
"affiliation": "Lawrence Berkeley National Laboratory",
"name": "Zoni, Edoardo",
"orcid": "0000-0001-5662-4646"
},
{
"affiliation": "LIDYL, CEA-Universit\u00e9 Paris-Saclay, CEA Saclay",
"name": "Zaim, Ne\u00efl",
"orcid": "0000-0003-0313-4496"
}
],
"contributors": [
Expand Down
Loading

0 comments on commit 4005b09

Please sign in to comment.