Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/development' into csr_python_p…
Browse files Browse the repository at this point in the history
…lot_test
  • Loading branch information
ax3l committed Oct 10, 2024
2 parents be5c705 + 48bb008 commit e82838c
Show file tree
Hide file tree
Showing 158 changed files with 4,156 additions and 1,358 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,29 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.x'

- name: Install Packages
run: |
sudo apt-get update
sudo apt-get install --yes cmake openmpi-bin libfftw3-dev libfftw3-mpi-dev libopenmpi-dev libhdf5-openmpi-dev
python -m pip install --upgrade pip
python -m pip install --upgrade pipx
python -m pip install --upgrade wheel
python -m pip install --upgrade cmake
export CMAKE="$HOME/.local/bin/cmake" && echo "CMAKE=$CMAKE" >> $GITHUB_ENV
python -m pip install --upgrade numpy
python -m pip install --upgrade mpi4py
python -m pip install --upgrade pytest
python -m pip install --upgrade cmake
python -m pipx install cmake
- name: Configure (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
$CMAKE -S . -B build -DImpactX_FFT=ON -DImpactX_PYTHON=OFF
cmake -S . -B build -DImpactX_FFT=ON -DImpactX_PYTHON=OFF
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand All @@ -64,7 +70,7 @@ jobs:
- name: Build (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
$CMAKE --build build -j 4
cmake --build build -j 4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
25 changes: 9 additions & 16 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE
steps:
- uses: actions/checkout@v4
- name: install dependencies
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.x'
- name: install brew dependencies
run: |
set +e
brew unlink gcc
brew update
brew install --overwrite python
brew install adios2
brew install ccache
brew install cmake
Expand All @@ -32,19 +35,15 @@ jobs:
brew install ninja
brew install open-mpi
brew install pkg-config
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade virtualenv
python3 -m venv py-venv
source py-venv/bin/activate
set -e
- name: install pip dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build packaging setuptools wheel pytest
python3 -m pip install --upgrade -r requirements_mpi.txt
python3 -m pip install --upgrade -r src/python/impactx/dashboard/requirements.txt
python3 -m pip install --upgrade -r examples/requirements.txt
python3 -m pip install --upgrade -r tests/python/requirements.txt
set -e
python3 -m pip install --upgrade pipx
python3 -m pipx install openPMD-validator
- name: CCache Cache
Expand All @@ -65,29 +64,23 @@ jobs:
export CCACHE_SLOPPINESS=time_macros
ccache -z
source py-venv/bin/activate
cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DImpactX_FFT=ON \
-DImpactX_PYTHON=ON \
-DPython_EXECUTABLE=$(which python3)
-DImpactX_PYTHON=ON
cmake --build build -j 3
du -hs ~/Library/Caches/ccache
ccache -s
- name: run tests
run: |
source py-venv/bin/activate
ctest --test-dir build --output-on-failure -E pytest.AMReX
- name: run installed python module
run: |
cmake --build build --target pip_install
source py-venv/bin/activate
python3 examples/fodo/run_fodo.py
- name: run installed app
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
Expand Down Expand Up @@ -66,7 +66,7 @@ repos:
# Python: Ruff linter & formatter
# https://docs.astral.sh/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.3
rev: v0.6.9
hooks:
# Run the linter
- id: ruff
Expand Down
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Preamble ####################################################################
#
cmake_minimum_required(VERSION 3.24.0)
project(ImpactX VERSION 24.08)
project(ImpactX VERSION 24.09)

include(${ImpactX_SOURCE_DIR}/cmake/ImpactXFunctions.cmake)

Expand Down Expand Up @@ -394,9 +394,9 @@ install(CODE "file(CREATE_LINK
#
if(ImpactX_PYTHON)
set(PY_PIP_OPTIONS "-v" CACHE STRING
"Additional parameters to pass to `pip`")
"Additional parameters to pass to `pip` as ; separated list")
set(PY_PIP_INSTALL_OPTIONS "" CACHE STRING
"Additional parameters to pass to `pip install`")
"Additional parameters to pass to `pip install` as ; separated list")

# add a prefix to custom targets so we do not collide if used as a subproject
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
Expand All @@ -412,7 +412,8 @@ if(ImpactX_PYTHON)
${CMAKE_COMMAND} -E rm -f -r impactx-whl
COMMAND
${CMAKE_COMMAND} -E env PYIMPACTX_LIBDIR=$<TARGET_FILE_DIR:pyImpactX>
${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} wheel --no-build-isolation --no-deps --wheel-dir=impactx-whl ${ImpactX_SOURCE_DIR}
${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} wheel --no-build-isolation --no-deps --wheel-dir=impactx-whl "${ImpactX_SOURCE_DIR}"
COMMAND_EXPAND_LISTS VERBATIM
WORKING_DIRECTORY
${ImpactX_BINARY_DIR}
DEPENDS
Expand All @@ -427,6 +428,7 @@ if(ImpactX_PYTHON)
endif()
add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install_requirements
${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} install ${PY_PIP_INSTALL_OPTIONS} -r "${ImpactX_SOURCE_DIR}/${pyImpactX_REQUIREMENT_FILE}"
COMMAND_EXPAND_LISTS VERBATIM
WORKING_DIRECTORY
${ImpactX_BINARY_DIR}
)
Expand All @@ -444,6 +446,7 @@ if(ImpactX_PYTHON)
add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install
${CMAKE_COMMAND} -E env IMPACTX_MPI=${ImpactX_MPI}
${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} install --force-reinstall --no-index --no-deps ${PY_PIP_INSTALL_OPTIONS} --find-links=impactx-whl impactx
COMMAND_EXPAND_LISTS VERBATIM
WORKING_DIRECTORY
${ImpactX_BINARY_DIR}
DEPENDS
Expand All @@ -456,6 +459,7 @@ if(ImpactX_PYTHON)
add_custom_target(${ImpactX_CUSTOM_TARGET_PREFIX}pip_install_nodeps
${CMAKE_COMMAND} -E env IMPACTX_MPI=${ImpactX_MPI}
${Python_EXECUTABLE} -m pip ${PY_PIP_OPTIONS} install --force-reinstall --no-index --no-deps ${PY_PIP_INSTALL_OPTIONS} --find-links=impactx-whl impactx
COMMAND_EXPAND_LISTS VERBATIM
WORKING_DIRECTORY
${ImpactX_BINARY_DIR}
DEPENDS
Expand Down
4 changes: 2 additions & 2 deletions cmake/dependencies/ABLASTR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ macro(find_ablastr)
set(COMPONENT_DIM 3D)
set(COMPONENT_PRECISION ${ImpactX_PRECISION} P${ImpactX_PRECISION})

find_package(ABLASTR 24.08 CONFIG REQUIRED COMPONENTS ${COMPONENT_DIM})
find_package(ABLASTR 24.09 CONFIG REQUIRED COMPONENTS ${COMPONENT_DIM})
message(STATUS "ABLASTR: Found version '${ABLASTR_VERSION}'")
endif()

Expand Down Expand Up @@ -161,7 +161,7 @@ set(ImpactX_openpmd_src ""
set(ImpactX_ablastr_repo "https://github.com/ECP-WarpX/WarpX.git"
CACHE STRING
"Repository URI to pull and build ABLASTR from if(ImpactX_ablastr_internal)")
set(ImpactX_ablastr_branch "0838941a6693df711769a90a8a989c9a920b0abe"
set(ImpactX_ablastr_branch "d1a338e90ed1ad7ac2f010f47409aa48a2265c88"
CACHE STRING
"Repository branch for ImpactX_ablastr_repo if(ImpactX_ablastr_internal)")

Expand Down
4 changes: 2 additions & 2 deletions cmake/dependencies/pyAMReX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function(find_pyamrex)
endif()
elseif(NOT ImpactX_pyamrex_internal)
# TODO: MPI control
find_package(pyAMReX 24.08 CONFIG REQUIRED)
find_package(pyAMReX 24.09 CONFIG REQUIRED)
message(STATUS "pyAMReX: Found version '${pyAMReX_VERSION}'")
endif()
endfunction()
Expand All @@ -74,7 +74,7 @@ option(ImpactX_pyamrex_internal "Download & build pyAMReX" ON)
set(ImpactX_pyamrex_repo "https://github.com/AMReX-Codes/pyamrex.git"
CACHE STRING
"Repository URI to pull and build pyamrex from if(ImpactX_pyamrex_internal)")
set(ImpactX_pyamrex_branch "abdf332e25bfeef2b4d613d7adbe93fb8cf3e2f7"
set(ImpactX_pyamrex_branch "1c66690f83244196c5655293f1381303a7d1589d"
CACHE STRING
"Repository branch for ImpactX_pyamrex_repo if(ImpactX_pyamrex_internal)")

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
# built documents.
#
# The short X.Y version.
version = "24.08"
version = "24.09"
# The full version, including alpha/beta/rc tags.
release = "24.08"
release = "24.09"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
7 changes: 6 additions & 1 deletion docs/source/dataanalysis/dataanalysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ The code writes out the values in an ASCII file prefixed ``reduced_beam_characte
* ``sig_px``, ``sig_py``, ``sig_pt``
Standard deviation of the particle momentum deviations (energy difference for ``pt``) normalized by the magnitude of the reference particle momentum (unit: dimensionless)
* ``emittance_x``, ``emittance_y``, ``emittance_t``
Normalized rms beam emittance (unit: meter)
Unnormalized rms beam emittances (unit: meter)
* ``alpha_x``, ``alpha_y``, ``alpha_t``
Courant-Snyder (Twiss) alpha (unit: dimensionless). Transverse Twiss functions are calculated after removing correlations with particle energy.
* ``beta_x``, ``beta_y``, ``beta_t``
Expand All @@ -93,6 +93,11 @@ The code writes out the values in an ASCII file prefixed ``reduced_beam_characte
Horizontal and vertical dispersion (unit: meter)
* ``dispersion_px``, ``dispersion_py``
Derivative of horizontal and vertical dispersion (unit: dimensionless)
* ``emittance_xn``, ``emittance_yn``, ``emittance_tn``
Normalized rms beam emittances (unit: meter)
* ``emittance_1``, ``emittance_2``, ``emittance_3``
Normalized rms beam eigenemittances (aka mode emittances) (unit: meter)
These three diagnostics are written optionally if the flag eigenemittances = True.
* ``charge``
Total beam charge (unit: Coulomb)

Expand Down
4 changes: 2 additions & 2 deletions docs/source/install/cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ CMake Option Default & Values Des
``ImpactX_PRECISION`` SINGLE/**DOUBLE** Floating point precision (single/double)
``ImpactX_PYTHON`` ON/**OFF** Python bindings
``Python_EXECUTABLE`` (newest found) Path to Python executable
``PY_PIP_OPTIONS`` ``-v`` Additional options for ``pip``, e.g., ``-vvv``
``PY_PIP_INSTALL_OPTIONS`` Additional options for ``pip install``, e.g., ``--user``
``PY_PIP_OPTIONS`` ``-v`` Additional options for ``pip``, e.g., ``-vvv;-q``
``PY_PIP_INSTALL_OPTIONS`` Additional options for ``pip install``, e.g., ``--user;-q``
=============================== ============================================ ===========================================================

ImpactX can be configured in further detail with options from AMReX, which are `documented in the AMReX manual <https://amrex-codes.github.io/amrex/docs_html/BuildingAMReX.html#customization-options>`_.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#export proj="project_..."

# required dependencies
module load LUMI/23.09 partition/C
module load LUMI/24.03 partition/C
module load PrgEnv-aocc
module load buildtools/23.09
module load cray-fftw/3.3.10.5
module load buildtools/24.03
module load cray-fftw/3.3.10.7

# optional: just an additional text editor
module load nano
Expand All @@ -19,7 +19,7 @@ export PATH=${SW_DIR}/adios2-2.8.3/bin:${PATH}
export PATH=${SW_DIR}/hdf5-1.14.1.2/bin:${PATH}

# optional: for Python bindings or libEnsemble
module load cray-python/3.10.10
module load cray-python/3.11.7

if [ -d "${SW_DIR}/venvs/impactx-cpu-lumi" ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#export proj="project_..."

# required dependencies
module load LUMI/23.09 partition/G
module load rocm/5.2.3
module load buildtools/23.09
module load LUMI/24.03 partition/G
module load rocm/6.0.3
module load buildtools/24.03

# optional: just an additional text editor
module load nano
Expand All @@ -18,7 +18,7 @@ export PATH=${SW_DIR}/adios2-2.8.3/bin:${PATH}
export PATH=${SW_DIR}/hdf5-1.14.1.2/bin:${PATH}

# optional: for Python bindings or libEnsemble
module load cray-python/3.10.10
module load cray-python/3.11.7

if [ -d "${SW_DIR}/venvs/impactx-gpu-lumi" ]
then
Expand Down
12 changes: 12 additions & 0 deletions docs/source/usage/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Single Particle Dynamics
examples/achromatic_spectrometer/README.rst
examples/fodo_programmable/README.rst
examples/dogleg/README.rst
examples/coupled_optics/README.rst


Collective Effects
------------------
Expand Down Expand Up @@ -70,6 +72,16 @@ Beam Distributions

examples/distgen/README


Channels & Rings
----------------

.. toctree::
:maxdepth: 1

examples/fodo_channel/README.rst


Lattice Design & Optimization
-----------------------------

Expand Down
Loading

0 comments on commit e82838c

Please sign in to comment.