diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index d198916af4e..1806bdb00d1 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -41,7 +41,7 @@ jobs: WARPX_CI_EB: 'TRUE' # default: 60; maximum: 360 - timeoutInMinutes: 120 + timeoutInMinutes: 180 steps: # set up caches: diff --git a/.clang-tidy b/.clang-tidy index 8d01a2917c3..f2ddff6b779 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,10 +1,78 @@ Checks: '-*, + bugprone-* + -bugprone-easily-swappable-parameters, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-misplaced-widening-cast, + cert-* + -cert-err58-cpp, cppcoreguidelines-avoid-goto, + cppcoreguidelines-interfaces-global-init, + -cppcoreguidelines-avoid-non-const-global-variables, + -cppcoreguidelines-init-variables, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-narrowing-conversions, + -cppcoreguidelines-no-malloc, + -cppcoreguidelines-owning-memory, misc-const-correctness, + misc-misleading-bidirectional, + misc-misleading-identifier, + misc-misplaced-const, + misc-uniqueptr-reset-release, + misc-unused-alias-decls, + misc-unused-parameters, + misc-unused-using-decls, + -misc-definitions-in-headers, + modernize-avoid-bind, + modernize-concat-nested-namespaces, + modernize-deprecated-headers, + modernize-deprecated-ios-base-aliases, + modernize-loop-convert, + modernize-make-shared, + modernize-make-unique, + modernize-pass-by-value, + modernize-raw-string-literal, + modernize-redundant-void-arg, + modernize-replace-auto-ptr, + modernize-replace-disallow-copy-and-assign-macro, + modernize-replace-random-shuffle, + modernize-return-braced-init-list, + modernize-shrink-to-fit, + modernize-unary-static-assert, modernize-use-nullptr, + 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-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-uppercase-literal-suffix, + readability-use-anyofallof, readability-non-const-parameter ' +CheckOptions: +- key: modernize-pass-by-value.ValuesOnly + value: 'true' + HeaderFilterRegex: 'Source[a-z_A-Z0-9\/]+\.H$' diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 7b39d0bbf48..e0745687438 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -12,7 +12,7 @@ jobs: # https://github.com/ComputationalRadiationPhysics/picongpu/blob/0.5.0/share/picongpu/dockerfiles/ubuntu-1604/Dockerfile # https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ build_nvcc: - name: NVCC 11.0.3 SP + name: NVCC 11.3 SP runs-on: ubuntu-20.04 if: github.event.pull_request.draft == false env: @@ -30,7 +30,7 @@ jobs: python-version: '3.x' - name: install dependencies run: | - .github/workflows/dependencies/nvcc11-0.sh + .github/workflows/dependencies/nvcc11-3.sh - name: CCache Cache uses: actions/cache@v3 # - once stored under a key, they become immutable (even if local cache path content changes) @@ -65,7 +65,7 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_COMPUTE=CUDA \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DAMReX_CUDA_ARCH=6.0 \ -DWarpX_OPENPMD=ON \ -DWarpX_openpmd_internal=OFF \ @@ -77,7 +77,8 @@ jobs: python3 -m pip install --upgrade pip setuptools wheel export WARPX_MPI=ON - PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel . + export PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/ + python3 -m pip wheel . python3 -m pip install *.whl # make sure legacy build system continues to build, i.e., that we don't forget @@ -110,7 +111,7 @@ jobs: which nvcc || echo "nvcc not in PATH!" git clone https://github.com/AMReX-Codes/amrex.git ../amrex - cd ../amrex && git checkout --detach d28b9ab1cd64e648372ae679a6be01c733899525 && cd - + cd ../amrex && git checkout --detach dda0d979ca2ec912f7dd2eb630399f33ee7990e0 && cd - make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_PSATD=TRUE USE_CCACHE=TRUE -j 2 build_nvhpc21-11-nvcc: @@ -161,7 +162,7 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_COMPUTE=CUDA \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DAMReX_CUDA_ARCH=8.0 \ -DWarpX_OPENPMD=ON \ -DWarpX_PSATD=ON \ @@ -176,5 +177,6 @@ jobs: python3 -m pip install --upgrade pip setuptools wheel export WARPX_MPI=ON - PYWARPX_LIB_DIR=$PWD/build/lib python3 -m pip wheel . + export PYWARPX_LIB_DIR=$PWD/build/lib/site-packages/pywarpx/ + python3 -m pip wheel . python3 -m pip install *.whl diff --git a/.github/workflows/dependencies/dpcpp.sh b/.github/workflows/dependencies/dpcpp.sh index 65e3f36477f..9ecc5e4ca19 100755 --- a/.github/workflows/dependencies/dpcpp.sh +++ b/.github/workflows/dependencies/dpcpp.sh @@ -14,10 +14,13 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries # Ref.: https://github.com/rscohn2/oneapi-ci # intel-basekit intel-hpckit are too large in size -wget -q -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB \ - | sudo apt-key add - -echo "deb https://apt.repos.intel.com/oneapi all main" \ - | sudo tee /etc/apt/sources.list.d/oneAPI.list + +# download the key to system keyring +wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ +| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + +# add signed entry to apt sources and configure the APT client to use Intel repository: +echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt-get update @@ -33,7 +36,7 @@ do build-essential \ ccache \ cmake \ - intel-oneapi-dpcpp-cpp-compiler intel-oneapi-mkl-devel \ + intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel \ g++ gfortran \ libopenmpi-dev \ openmpi-bin \ diff --git a/.github/workflows/dependencies/nvcc11-0.sh b/.github/workflows/dependencies/nvcc11-3.sh similarity index 60% rename from .github/workflows/dependencies/nvcc11-0.sh rename to .github/workflows/dependencies/nvcc11-3.sh index a018c7a4877..ed9fd211128 100755 --- a/.github/workflows/dependencies/nvcc11-0.sh +++ b/.github/workflows/dependencies/nvcc11-3.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2020-2022 The WarpX Community +# Copyright 2020-2023 The WarpX Community # # License: BSD-3-Clause-LBNL # Authors: Axel Huebl @@ -26,30 +26,27 @@ sudo apt-get install -y \ pkg-config \ wget -wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin -sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 -sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub -echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" \ - | sudo tee /etc/apt/sources.list.d/cuda.list +wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb +sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update sudo apt-get install -y \ - cuda-command-line-tools-11-0 \ - cuda-compiler-11-0 \ - cuda-cupti-dev-11-0 \ - cuda-minimal-build-11-0 \ - cuda-nvml-dev-11-0 \ - cuda-nvtx-11-0 \ - libcufft-dev-11-0 \ - libcurand-dev-11-0 -sudo ln -s cuda-11.0 /usr/local/cuda + cuda-command-line-tools-11-3 \ + cuda-compiler-11-3 \ + cuda-cupti-dev-11-3 \ + cuda-minimal-build-11-3 \ + cuda-nvml-dev-11-3 \ + cuda-nvtx-11-3 \ + libcufft-dev-11-3 \ + libcurand-dev-11-3 +sudo ln -s cuda-11.3 /usr/local/cuda # if we run out of temporary storage in CI: -#du -sh /usr/local/cuda-11.0 +#du -sh /usr/local/cuda-11.3 #echo "+++ REDUCING CUDA Toolkit install size +++" -#sudo rm -rf /usr/local/cuda-11.0/targets/x86_64-linux/lib/libcu{fft,pti,rand}_static.a -#sudo rm -rf /usr/local/cuda-11.0/targets/x86_64-linux/lib/libnvperf_host_static.a -#du -sh /usr/local/cuda-11.0/ +#sudo rm -rf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libcu{fft,pti,rand}_static.a +#sudo rm -rf /usr/local/cuda-11.3/targets/x86_64-linux/lib/libnvperf_host_static.a +#du -sh /usr/local/cuda-11.3/ #df -h # cmake-easyinstall diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index 612fe5c2d8a..40e5055cd8b 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -51,7 +51,7 @@ jobs: -DAMReX_AMD_ARCH=gfx900 \ -DWarpX_COMPUTE=HIP \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DWarpX_MPI=ON \ -DWarpX_OPENPMD=ON \ -DWarpX_PRECISION=SINGLE \ @@ -59,7 +59,8 @@ jobs: cmake --build build_sp -j 2 export WARPX_MPI=OFF - PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel . + export PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/ + python3 -m pip wheel . python3 -m pip install *.whl build_hip_2d_dp: @@ -107,7 +108,7 @@ jobs: -DWarpX_DIMS=2 \ -DWarpX_COMPUTE=HIP \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DWarpX_MPI=ON \ -DWarpX_OPENPMD=ON \ -DWarpX_PRECISION=DOUBLE \ @@ -115,5 +116,6 @@ jobs: cmake --build build_2d -j 2 export WARPX_MPI=OFF - PYWARPX_LIB_DIR=$PWD/build_2d/lib python3 -m pip wheel . + export PYWARPX_LIB_DIR=$PWD/build_2d/lib/site-packages/pywarpx/ + python3 -m pip wheel . python3 -m pip install *.whl diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index d6d9f338181..57a25ce7629 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -39,7 +39,7 @@ jobs: CC: gcc CMAKE_PREFIX_PATH: /ascent/install/lib/cmake/ container: - image: alpinedav/ascent:0.9.1 + image: alpinedav/ascent:0.9.2 steps: - uses: actions/checkout@v3 - name: Configure diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 9d08d3f0e51..aba8200f1b2 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -41,9 +41,13 @@ jobs: export CXX=$(which icpc) export CC=$(which icc) + python3 -m pip install --upgrade pip setuptools wheel + cmake -S . -B build_dp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_LIB=ON \ + -DpyAMReX_IPO=OFF \ + -DWarpX_PYTHON=ON \ + -DWarpX_PYTHON_IPO=OFF \ -DWarpX_MPI=OFF \ -DWarpX_OPENPMD=ON \ -DWarpX_openpmd_internal=OFF @@ -51,15 +55,15 @@ jobs: cmake -S . -B build_sp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_LIB=ON \ + -DpyAMReX_IPO=OFF \ + -DWarpX_PYTHON=ON \ + -DWarpX_PYTHON_IPO=OFF \ -DWarpX_MPI=OFF \ -DWarpX_OPENPMD=ON \ -DWarpX_openpmd_internal=OFF \ -DWarpX_PRECISION=SINGLE cmake --build build_sp -j 2 - - python3 -m pip install --upgrade pip setuptools wheel - PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip install -v . + cmake --build build_sp --target pip_install build_icpx: name: oneAPI ICX SP @@ -99,20 +103,19 @@ jobs: export CXX=$(which icpx) export CC=$(which icx) + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade setuptools wheel + cmake -S . -B build_sp \ -DCMAKE_CXX_FLAGS_RELEASE="-O1 -DNDEBUG" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DWarpX_MPI=OFF \ -DWarpX_OPENPMD=ON \ -DWarpX_PRECISION=SINGLE cmake --build build_sp -j 2 - - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade setuptools wheel - PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel -v . - python3 -m pip install *.whl + cmake --build build_sp --target pip_install - name: run pywarpx run: | @@ -167,7 +170,7 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_COMPUTE=SYCL \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DWarpX_MPI=OFF \ -DWarpX_OPENPMD=ON \ -DWarpX_PRECISION=SINGLE @@ -176,5 +179,5 @@ jobs: # Skip this as it will copy the binary artifacts and we are tight on disk space # python3 -m pip install --upgrade pip # python3 -m pip install --upgrade setuptools wheel - # PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel . + # PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/ python3 -m pip wheel . # python3 -m pip install *.whl diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e37c985a1d2..0495155b430 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -63,6 +63,9 @@ jobs: ccache-macos-appleclang- - name: build WarpX run: | + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade pip setuptools wheel + cmake -S . -B build_dp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_EB=ON \ @@ -72,17 +75,14 @@ jobs: cmake -S . -B build_sp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DPython_EXECUTABLE=$(which python3) \ -DWarpX_EB=ON \ - -DWarpX_LIB=ON \ + -DWarpX_PYTHON=ON \ -DWarpX_OPENPMD=ON \ -DWarpX_openpmd_internal=OFF \ -DWarpX_PRECISION=SINGLE cmake --build build_sp -j 3 - - python3 -m pip install --upgrade pip setuptools wheel - export WARPX_MPI=ON - PYWARPX_LIB_DIR=$PWD/build_sp/lib python3 -m pip wheel . - python3 -m pip install *.whl + cmake --build build_sp --target pip_install - name: run pywarpx run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 797ad285fd1..0b43760b621 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -163,6 +163,8 @@ jobs: runs-on: ubuntu-20.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 # setuptools/mp4py work-around, see @@ -189,14 +191,16 @@ jobs: - name: build WarpX run: | python3 -m pip install --upgrade pip setuptools wheel - export WARPX_MPI=ON - export WARPX_OPENPMD=ON - export WARPX_PSATD=ON - export WARPX_QED_TABLE_GEN=ON - export CC=$(which clang) - export CXX=$(which clang++) + export CXXFLAGS="-Werror -Wno-error=pass-failed" - python3 -m pip install -v . + + cmake -S . -B build \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWarpX_APP=OFF \ + -DWarpX_PSATD=ON \ + -DWarpX_PYTHON=ON \ + -DWarpX_QED_TABLE_GEN=ON + cmake --build build -j 2 --target pip_install - name: run pywarpx run: | diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c6b89999338..e0629e3abca 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,6 +13,9 @@ jobs: if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' - name: CCache Cache uses: actions/cache@v3 # - once stored under a key, they become immutable (even if local cache path content changes) @@ -33,16 +36,22 @@ jobs: -DWarpX_COMPUTE=NOACC ` -DWarpX_OPENPMD=ON ` -DWarpX_MPI=OFF ` - -DWarpX_LIB=ON + -DWarpX_PYTHON=ON if(!$?) { Exit $LASTEXITCODE } cmake --build build --config Debug --parallel 2 if(!$?) { Exit $LASTEXITCODE } python3 -m pip install --upgrade pip setuptools wheel if(!$?) { Exit $LASTEXITCODE } + cmake --build build --config Debug --target install + if(!$?) { Exit $LASTEXITCODE } cmake --build build --config Debug --target pip_install if(!$?) { Exit $LASTEXITCODE } + - name: Test + run: | + $env:PATH += ';C:/Program Files (x86)/WarpX/bin/' + python3 Examples\Tests\gaussian_beam\PICMI_inputs_gaussian_beam.py # JSON writes are currently very slow (50min) with MSVC # --diagformat=openpmd @@ -53,6 +62,10 @@ jobs: if: github.event.pull_request.draft == false steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - uses: seanmiddleditch/gha-setup-ninja@master - name: CCache Cache uses: actions/cache@v3 # - once stored under a key, they become immutable (even if local cache path content changes) @@ -65,7 +78,6 @@ jobs: restore-keys: | ccache-windows-winclang-${{ hashFiles('.github/workflows/windows.yml') }}- ccache-windows-winclang- - - uses: seanmiddleditch/gha-setup-ninja@master - name: Build & Install shell: cmd run: | @@ -78,17 +90,29 @@ jobs: -DCMAKE_VERBOSE_MAKEFILE=ON ^ -DWarpX_COMPUTE=OMP ^ -DWarpX_EB=ON ^ - -DWarpX_LIB=ON ^ + -DWarpX_PYTHON=ON ^ -DWarpX_MPI=OFF ^ -DWarpX_OPENPMD=ON if errorlevel 1 exit 1 cmake --build build --config Release --parallel 2 if errorlevel 1 exit 1 + cmake --build build --config Release --target install + if errorlevel 1 exit 1 + python3 -m pip install --upgrade pip setuptools wheel if errorlevel 1 exit 1 + python3 -m pip install --upgrade -r requirements.txt + if errorlevel 1 exit 1 + cmake --build build --config Release --target pip_install if errorlevel 1 exit 1 + - name: Test + shell: cmd + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 + set "PATH=C:/Program Files (x86)/WarpX/bin/;%PATH%" + python3 Examples\Tests\gaussian_beam\PICMI_inputs_gaussian_beam.py --diagformat=openpmd if errorlevel 1 exit 1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b947a0488a..1c32c94c99c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: # Changes tabs to spaces - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.1 + rev: v1.5.4 hooks: - id: remove-tabs exclude: 'Make.WarpX|Make.package|Makefile|GNUmake' @@ -68,7 +68,7 @@ repos: # Autoremoves unused Python imports - repo: https://github.com/hadialqattan/pycln - rev: v2.1.5 + rev: v2.2.2 hooks: - id: pycln name: pycln (python) diff --git a/.zenodo.json b/.zenodo.json index 43af64573e5..bbba267def9 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -43,6 +43,11 @@ "name": "Fedeli, Luca", "orcid": "0000-0002-7215-4178" }, + { + "affiliation": "Lawrence Berkeley National Laboratory", + "name": "Formenti, Arianna", + "orcid": "0000-0002-7887-9313" + }, { "affiliation": "Lawrence Berkeley National Laboratory", "name": "Garten, Marco", @@ -74,7 +79,7 @@ "orcid": "0000-0002-1750-9757" }, { - "affiliation": "Modern Electron", + "affiliation": "TAE Technologies Inc.", "name": "Groenewald, Roelof E.", "orcid": "0000-0002-5282-7152" }, diff --git a/CMakeLists.txt b/CMakeLists.txt index 998eec140e8..81a1f2da1f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # Preamble #################################################################### # cmake_minimum_required(VERSION 3.20.0) -project(WarpX VERSION 23.06) +project(WarpX VERSION 23.08) include(${WarpX_SOURCE_DIR}/cmake/WarpXFunctions.cmake) @@ -64,10 +64,11 @@ option(WarpX_EB "Embedded boundary support" OFF) cmake_dependent_option(WarpX_GPUCLOCK "Add GPU kernel timers (cost function)" ON "WarpX_COMPUTE STREQUAL CUDA OR WarpX_COMPUTE STREQUAL HIP" OFF) -option(WarpX_LIB "Build WarpX as a shared library" OFF) +option(WarpX_LIB "Build WarpX as a library" OFF) option(WarpX_MPI "Multi-node support (message-passing)" ON) option(WarpX_OPENPMD "openPMD I/O (HDF5, ADIOS)" ON) option(WarpX_PSATD "spectral solver support" OFF) +option(WarpX_PYTHON "Python bindings" OFF) option(WarpX_SENSEI "SENSEI in situ diagnostics" OFF) option(WarpX_QED "QED support (requires PICSAR)" ON) option(WarpX_QED_TABLE_GEN "QED table generation (requires PICSAR and Boost)" OFF) @@ -120,12 +121,21 @@ set_default_build_type("Release") # Option to enable interprocedural optimization # (also know as "link-time optimization" or "whole program optimization") option(WarpX_IPO "Compile WarpX with interprocedural optimization (will take more time)" OFF) +option(WarpX_PYTHON_IPO + "Compile Python bindings with interprocedural optimization (IPO) / link-time optimization (LTO)" + ON +) + +# enforce consistency of dependent options +if(WarpX_APP OR WarpX_PYTHON) + set(WarpX_LIB ON CACHE STRING "Build WarpX as a library" FORCE) +endif() # note: we could skip this if we solely build WarpX_APP, but if we build a # shared WarpX library or a third party, like ImpactX, uses ablastr in a # shared library (e.g., for Python bindings), then we need relocatable code. option(ABLASTR_POSITION_INDEPENDENT_CODE - "Build ABLASTR with position independent code" ${WarpX_LIB}) + "Build ABLASTR with position independent code" ON) mark_as_advanced(ABLASTR_POSITION_INDEPENDENT_CODE) # this defined the variable BUILD_TESTING which is ON by default @@ -168,44 +178,62 @@ if(WarpX_PSATD) endif() endif() +# Python +if(WarpX_PYTHON) + find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) + + # default installation directories: Python + warpx_set_default_install_dirs_python() + + # pybind11 + # builds pybind11 from git (default), form local source or + # finds an existing install + include(${WarpX_SOURCE_DIR}/cmake/dependencies/pybind11.cmake) + + # pyAMReX + include(${WarpX_SOURCE_DIR}/cmake/dependencies/pyAMReX.cmake) +endif() + # Targets ##################################################################### # +include(GenerateExportHeader) set(_ALL_TARGETS) foreach(D IN LISTS WarpX_DIMS) warpx_set_suffix_dims(SD ${D}) - # collect all objects for compilation - add_library(WarpX_${SD} OBJECT) - add_library(ablastr_${SD}) # ABLASTR library + add_library(ablastr_${SD}) set(_BUILDINFO_SRC ablastr_${SD}) - list(APPEND _ALL_TARGETS WarpX_${SD} ablastr_${SD}) + list(APPEND _ALL_TARGETS ablastr_${SD}) add_library(WarpX::ablastr_${SD} ALIAS ablastr_${SD}) + # link into a library (default: static) + if(WarpX_LIB) + add_library(lib_${SD}) + add_library(WarpX::lib_${SD} ALIAS lib_${SD}) + target_link_libraries(lib_${SD} PUBLIC ablastr_${SD}) + set(_BUILDINFO_SRC lib_${SD}) + list(APPEND _ALL_TARGETS lib_${SD}) + + set_target_properties(lib_${SD} PROPERTIES + POSITION_INDEPENDENT_CODE ON + WINDOWS_EXPORT_ALL_SYMBOLS ON + ) + endif() + # executable application # note: we currently avoid a dependency on a core library # for simpler usage, but could make this an option if(WarpX_APP) add_executable(app_${SD}) add_executable(WarpX::app_${SD} ALIAS app_${SD}) - target_link_libraries(app_${SD} PRIVATE WarpX_${SD} ablastr_${SD}) + target_link_libraries(app_${SD} PRIVATE lib_${SD}) set(_BUILDINFO_SRC app_${SD}) list(APPEND _ALL_TARGETS app_${SD}) endif() - # link into a shared library - if(WarpX_LIB) - add_library(shared_${SD} MODULE) - add_library(WarpX::shared_${SD} ALIAS shared_${SD}) - target_link_libraries(shared_${SD} PUBLIC WarpX_${SD} ablastr_${SD}) - set(_BUILDINFO_SRC shared_${SD}) - list(APPEND _ALL_TARGETS shared_${SD}) - - set_target_properties(WarpX_${SD} shared_${SD} PROPERTIES - POSITION_INDEPENDENT_CODE ON - WINDOWS_EXPORT_ALL_SYMBOLS ON - ) + if(WarpX_PYTHON OR (WarpX_LIB AND BUILD_SHARED_LIBS)) set(ABLASTR_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Build ABLASTR with position independent code" FORCE) endif() @@ -221,43 +249,143 @@ foreach(D IN LISTS WarpX_DIMS) endif() # own headers - target_include_directories(WarpX_${SD} PUBLIC - $ - $ - ) target_include_directories(ablastr_${SD} PUBLIC # future: own directory root $ + $ ) + if(WarpX_LIB) + target_include_directories(lib_${SD} PUBLIC + $ + $ + ) + endif() - # if we include we will need to call: - generate_buildinfo(${_BUILDINFO_SRC} "${WarpX_SOURCE_DIR}") - target_link_libraries(WarpX_${SD} PRIVATE buildInfo::${_BUILDINFO_SRC}) - unset(_BUILDINFO_SRC) + # build Python module (this is always a shared library) + if(WarpX_PYTHON) + add_library(pyWarpX_${SD} MODULE Source/Python/pyWarpX.cpp) + add_library(WarpX::pyWarpX_${SD} ALIAS pyWarpX_${SD}) + target_link_libraries(pyWarpX_${SD} PUBLIC lib_${SD}) + set(_BUILDINFO_SRC pyWarpX_${SD}) + list(APPEND _ALL_TARGETS pyWarpX_${SD}) + + # set Python module properties + set_target_properties(pyWarpX_${SD} PROPERTIES + # hide symbols for combining multiple pybind11 modules downstream & for + # reduced binary size + CXX_VISIBILITY_PRESET "hidden" + CUDA_VISIBILITY_PRESET "hidden" + # name of the pybind-generated python module, which is wrapped in another + # fluffy front-end modules, so we can extend it with pure Python + ARCHIVE_OUTPUT_NAME warpx_pybind_${SD} + LIBRARY_OUTPUT_NAME warpx_pybind_${SD} + # build output directories - mainly set to run tests from CMake & IDEs + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + PDB_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + ) + get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(isMultiConfig) + foreach(CFG IN LISTS CMAKE_CONFIGURATION_TYPES) + string(TOUPPER "${CFG}" CFG_UPPER) + set_target_properties(pyWarpX_${SD} PROPERTIES + # build output directories - mainly set to run tests from CMake & IDEs + # note: same as above, but for Multi-Config generators + ARCHIVE_OUTPUT_DIRECTORY_${CFG_UPPER} ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + LIBRARY_OUTPUT_DIRECTORY_${CFG_UPPER} ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + RUNTIME_OUTPUT_DIRECTORY_${CFG_UPPER} ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + PDB_OUTPUT_DIRECTORY_${CFG_UPPER} ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + COMPILE_PDB_OUTPUT_DIRECTORY_${CFG_UPPER} ${CMAKE_PYTHON_OUTPUT_DIRECTORY}/pywarpx + ) + endforeach() + endif() + if(EMSCRIPTEN) + set_target_properties(pyWarpX_${SD} PROPERTIES + PREFIX "") + else() + pybind11_extension(pyWarpX_${SD}) + endif() + if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) + pybind11_strip(pyWarpX_${SD}) + endif() + endif() + + if(WarpX_LIB) + # if we include we will need to call: + generate_buildinfo(${_BUILDINFO_SRC} "${WarpX_SOURCE_DIR}") + target_link_libraries(lib_${SD} PRIVATE buildInfo::${_BUILDINFO_SRC}) + unset(_BUILDINFO_SRC) + + # add sources + target_sources(lib_${SD} PRIVATE Source/WarpX.cpp) + endif() # add sources - target_sources(WarpX_${SD} PRIVATE Source/WarpX.cpp) if(WarpX_APP) target_sources(app_${SD} PRIVATE Source/main.cpp) endif() endforeach() +# Headers controlling symbol visibility (for Windows) +# Note: once WarpX gets rid of all its globals, we will not need this. +# - extern ... functions +# - static class member variables +generate_export_header(ablastr_${WarpX_DIMS_LAST} + BASE_NAME ablastr + EXPORT_FILE_NAME Source/ablastr/export.H) +if(WarpX_LIB) + generate_export_header(lib_${WarpX_DIMS_LAST} + BASE_NAME warpx + EXPORT_FILE_NAME Source/Utils/export.H) +endif() +# At build-time, we might need to set WarpX__EXPORTS and ablastr__EXPORTS on all targets +foreach(D IN LISTS WarpX_DIMS) + warpx_set_suffix_dims(SD ${D}) + target_compile_definitions(ablastr_${SD} PRIVATE ablastr_${WarpX_DIMS_LAST}_EXPORTS) + if(WarpX_LIB) + target_compile_definitions(lib_${SD} PRIVATE lib_${WarpX_DIMS_LAST}_EXPORTS) # note: some collision risk here + endif() + # Static libs: WARPX_STATIC_DEFINE and ABLASTR_STATIC_DEFINE during build time + # note: using a static lib (lib_${SD}) in a .dll (pyWarpX_${SD}) still needs the exports for + # dllimport at DLL build time. + # https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html + if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(ablastr_${SD} PRIVATE ABLASTR_STATIC_DEFINE) + if(WarpX_LIB) + target_compile_definitions(lib_${SD} PRIVATE WARPX_STATIC_DEFINE) + endif() + endif() +endforeach() + +if(WarpX_PYTHON) + # copy PICMI and other Python scripts to build directory + add_custom_command(TARGET pyWarpX_${WarpX_DIMS_LAST} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${WarpX_SOURCE_DIR}/Python/pywarpx + $ + ) +endif() + add_subdirectory(Source/ablastr) -add_subdirectory(Source/AcceleratorLattice) -add_subdirectory(Source/BoundaryConditions) -add_subdirectory(Source/Diagnostics) -add_subdirectory(Source/EmbeddedBoundary) -add_subdirectory(Source/Evolve) -add_subdirectory(Source/FieldSolver) -add_subdirectory(Source/Filter) -add_subdirectory(Source/Initialization) -add_subdirectory(Source/Laser) -add_subdirectory(Source/Parallelization) -add_subdirectory(Source/Particles) -add_subdirectory(Source/Python) -add_subdirectory(Source/Utils) - -# Interprocedural optimization +if(WarpX_LIB) + add_subdirectory(Source/AcceleratorLattice) + add_subdirectory(Source/BoundaryConditions) + add_subdirectory(Source/Diagnostics) + add_subdirectory(Source/EmbeddedBoundary) + add_subdirectory(Source/Evolve) + add_subdirectory(Source/FieldSolver) + add_subdirectory(Source/Filter) + add_subdirectory(Source/Initialization) + add_subdirectory(Source/Laser) + add_subdirectory(Source/Parallelization) + add_subdirectory(Source/Particles) + add_subdirectory(Source/Python) + add_subdirectory(Source/Utils) +endif() + +# Interprocedural optimization (IPO) / Link-Time Optimization (LTO) if(WarpX_IPO) enable_IPO("${_ALL_TARGETS}") endif() @@ -270,7 +398,6 @@ foreach(D IN LISTS WarpX_DIMS) else() target_link_libraries(ablastr_${SD} PUBLIC WarpX::thirdparty::amrex_${D}d) endif() - target_link_libraries(WarpX_${SD} PUBLIC ablastr_${SD}) if(WarpX_PSATD) target_link_libraries(ablastr_${SD} PUBLIC WarpX::thirdparty::FFT) @@ -286,6 +413,13 @@ foreach(D IN LISTS WarpX_DIMS) endif() endif() + if(WarpX_PYTHON) + target_link_libraries(pyWarpX_${SD} PRIVATE pybind11::module pybind11::windows_extras) + if(WarpX_PYTHON_IPO) + target_link_libraries(pyWarpX_${SD} PRIVATE pybind11::lto) + endif() + endif() + if(WarpX_OPENPMD) target_link_libraries(ablastr_${SD} PUBLIC openPMD::openPMD) endif() @@ -325,14 +459,6 @@ endif() foreach(D IN LISTS WarpX_DIMS) warpx_set_suffix_dims(SD ${D}) - # avoid building all object files if we are only used as ABLASTR library - if(NOT WarpX_APP AND NOT WarpX_LIB) - set_target_properties(WarpX_${SD} PROPERTIES - EXCLUDE_FROM_ALL 1 - EXCLUDE_FROM_DEFAULT_BUILD 1 - ) - endif() - # fancy binary name for build variants set_warpx_binary_name(${D}) endforeach() @@ -371,10 +497,32 @@ foreach(D IN LISTS WarpX_DIMS) target_compile_definitions(ablastr_${SD} PUBLIC WARPX_USE_PSATD) endif() + if(WarpX_PYTHON) + # for module __version__ + target_compile_definitions(pyWarpX_${SD} PRIVATE + PYWARPX_VERSION_INFO=${pyWarpX_VERSION_INFO}) + endif() + # : M_PI if(WIN32) target_compile_definitions(ablastr_${SD} PUBLIC _USE_MATH_DEFINES) endif() + + # Windows DLLs and Global Symbols + # https://stackoverflow.com/questions/54560832/cmake-windows-export-all-symbols-does-not-cover-global-variables/54568678#54568678 + # + if(WIN32 AND BUILD_SHARED_LIBS) + set(ABLASTR_IS_DLL ON) + target_compile_definitions(ablastr_${SD} PRIVATE ABLASTR_IS_DLL_BUILDING) + endif() + if(WIN32 AND WarpX_LIB AND BUILD_SHARED_LIBS) + set(ABLASTR_IS_DLL ON) + target_compile_definitions(lib_${SD} PRIVATE ABLASTR_IS_DLL_BUILDING) + endif() + if(WIN32 AND WarpX_PYTHON) + set(ABLASTR_IS_DLL ON) + target_compile_definitions(pyWarpX_${SD} PRIVATE ABLASTR_IS_DLL_BUILDING) + endif() endforeach() @@ -413,7 +561,10 @@ foreach(D IN LISTS WarpX_DIMS) list(APPEND WarpX_INSTALL_TARGET_NAMES app_${SD}) endif() if(WarpX_LIB) - list(APPEND WarpX_INSTALL_TARGET_NAMES shared_${SD}) + list(APPEND WarpX_INSTALL_TARGET_NAMES lib_${SD}) + endif() + if(WarpX_PYTHON) + list(APPEND WarpX_INSTALL_TARGET_NAMES pyWarpX_${SD}) endif() install(TARGETS ${WarpX_INSTALL_TARGET_NAMES} @@ -427,25 +578,26 @@ foreach(D IN LISTS WarpX_DIMS) # simplified library alias # this is currently expected by Python bindings if(WarpX_LIB) - if(D STREQUAL "RZ") - set(lib_dim "rz") - else() - set(lib_dim "${WarpX_DIMS}d") - endif() if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR}) - set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR}) + set(ABS_INSTALL_LIB_DIR "${CMAKE_INSTALL_LIBDIR}") else() - set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + set(ABS_INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") endif() # escape spaces for generated cmake_install.cmake file file(TO_CMAKE_PATH "${ABS_INSTALL_LIB_DIR}" ABS_INSTALL_LIB_DIR) install(CODE "file(CREATE_LINK - $ - \"${ABS_INSTALL_LIB_DIR}/libwarpx.${lib_dim}$\" + $ + \"${ABS_INSTALL_LIB_DIR}/libwarpx.${SD}$\" COPY_ON_ERROR SYMBOLIC)") endif() + # WarpX + # Utils/WarpXVersion.H + + # ABLASTR + # export.H + # CMake package file for find_package(WarpX::WarpX) in depending projects #install(EXPORT WarpXTargets # FILE WarpXTargets.cmake @@ -463,10 +615,17 @@ endforeach() # pip helpers for the pywarpx package ######################################### # -if(WarpX_LIB) +if(WarpX_PYTHON) set(PYINSTALLOPTIONS "" CACHE STRING "Additional parameters to pass to `pip install`") + # ensure all targets are built before we package them in a wheel + set(pyWarpX_INSTALL_TARGET_NAMES) + foreach(D IN LISTS WarpX_DIMS) + warpx_set_suffix_dims(SD ${D}) + list(APPEND pyWarpX_INSTALL_TARGET_NAMES pyWarpX_${SD}) + endforeach() + # add a prefix to custom targets so we do not collide if used as a subproject if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) set(_WarpX_CUSTOM_TARGET_PREFIX_DEFAULT "") @@ -476,16 +635,16 @@ if(WarpX_LIB) set(WarpX_CUSTOM_TARGET_PREFIX "${_WarpX_CUSTOM_TARGET_PREFIX_DEFAULT}" CACHE STRING "Prefix for custom targets") - # build the wheel by re-using the shared library we build + # build the wheel by re-using the python module that we build add_custom_target(${WarpX_CUSTOM_TARGET_PREFIX}pip_wheel ${CMAKE_COMMAND} -E rm -f -r warpx-whl COMMAND - ${CMAKE_COMMAND} -E env PYWARPX_LIB_DIR=$ + ${CMAKE_COMMAND} -E env PYWARPX_LIB_DIR=$ python3 -m pip wheel -v --no-build-isolation --no-deps --wheel-dir=warpx-whl ${WarpX_SOURCE_DIR} WORKING_DIRECTORY ${WarpX_BINARY_DIR} DEPENDS - shared_${WarpX_DIMS_LAST} + ${pyWarpX_INSTALL_TARGET_NAMES} ) # this will also upgrade/downgrade dependencies, e.g., when the version of picmistandard changes @@ -500,6 +659,13 @@ if(WarpX_LIB) ${WarpX_BINARY_DIR} ) + # if we do a superbuild, make sure we install pyAMReX via its custom install + # target + set(_EXTRA_INSTALL_DEPENDS) + if(WarpX_pyamrex_internal OR WarpX_pyamrex_src) + set(_EXTRA_INSTALL_DEPENDS pyamrex_pip_install) + endif() + # We force-install because in development, it is likely that the version of # the package does not change, but the code did change. We need --no-deps, # because otherwise pip would also force reinstall all dependencies. @@ -509,9 +675,10 @@ if(WarpX_LIB) WORKING_DIRECTORY ${WarpX_BINARY_DIR} DEPENDS - shared_${WarpX_DIMS_LAST} + pyWarpX_${WarpX_DIMS_LAST} ${WarpX_CUSTOM_TARGET_PREFIX}pip_wheel ${WarpX_CUSTOM_TARGET_PREFIX}pip_install_requirements + ${_EXTRA_INSTALL_DEPENDS} ) endif() diff --git a/Docs/requirements.txt b/Docs/requirements.txt index 760a38e0cf8..1f21a414a19 100644 --- a/Docs/requirements.txt +++ b/Docs/requirements.txt @@ -11,13 +11,15 @@ docutils>=0.17.1 # PICMI API docs # note: keep in sync with version in ../requirements.txt -picmistandard==0.25.0 +picmistandard==0.26.0 # for development against an unreleased PICMI version, use: # picmistandard @ git+https://github.com/picmi-standard/picmi.git#subdirectory=PICMI_Python pygments recommonmark -sphinx>=5.3 +# Sphinx<7.2 because we are waiting for +# https://github.com/breathe-doc/breathe/issues/943 +sphinx>=5.3,<7.2 sphinx-copybutton sphinx-design sphinx_rtd_theme>=1.1.1 diff --git a/Docs/source/acknowledge_us.rst b/Docs/source/acknowledge_us.rst index 379a49dbb2e..2c0b1ce35f2 100644 --- a/Docs/source/acknowledge_us.rst +++ b/Docs/source/acknowledge_us.rst @@ -53,9 +53,15 @@ Prior WarpX references If your project uses a specific algorithm or component, please consider citing the respective publications in addition. +- Sandberg R T, Lehe R, Mitchell C E, Garten M, Qiang J, Vay J-L and Huebl A. + **Hybrid Beamline Element ML-Training for Surrogates in the ImpactX Beam-Dynamics Code**. + 14th International Particle Accelerator Conference (IPAC'23), WEPA101, *in print*, 2023. + `preprint `__, + `DOI:10.18429/JACoW-IPAC-23-WEPA101 `__ + - 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. **From Compact Plasma Particle Sources to Advanced Accelerators with Modeling at Exascale**. - Proceedings of the 20th Advanced Accelerator Concepts Workshop (AAC'22), *submitted* 2023. + Proceedings of the 20th Advanced Accelerator Concepts Workshop (AAC'22), *in print*, 2023. `arXiv:2303.12873 `__ - Huebl A, Lehe R, Mitchell C E, Qiang J, Ryne R D, Sandberg R T, Vay JL. diff --git a/Docs/source/conf.py b/Docs/source/conf.py index 4639ac10627..534cfd1e6b5 100644 --- a/Docs/source/conf.py +++ b/Docs/source/conf.py @@ -79,9 +79,9 @@ # built documents. # # The short X.Y version. -version = u'23.06' +version = u'23.08' # The full version, including alpha/beta/rc tags. -release = u'23.06' +release = u'23.08' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/Docs/source/dataanalysis/openpmdviewer.rst b/Docs/source/dataanalysis/openpmdviewer.rst index 5db1ebe368b..efb5acb4e50 100644 --- a/Docs/source/dataanalysis/openpmdviewer.rst +++ b/Docs/source/dataanalysis/openpmdviewer.rst @@ -65,4 +65,4 @@ by using the command: ts.slider() You can also access the particle and field data as numpy arrays with the methods ``ts.get_field`` and ``ts.get_particle``. -See the openPMD-viewer tutorials `here `_ for more info. +See the openPMD-viewer tutorials `here `_ for more info. diff --git a/Docs/source/developers/gnumake/python.rst b/Docs/source/developers/gnumake/python.rst index 09c84dfe552..543b80d5ddd 100644 --- a/Docs/source/developers/gnumake/python.rst +++ b/Docs/source/developers/gnumake/python.rst @@ -3,7 +3,7 @@ Installing WarpX as a Python package ==================================== -A full Python installation of WarpX can be done, which includes a build of all of the C++ code, or a pure Python version can be made which only installs the Python scripts. WarpX requires Pythone version 3.7 or newer. +A full Python installation of WarpX can be done, which includes a build of all of the C++ code, or a pure Python version can be made which only installs the Python scripts. WarpX requires Python version 3.8 or newer. For a full Python installation of WarpX --------------------------------------- diff --git a/Docs/source/developers/profiling.rst b/Docs/source/developers/profiling.rst index 5e15c584ecd..8fe68fac817 100644 --- a/Docs/source/developers/profiling.rst +++ b/Docs/source/developers/profiling.rst @@ -134,14 +134,9 @@ You can either run this on an interactive node or use the Slurm batch script hea rm -rf ${TMPDIR} profiling* mkdir -p ${TMPDIR} - # 2021.5.1 (broken: lacks most trace info) - #NSYS="/global/common/software/nersc/pm-2021q4/easybuild/software/Nsight-Systems/2021.5.1/bin/nsys" - # 2021.4.1 (working) - NSYS="/opt/nvidia/hpc_sdk/Linux_x86_64/21.11/compilers/bin/nsys" - # record srun --ntasks=4 --gpus=4 --cpu-bind=cores \ - ${NSYS} profile -f true \ + nsys profile -f true \ -o profiling_%q{SLURM_TASK_PID} \ -t mpi,cuda,nvtx,osrt,openmp \ --mpi-impl=mpich \ @@ -149,13 +144,6 @@ You can either run this on an interactive node or use the Slurm batch script hea inputs_3d \ warpx.numprocs=1 1 4 amr.n_cell=512 512 2048 max_step=10 -.. warning:: - - March 23rd, 2022 (INC0182505): - Currently, the environment pre-loads a ``Nsight-Systems/2021.5.1`` module that ships ``nsys`` version 2021.5.1. - This version does not record all trace information. - You need to use the one directly shipped with the NVHPC base system, version 2021.4.1, located in ``/opt/nvidia/hpc_sdk/Linux_x86_64/21.11/compilers/bin/nsys``. - .. note:: If everything went well, you will obtain as many output files named ``profiling_.nsys-rep`` as active MPI ranks. diff --git a/Docs/source/glossary.rst b/Docs/source/glossary.rst index 2f00198e42c..cb376af481f 100644 --- a/Docs/source/glossary.rst +++ b/Docs/source/glossary.rst @@ -22,12 +22,14 @@ Abbreviations * **CI:** continuous integration, automated tests that we perform before a proposed code-change is accepted; see PR * **CPU:** `central processing unit `__, we usual mean a socket or generally the host-side of a computer (compared to the accelerator, e.g. GPU) * **DOE:** `The United States Department of Energy `__, the largest sponsor of national laboratory research in the United States of America +* **DSMC:** `Direct Simulation Monte Carlo `__, a method to capture collisions between kinetic particles * **ECP:** `Exascale Computing Project `__, a :ref:`U.S. DOE funding source ` that supports WarpX development * **ECT:** `Enlarged Cell Technique `__, an electromagnetic solver with accurate resolution of perfectly conducting embedded boundaries * **EB:** embedded boundary, boundary conditions inside the simulation box, e.g. following material surfaces * **EM:** electromagnetic, e.g. EM PIC * **ES:** electrostatic, e.g. ES PIC * **FDTD:** `Finite-difference time-domain or Yee's method `__, a class of grid-based finite-difference field solvers +* **FRC:** `Field Reversed Configuration `__, an approach of magnetic confinement fusion * **GPU:** originally graphics processing unit, now used for fast `general purpose computing (GPGPU) `__; also called (hardware) accelerator * **IO:** input/output, usually files and/or data * **IPO:** `interprocedural optimization `__, a collection of compiler optimization techniques that analyze the whole code to avoid duplicate calculations and optimize performance @@ -36,7 +38,9 @@ Abbreviations * **LPI:** laser-plasma interaction (often for laser-solid physics) *or* laser-plasma instability (often in fusion physics), depending on context * **LTO:** `link-time optimization `__, program optimizations for file-by-file compilation that optimize object files before linking them together to an executable * **LWFA:** laser-wakefield acceleration (of electrons/leptons) +* **MCC:** Monte-Carlo collisions wherein a kinetic species collides with a fluid species, for example used in glow discharge simulations * **MR:** mesh-refinement +* **MS:** magnetostatic, e.g. MS PIC * **MVA:** magnetic-vortex acceleration (of protons/ions) * **NERSC:** `National Energy Research Scientific Computing Center `__, a supercomputing center located in Berkeley, CA (USA) * **NSF:** the `National Science Foundation `__, a large public agency in the United States of America, supporting research and education @@ -65,8 +69,11 @@ Terms * **evolve:** this is a generic term to advance a quantity (same nomenclature in AMReX). For instance, ``WarpX::EvolveE(dt)`` advances the electric field for duration ``dt``, ``PhysicalParticleContainer::Evolve(...)`` does field gather + particle push + current deposition for all particles in ``PhysicalParticleContainer``, and ``WarpX::EvolveEM`` is the central ``WarpX`` function that performs 1 PIC iteration. * **Frontier:** an `Exascale supercomputer at OLCF `__ +* **hybrid-PIC:** a plasma simulation scheme that combines fluid and kinetic approaches, with (usually) the electrons treated as a fluid and the ions as kinetic particles (see :ref:`theory-kinetic-fluid-hybrid-model`) * **laser:** most of the time, we mean a `laser pulse `__ -* **openPMD**: `Open Standard for Particle-Mesh Data Files `__, a community meta-data project for scientific data +* **openPMD:** `Open Standard for Particle-Mesh Data Files `__, a community meta-data project for scientific data +* **Ohm's law solver:** the logic that solves for the electric-field when using the hybrid-PIC algorithm * **Perlmutter:** a Berkeley Lab nobel laureate and a `Pre-Exascale supercomputer at NERSC `__ -* **plotfiles**: the internal binary format for data files in *AMReX* +* **plotfiles:** the internal binary format for data files in *AMReX* * **Python:** a popular scripted `programming language `__ +* **scraping:** a term often used to refer to the process of removing particles that have crossed into an embedded boundary or pass an absorbing domain boundary from the simulation diff --git a/Docs/source/highlights.rst b/Docs/source/highlights.rst index f2e12078d94..835c8985c10 100644 --- a/Docs/source/highlights.rst +++ b/Docs/source/highlights.rst @@ -14,6 +14,12 @@ Plasma-Based Acceleration Scientific works in laser-plasma and beam-plasma acceleration. +#. Sandberg R T, Lehe R, Mitchell C E, Garten M, Qiang J, Vay J-L, Huebl A. + **Hybrid Beamline Element ML-Training for Surrogates in the ImpactX Beam-Dynamics Code**. + 14th International Particle Accelerator Conference (IPAC'23), WEPA101, *in print*, 2023. + `preprint `__, + `DOI:10.18429/JACoW-IPAC-23-WEPA101 `__ + #. Wang J, Zeng M, Li D, Wang X, Gao J. **High quality beam produced by tightly focused laser driven wakefield accelerators**. arXiv pre-print, 2023. @@ -76,6 +82,18 @@ Particle Accelerator & Beam Physics Scientific works in particle and beam modeling. +#. Sandberg R T, Lehe R, Mitchell C E, Garten M, Qiang J, Vay J-L, Huebl A. + **Hybrid Beamline Element ML-Training for Surrogates in the ImpactX Beam-Dynamics Code**. + 14th International Particle Accelerator Conference (IPAC'23), WEPA101, *in print*, 2023. + `preprint `__, + `DOI:10.18429/JACoW-IPAC-23-WEPA101 `__ + +#. Tan W H, Piot P, Myers A, Zhang W, Rheaume T, Jambunathan R, Huebl A, Lehe R, Vay J-L. + **Simulation studies of drive-beam instability in a dielectric wakefield accelerator**. + 13th International Particle Accelerator Conference (IPAC'22), MOPOMS012, 2022. + `DOI:10.18429/JACoW-IPAC2022-MOPOMS012 `__ + + High Energy Astrophysical Plasma Physics **************************************** @@ -86,6 +104,7 @@ Scientific works in astrophysical plasma modeling. arXiv pre-print, 2023. `DOI:10.48550/arXiv.2304.10566 `__ + Microelectronics **************** diff --git a/Docs/source/index.rst b/Docs/source/index.rst index afcde99ca7f..2209b360e26 100644 --- a/Docs/source/index.rst +++ b/Docs/source/index.rst @@ -22,7 +22,7 @@ In addition, WarpX is also a *multi-platform code* and runs on Linux, macOS and Contact us ^^^^^^^^^^ -If you are starting using WarpX, or if you have a user question, please pop in our `Gitter chat room `__ and get in touch with the community. +If you are starting using WarpX, or if you have a user question, please pop in our `discussions page `__ and get in touch with the community. The `WarpX GitHub repo `__ is the main communication platform. Have a look at the action icons on the top right of the web page: feel free to watch the repo if you want to receive updates, or to star the repo to support the project. diff --git a/Docs/source/install/batch/pbs.rst b/Docs/source/install/batch/pbs.rst index 0ad0d64e680..072b0187c0e 100644 --- a/Docs/source/install/batch/pbs.rst +++ b/Docs/source/install/batch/pbs.rst @@ -1,7 +1,7 @@ Job Submission '''''''''''''' -* ``qsub your_job_script.pbs`` +* ``qsub your_job_script.qsub`` Job Control diff --git a/Docs/source/install/cmake.rst b/Docs/source/install/cmake.rst index 2ea731561aa..457a352b3c2 100644 --- a/Docs/source/install/cmake.rst +++ b/Docs/source/install/cmake.rst @@ -40,6 +40,7 @@ From the base of the WarpX source directory, execute: # find dependencies & configure # see additional options below, e.g. + # -DWarpX_PYTHON=ON # -DCMAKE_INSTALL_PREFIX=$HOME/sw/warpx cmake -S . -B build @@ -64,7 +65,7 @@ You can inspect and modify build options after running ``cmake -S . -B build`` w ccmake build or by adding arguments with ``-D