Skip to content

Commit dc8a956

Browse files
committed
Merge branch 'development' into python_use_valid_for_fields_getitem
2 parents 1c48b21 + f6cb58d commit dc8a956

File tree

291 files changed

+3228
-1881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+3228
-1881
lines changed

.clang-tidy

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
Checks: '-*,
2-
bugprone-*
1+
Checks: '
2+
-*,
3+
bugprone-*,
34
-bugprone-easily-swappable-parameters,
45
-bugprone-implicit-widening-of-multiplication-result,
56
-bugprone-misplaced-widening-cast,
67
-bugprone-unchecked-optional-access,
7-
cert-*
8+
cert-*,
89
-cert-err58-cpp,
9-
cppcoreguidelines-avoid-goto,
10-
cppcoreguidelines-interfaces-global-init,
10+
cppcoreguidelines-*,
11+
-cppcoreguidelines-avoid-c-arrays,
12+
-cppcoreguidelines-avoid-magic-numbers,
1113
-cppcoreguidelines-avoid-non-const-global-variables,
1214
-cppcoreguidelines-init-variables,
1315
-cppcoreguidelines-macro-usage,
14-
-cppcoreguidelines-narrowing-conversions,
1516
-cppcoreguidelines-no-malloc,
17+
-cppcoreguidelines-narrowing-conversions,
18+
-cppcoreguidelines-non-private-member-variables-in-classes,
1619
-cppcoreguidelines-owning-memory,
20+
-cppcoreguidelines-pro-*,
1721
google-build-explicit-make-pair,
1822
google-build-namespaces,
1923
google-global-names-in-headers,
@@ -74,9 +78,12 @@ Checks: '-*,
7478
'
7579

7680
CheckOptions:
77-
- key: modernize-pass-by-value.ValuesOnly
78-
value: 'true'
81+
- key: bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion
82+
value: "false"
7983
- key: misc-definitions-in-headers.HeaderFileExtensions
8084
value: "H,"
85+
- key: modernize-pass-by-value.ValuesOnly
86+
value: "true"
87+
8188

8289
HeaderFilterRegex: 'Source[a-z_A-Z0-9\/]+\.H$'

.github/workflows/cuda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/setup-python@v4
2828
name: Install Python
2929
with:
30-
python-version: '3.x'
30+
python-version: '3.10'
3131
- name: install dependencies
3232
run: |
3333
.github/workflows/dependencies/nvcc11-3.sh
@@ -111,7 +111,7 @@ jobs:
111111
which nvcc || echo "nvcc not in PATH!"
112112
113113
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
114-
cd ../amrex && git checkout --detach 23.10 && cd -
114+
cd ../amrex && git checkout --detach be6c6415467d09da6109d27cfa218868abc1f9db && cd -
115115
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_PSATD=TRUE USE_CCACHE=TRUE -j 2
116116
117117
build_nvhpc21-11-nvcc:

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-python@v4
1717
with:
18-
python-version: '3.x'
18+
python-version: '3.10'
1919
- name: CCache Cache
2020
uses: actions/cache@v3
2121
# - once stored under a key, they become immutable (even if local cache path content changes)
@@ -64,7 +64,7 @@ jobs:
6464
- uses: actions/checkout@v3
6565
- uses: actions/setup-python@v4
6666
with:
67-
python-version: '3.x'
67+
python-version: '3.8'
6868
- uses: seanmiddleditch/gha-setup-ninja@master
6969
- name: CCache Cache
7070
uses: actions/cache@v3

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ repos:
6868

6969
# Autoremoves unused Python imports
7070
- repo: https://github.com/hadialqattan/pycln
71-
rev: v2.2.2
71+
rev: v2.3.0
7272
hooks:
7373
- id: pycln
7474
name: pycln (python)

CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ if(WarpX_PYTHON)
646646
${CMAKE_COMMAND} -E rm -f -r warpx-whl
647647
COMMAND
648648
${CMAKE_COMMAND} -E env PYWARPX_LIB_DIR=$<TARGET_FILE_DIR:pyWarpX_${WarpX_DIMS_LAST}>
649-
python3 -m pip wheel -v --no-build-isolation --no-deps --wheel-dir=warpx-whl ${WarpX_SOURCE_DIR}
649+
${Python_EXECUTABLE} -m pip wheel -v --no-build-isolation --no-deps --wheel-dir=warpx-whl ${WarpX_SOURCE_DIR}
650650
WORKING_DIRECTORY
651651
${WarpX_BINARY_DIR}
652652
DEPENDS
@@ -660,7 +660,7 @@ if(WarpX_PYTHON)
660660
set(pyWarpX_REQUIREMENT_FILE "requirements.txt")
661661
endif()
662662
add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_install_requirements
663-
python3 -m pip install ${PYINSTALLOPTIONS} -r "${WarpX_SOURCE_DIR}/${pyWarpX_REQUIREMENT_FILE}"
663+
${Python_EXECUTABLE} -m pip install ${PYINSTALLOPTIONS} -r "${WarpX_SOURCE_DIR}/${pyWarpX_REQUIREMENT_FILE}"
664664
WORKING_DIRECTORY
665665
${WarpX_BINARY_DIR}
666666
)
@@ -677,7 +677,7 @@ if(WarpX_PYTHON)
677677
# because otherwise pip would also force reinstall all dependencies.
678678
add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_install
679679
${CMAKE_COMMAND} -E env WARPX_MPI=${WarpX_MPI}
680-
python3 -m pip install --force-reinstall --no-index --no-deps ${PYINSTALLOPTIONS} --find-links=warpx-whl pywarpx
680+
${Python_EXECUTABLE} -m pip install --force-reinstall --no-index --no-deps ${PYINSTALLOPTIONS} --find-links=warpx-whl pywarpx
681681
WORKING_DIRECTORY
682682
${WarpX_BINARY_DIR}
683683
DEPENDS
@@ -686,6 +686,17 @@ if(WarpX_PYTHON)
686686
${WarpX_CUSTOM_TARGET_PREFIX}pip_install_requirements
687687
${_EXTRA_INSTALL_DEPENDS}
688688
)
689+
690+
# this is for package managers only
691+
add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_install_nodeps
692+
${CMAKE_COMMAND} -E env WARPX_MPI=${WarpX_MPI}
693+
${Python_EXECUTABLE} -m pip install --force-reinstall --no-index --no-deps ${PYINSTALLOPTIONS} --find-links=warpx-whl pywarpx
694+
WORKING_DIRECTORY
695+
${WarpX_BINARY_DIR}
696+
DEPENDS
697+
pyWarpX_${WarpX_DIMS_LAST}
698+
${WarpX_CUSTOM_TARGET_PREFIX}pip_wheel
699+
)
689700
endif()
690701

691702

Docs/source/acknowledge_us.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ If your project uses a specific algorithm or component, please consider citing t
5555

5656
- Sandberg R T, Lehe R, Mitchell C E, Garten M, Qiang J, Vay J-L and Huebl A.
5757
**Hybrid Beamline Element ML-Training for Surrogates in the ImpactX Beam-Dynamics Code**.
58-
14th International Particle Accelerator Conference (IPAC'23), WEPA101, *in print*, 2023.
59-
`preprint <https://www.ipac23.org/preproc/pdf/WEPA101.pdf>`__,
60-
`DOI:10.18429/JACoW-IPAC-23-WEPA101 <https://doi.org/10.18429/JACoW-IPAC-23-WEPA101>`__
58+
14th International Particle Accelerator Conference (IPAC'23), WEPA101, 2023.
59+
`DOI:10.18429/JACoW-IPAC2023-WEPA101 <https://doi.org/10.18429/JACoW-IPAC2023-WEPA101>`__
6160

6261
- Huebl A, Lehe R, Zoni E, Shapoval O, Sandberg R T, Garten M, Formenti A, Jambunathan R, Kumar P, Gott K, Myers A, Zhang W, Almgren A, Mitchell C E, Qiang J, Sinn A, Diederichs S, Thevenet M, Grote D, Fedeli L, Clark T, Zaim N, Vincenti H, Vay JL.
6362
**From Compact Plasma Particle Sources to Advanced Accelerators with Modeling at Exascale**.
@@ -75,6 +74,11 @@ If your project uses a specific algorithm or component, please consider citing t
7574
*New Journal of Physics* **24** 025009, 2022.
7675
`DOI:10.1088/1367-2630/ac4ef1 <https://doi.org/10.1088/1367-2630/ac4ef1>`__
7776

77+
- Lehe R, Blelly A, Giacomel L, Jambunathan R, Vay JL.
78+
**Absorption of charged particles in perfectly matched layers by optimal damping of the deposited current**.
79+
*Physical Review E* **106** 045306, 2022.
80+
`DOI:10.1103/PhysRevE.106.045306 <https://doi.org/10.1103/PhysRevE.106.045306>`__
81+
7882
- Zoni E, Lehe R, Shapoval O, Belkin D, Zaim N, Fedeli L, Vincenti H, Vay JL.
7983
**A hybrid nodal-staggered pseudo-spectral electromagnetic particle-in-cell method with finite-order centering**. *Computer Physics Communications* **279**, 2022.
8084
`DOI:10.1016/j.cpc.2022.108457 <https://doi.org/10.1016/j.cpc.2022.108457>`__

Docs/source/highlights.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ Scientific works in laser-plasma and beam-plasma acceleration.
2424
Phys. Rev. Research **5**, 033112, 2023
2525
`DOI:10.1103/PhysRevResearch.5.033112 <https://doi.org/10.1103/PhysRevResearch.5.033112>`__
2626

27-
#. Sandberg R T, Lehe R, Mitchell C E, Garten M, Qiang J, Vay J-L, Huebl A.
27+
#. Sandberg R T, Lehe R, Mitchell C E, Garten M, Qiang J, Vay J-L and Huebl A.
2828
**Hybrid Beamline Element ML-Training for Surrogates in the ImpactX Beam-Dynamics Code**.
29-
14th International Particle Accelerator Conference (IPAC'23), WEPA101, *in print*, 2023.
30-
`preprint <https://www.ipac23.org/preproc/pdf/WEPA101.pdf>`__,
31-
`DOI:10.18429/JACoW-IPAC-23-WEPA101 <https://doi.org/10.18429/JACoW-IPAC-23-WEPA101>`__
29+
14th International Particle Accelerator Conference (IPAC'23), WEPA101, 2023.
30+
`DOI:10.18429/JACoW-IPAC2023-WEPA101 <https://doi.org/10.18429/JACoW-IPAC2023-WEPA101>`__
3231

3332
#. Wang J, Zeng M, Li D, Wang X, Gao J.
3433
**High quality beam produced by tightly focused laser driven wakefield accelerators**.

Docs/source/install/hpc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ This section documents quick-start guides for a selection of supercomputers that
4242
hpc/karolina
4343
hpc/lassen
4444
hpc/lawrencium
45+
hpc/leonardo
4546
hpc/lumi
4647
hpc/lxplus
4748
hpc/ookami

Docs/source/install/hpc/lawrencium.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Optionally, download and install Python packages for :ref:`PICMI <usage-picmi>`
8181
source $HOME/sw/v100/venvs/warpx/bin/activate
8282
python3 -m pip install --upgrade pip
8383
python3 -m pip install --upgrade wheel
84+
python3 -m pip install --upgrade setuptools
8485
python3 -m pip install --upgrade cython
8586
python3 -m pip install --upgrade numpy
8687
python3 -m pip install --upgrade pandas

Docs/source/install/hpc/leonardo.rst

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
.. _building-leonardo:
2+
3+
Leonardo (CINECA)
4+
=================
5+
6+
The `Leonardo cluster <https://leonardo-supercomputer.cineca.eu/>`_ is hosted at `CINECA <https://www.cineca.it/en>`_.
7+
8+
On Leonardo, each one of the 3456 compute nodes features a custom Atos Bull Sequana XH21355 "Da Vinci" blade, composed of:
9+
10+
* 1 x CPU Intel Ice Lake Xeon 8358 32 cores 2.60 GHz
11+
* 512 (8 x 64) GB RAM DDR4 3200 MHz
12+
* 4 x NVidia custom Ampere A100 GPU 64GB HBM2
13+
* 2 x NVidia HDR 2×100 GB/s cards
14+
15+
Introduction
16+
------------
17+
18+
If you are new to this system, **please see the following resources**:
19+
20+
* `Leonardo website <https://leonardo-supercomputer.cineca.eu/>`_
21+
* `Leonardo user guide <https://wiki.u-gov.it/confluence/display/SCAIUS/UG3.2%3A+LEONARDO+UserGuide>`_
22+
23+
Storage organization:
24+
25+
* ``$HOME``: permanent, backed up, user specific (50 GB quota)
26+
* ``$CINECA_SCRATCH``: temporary, user specific, no backup, a large disk for the storage of run time data and files, automatic cleaning procedure of data older than 40 days
27+
* ``$PUBLIC``: permanent, no backup (50 GB quota)
28+
* ``$WORK``: permanent, project specific, no backup
29+
30+
.. _building-leonardo-preparation:
31+
32+
Preparation
33+
-----------
34+
35+
Use the following commands to download the WarpX source code:
36+
37+
.. code-block:: bash
38+
39+
git clone https://github.com/ECP-WarpX/WarpX.git $HOME/src/warpx
40+
41+
We use system software modules, add environment hints and further dependencies via the file ``$HOME/leonardo_gpu_warpx.profile``.
42+
Create it now:
43+
44+
.. code-block:: bash
45+
46+
cp $HOME/src/warpx/Tools/machines/leonardo-cineca/leonardo_gpu_warpx.profile.example $HOME/leonardo_gpu_warpx.profile
47+
48+
.. dropdown:: Script Details
49+
:color: light
50+
:icon: info
51+
:animate: fade-in-slide-down
52+
53+
.. literalinclude:: ../../../../Tools/machines/leonardo-cineca/leonardo_gpu_warpx.profile.example
54+
:language: bash
55+
56+
.. important::
57+
58+
Now, and as the first step on future logins to Leonardo, activate these environment settings:
59+
60+
.. code-block:: bash
61+
62+
source $HOME/leonardo_gpu_warpx.profile
63+
64+
Finally, since Leonardo does not yet provide software modules for some of our dependencies, install them once:
65+
66+
.. code-block:: bash
67+
68+
bash $HOME/src/warpx/Tools/machines/leonardo_cineca/install_gpu_dependencies.sh
69+
source $HOME/sw/venvs/warpx/bin/activate
70+
71+
.. dropdown:: Script Details
72+
:color: light
73+
:icon: info
74+
:animate: fade-in-slide-down
75+
76+
.. literalinclude:: ../../../../Tools/machines/leonardo-cineca/install_gpu_dependencies.sh
77+
:language: bash
78+
79+
80+
.. _building-leonardo-compilation:
81+
82+
Compilation
83+
-----------
84+
85+
Use the following :ref:`cmake commands <building-cmake>` to compile the application executable:
86+
87+
.. code-block:: bash
88+
89+
cd $HOME/src/warpx
90+
rm -rf build_gpu
91+
92+
cmake -S . -B build_gpu -DWarpX_COMPUTE=CUDA -DWarpX_PSATD=ON -DWarpX_QED_TABLE_GEN=ON -DWarpX_DIMS="1;2;RZ;3"
93+
cmake --build build_gpu -j 16
94+
95+
The WarpX application executables are now in ``$HOME/src/warpx/build_gpu/bin/``.
96+
Additionally, the following commands will install WarpX as a Python module:
97+
98+
.. code-block:: bash
99+
100+
cd $HOME/src/warpx
101+
rm -rf build_gpu_py
102+
103+
cmake -S . -B build_gpu_py -DWarpX_COMPUTE=CUDA -DWarpX_PSATD=ON -DWarpX_QED_TABLE_GEN=ON -DWarpX_PYTHON=ON -DWarpX_APP=OFF -DWarpX_DIMS="1;2;RZ;3"
104+
cmake --build build_gpu_py -j 16 --target pip_install
105+
106+
Now, you can :ref:`submit Leonardo compute jobs <running-cpp-leonardo>` for WarpX :ref:`Python (PICMI) scripts <usage-picmi>` (:ref:`example scripts <usage-examples>`).
107+
Or, you can use the WarpX executables to submit Leonardo jobs (:ref:`example inputs <usage-examples>`).
108+
For executables, you can reference their location in your :ref:`job script <running-cpp-leonardo>` or copy them to a location in ``$CINECA_SCRATCH``.
109+
110+
.. _building-leonardo-update:
111+
112+
Update WarpX & Dependencies
113+
---------------------------
114+
115+
If you already installed WarpX in the past and want to update it, start by getting the latest source code:
116+
117+
.. code-block:: bash
118+
119+
cd $HOME/src/warpx
120+
121+
# read the output of this command - does it look ok?
122+
git status
123+
124+
# get the latest WarpX source code
125+
git fetch
126+
git pull
127+
128+
# read the output of these commands - do they look ok?
129+
git status
130+
git log # press q to exit
131+
132+
And, if needed,
133+
134+
- :ref:`update the leonardo_gpu_warpx.profile file <building-leonardo-preparation>`,
135+
- log out and into the system, activate the now updated environment profile as usual,
136+
- :ref:`execute the dependency install scripts <building-leonardo-preparation>`.
137+
138+
As a last step, clean the build directories ``rm -rf $HOME/src/warpx/build_gpu*`` and rebuild WarpX.
139+
140+
141+
.. _running-leonardo:
142+
143+
Running
144+
-------
145+
The batch script below can be used to run a WarpX simulation on multiple nodes on Leonardo.
146+
Replace descriptions between chevrons ``<>`` by relevant values.
147+
Note that we run one MPI rank per GPU.
148+
149+
.. literalinclude:: ../../../../Tools/machines/leonardo-cineca/job.sh
150+
:language: bash
151+
:caption: You can copy this file from ``$HOME/src/warpx/Tools/machines/leonardo-cineca/job.sh``.
152+
153+
To run a simulation, copy the lines above to a file ``job.sh`` and run
154+
155+
.. code-block:: bash
156+
157+
sbatch job.sh
158+
159+
to submit the job.
160+
161+
.. _post-processing-leonardo:
162+
163+
Post-Processing
164+
---------------
165+
166+
For post-processing, activate the environment settings:
167+
168+
.. code-block:: bash
169+
170+
source $HOME/leonardo_gpu_warpx.profile
171+
172+
and run python scripts.

Docs/source/maintenance/release.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The following scripts automate this workflow, in case one needs a newer commit o
1313
.. code-block:: sh
1414
1515
./Tools/Release/updateAMReX.py
16+
./Tools/Release/updatepyAMReX.py
1617
./Tools/Release/updatePICSAR.py
1718
1819
@@ -32,6 +33,7 @@ In order to create a GitHub release, you need to:
3233
.. code-block:: sh
3334
3435
./Tools/Release/updateAMReX.py
36+
./Tools/Release/updatepyAMReX.py
3537
./Tools/Release/updatePICSAR.py
3638
3739
./Tools/Release/newVersion.sh

Docs/source/refs.bib

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,3 +483,16 @@ @article{Stanier2020
483483
author = {A. Stanier and L. Chacón and A. Le},
484484
keywords = {Hybrid, Particle-in-cell, Plasma, Asymptotic-preserving, Cancellation problem, Space weather},
485485
}
486+
487+
@book{Stix1992,
488+
author = {Stix, T.H.},
489+
date-added = {2023-06-29 13:51:16 -0700},
490+
date-modified = {2023-06-29 13:51:16 -0700},
491+
isbn = {978-0-88318-859-0},
492+
lccn = {lc91033341},
493+
publisher = {American Inst. of Physics},
494+
title = {Waves in {Plasmas}},
495+
url = {https://books.google.com/books?id=OsOWJ8iHpmMC},
496+
year = {1992},
497+
bdsk-url-1 = {https://books.google.com/books?id=OsOWJ8iHpmMC}
498+
}

0 commit comments

Comments
 (0)