Skip to content

Commit

Permalink
Merge branch 'development' into dashboard/condense_redundant_code
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Jan 10, 2025
2 parents abe3ea0 + f68e03c commit 48ba3f9
Show file tree
Hide file tree
Showing 22 changed files with 152 additions and 40 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dependencies/hip-openmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ sudo apt-get install -y --no-install-recommends \
rocfft-dev \
rocprim-dev \
rocrand-dev \
rocsparse-dev \
hiprand-dev

# activate
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dependencies/nvcc11-openmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ sudo apt-get install -y \
cuda-nvml-dev-11-3 \
cuda-nvtx-11-3 \
libcufft-dev-11-3 \
libcurand-dev-11-3
libcurand-dev-11-3 \
libcusparse-dev-11-3
sudo ln -s cuda-11.3 /usr/local/cuda

# cmake-easyinstall
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,25 @@ jobs:
# https://github.com/actions/runner-images/issues/10004
CXXFLAGS: "/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR"
run: |
cmake -S fftw-3.3.10 -B build_fftw `
cmake -S fftw-3.3.10 `
-B build_fftw `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_TESTS=OFF `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DDISABLE_FORTRAN=ON
if(!$?) { Exit $LASTEXITCODE }
cmake --build build_fftw --config RelWithDebInfo --target install --parallel 4
if(!$?) { Exit $LASTEXITCODE }
cmake -S fftw-3.3.10 `
-B build_fftwf `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_TESTS=OFF `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DDISABLE_FORTRAN=ON `
-DENABLE_FLOAT=ON
if(!$?) { Exit $LASTEXITCODE }
cmake --build build_fftwf --config RelWithDebInfo --target install --parallel 4
if(!$?) { Exit $LASTEXITCODE }
cmake -S hdf5-hdf5-1_12_2 -B build_hdf5 `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
Expand Down Expand Up @@ -83,6 +94,7 @@ jobs:
CXXFLAGS: "/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR"
# FFTW3 install prefix path
FFTW3_DIR: "C:/Program Files (x86)/fftw/"
FFTW3f_DIR: "C:/Program Files (x86)/fftw/"
run: |
$env:HDF5_DIR = "C:/Program Files/HDF_Group/HDF5/1.12.2/cmake/"
cmake -S . -B build `
Expand Down Expand Up @@ -159,6 +171,17 @@ jobs:
if errorlevel 1 exit 1
cmake --build build_fftw --config Release --target install --parallel 4
if errorlevel 1 exit 1
cmake -S fftw-3.3.10 ^
-B build_fftwf ^
-G "Ninja" ^
-DBUILD_TESTS=OFF ^
-DBUILD_SHARED_LIBS=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DDISABLE_FORTRAN=ON ^
-DENABLE_FLOAT=ON
if errorlevel 1 exit 1
cmake --build build_fftwf --config Release --target install --parallel 4
if errorlevel 1 exit 1
cmake -S hdf5-hdf5-1_12_2 -B build_hdf5 ^
-G "Ninja" ^
Expand Down Expand Up @@ -191,6 +214,7 @@ jobs:
env:
# FFTW3 install prefix path
FFTW3_DIR: "C:/Program Files (x86)/fftw/"
FFTW3f_DIR: "C:/Program Files (x86)/fftw/"
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
Expand Down
4 changes: 2 additions & 2 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.12)
project(ImpactX VERSION 25.01)

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

Expand Down Expand Up @@ -265,7 +265,7 @@ if(ImpactX_PYTHON)
impactx_enable_IPO(pyImpactX)
else()
# conditionally defined target in pybind11
# https://github.com/pybind/pybind11/blob/v2.12.0/tools/pybind11Common.cmake#L397-L403
# https://github.com/pybind/pybind11/blob/v2.13.0/tools/pybind11Common.cmake#L407-L413
target_link_libraries(pyImpactX PRIVATE pybind11::lto)
endif()
endif()
Expand Down
7 changes: 4 additions & 3 deletions cmake/dependencies/ABLASTR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ macro(find_ablastr)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

set(ABLASTR_FFT ${ImpactX_FFT} CACHE BOOL "" FORCE)
set(AMReX_FFT ${ImpactX_FFT} CACHE BOOL "" FORCE)

set(WarpX_APP OFF CACHE BOOL "" FORCE)
set(WarpX_LIB OFF CACHE BOOL "" FORCE)
Expand Down Expand Up @@ -127,7 +128,7 @@ macro(find_ablastr)
set(COMPONENT_DIM 3D)
set(COMPONENT_PRECISION ${ImpactX_PRECISION} P${ImpactX_PRECISION})

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

Expand Down Expand Up @@ -161,15 +162,15 @@ 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 "24.10"
set(ImpactX_ablastr_branch "25.01"
CACHE STRING
"Repository branch for ImpactX_ablastr_repo if(ImpactX_ablastr_internal)")

# AMReX is transitively pulled through ABLASTR
set(ImpactX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
CACHE STRING
"Repository URI to pull and build AMReX from if(ImpactX_amrex_internal)")
set(ImpactX_amrex_branch "e64ffef57a7608d1d60f9abe738cc634e9c1272e"
set(ImpactX_amrex_branch "041f225dc5c97a5e3baf2559046ceabffd75f002"
CACHE STRING
"Repository branch for ImpactX_amrex_repo if(ImpactX_amrex_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.10 CONFIG REQUIRED)
find_package(pyAMReX 25.01 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 "8742a79c29b7db30c7287c8e33109c0d8be1277a"
set(ImpactX_pyamrex_branch "25.01"
CACHE STRING
"Repository branch for ImpactX_pyamrex_repo if(ImpactX_pyamrex_internal)")

Expand Down
4 changes: 2 additions & 2 deletions cmake/dependencies/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function(find_pybind11)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_FETCHEDpybind11)
endif()
else()
find_package(pybind11 2.12.0 CONFIG REQUIRED)
find_package(pybind11 2.13.0 CONFIG REQUIRED)
message(STATUS "pybind11: Found version '${pybind11_VERSION}'")
endif()
endfunction()
Expand All @@ -52,7 +52,7 @@ option(ImpactX_pybind11_internal "Download & build pybind11" ON)
set(ImpactX_pybind11_repo "https://github.com/pybind/pybind11.git"
CACHE STRING
"Repository URI to pull and build pybind11 from if(ImpactX_pybind11_internal)")
set(ImpactX_pybind11_branch "v2.12.0"
set(ImpactX_pybind11_branch "v2.13.6"
CACHE STRING
"Repository branch for ImpactX_pybind11_repo if(ImpactX_pybind11_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.12"
version = "25.01"
# The full version, including alpha/beta/rc tags.
release = "24.12"
release = "25.01"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/install/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Optional dependencies include:
- see `optional I/O backends <https://github.com/openPMD/openPMD-api#dependencies>`__
- `CCache <https://ccache.dev>`__: to speed up rebuilds (For CUDA support, needs version 3.7.9+ and 4.2+ is recommended)
- `Ninja <https://ninja-build.org>`__: for faster parallel compiles
- `Python 3.8+ <https://www.python.org>`__
- `Python 3.9+ <https://www.python.org>`__

- `mpi4py <https://mpi4py.readthedocs.io>`__
- `numpy <https://numpy.org>`__
Expand Down
2 changes: 1 addition & 1 deletion docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ Overall simulation parameters
* ``amrex.the_arena_is_managed`` (``0`` or ``1``; default is ``0`` for false)
When running on GPUs, device memory that is accessed from the host will automatically be transferred with managed memory.
This is useful for convenience during development, but has sometimes severe performance and memory footprint implications if relied on (and sometimes vendor bugs).
For all regular ImpactX operations, we therefore do explicit memory transfers without the need for managed memory and thus changed the AMReX default to false.
For all regular ImpactX operations, we therefore do explicit memory transfers without the need for managed memory.
`Please also see the documentation in AMReX <https://amrex-codes.github.io/amrex/docs_html/GPU.html#inputs-parameters>`__.

* ``amrex.omp_threads`` (``system``, ``nosmt`` or positive integer; default is ``nosmt``)
Expand Down
3 changes: 0 additions & 3 deletions examples/aperture/input_aperture.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ collimator.shape = rectangular
collimator.xmax = 1.0e-3
collimator.ymax = 1.5e-3

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
amrex.the_arena_is_managed = 1


###############################################################################
# Algorithms
Expand Down
5 changes: 0 additions & 5 deletions examples/aperture/run_absorber.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
#
# -*- coding: utf-8 -*-

import amrex.space3d as amr
from impactx import ImpactX, distribution, elements

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
pp_amrex = amr.ParmParse("amrex")
pp_amrex.add("the_arena_is_managed", 1)

sim = ImpactX()

# set numerical parameters and IO control
Expand Down
5 changes: 0 additions & 5 deletions examples/aperture/run_aperture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
#
# -*- coding: utf-8 -*-

import amrex.space3d as amr
from impactx import ImpactX, distribution, elements

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
pp_amrex = amr.ParmParse("amrex")
pp_amrex.add("the_arena_is_managed", 1)

sim = ImpactX()

# set numerical parameters and IO control
Expand Down
5 changes: 0 additions & 5 deletions examples/aperture/run_aperture_periodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@
#
# -*- coding: utf-8 -*-

import amrex.space3d as amr
from impactx import ImpactX, distribution, elements

# work-around for https://github.com/ECP-WarpX/impactx/issues/499
pp_amrex = amr.ParmParse("amrex")
pp_amrex.add("the_arena_is_managed", 1)

sim = ImpactX()

# set numerical parameters and IO control
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def build_extension(self, ext):
setup(
name="impactx",
# note PEP-440 syntax: x.y.zaN but x.y.z.devN
version="24.12",
version="25.01",
packages=["impactx"],
# Python sources:
package_dir={"": "src/python"},
Expand Down Expand Up @@ -260,7 +260,7 @@ def build_extension(self, ext):
ext_modules=cxx_modules,
cmdclass=cmdclass,
zip_safe=False,
python_requires=">=3.8",
python_requires=">=3.8", # left for CI, truly ">=3.9"
tests_require=["numpy", "pandas", "pytest", "scipy"],
install_requires=install_requires,
# cmdclass={'test': PyTest},
Expand All @@ -278,10 +278,11 @@ def build_extension(self, ext):
"Topic :: Software Development :: Libraries",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
(
"License :: OSI Approved :: " "BSD License"
), # TODO: use real SPDX: BSD-3-Clause-LBNL
Expand Down
2 changes: 2 additions & 0 deletions src/particles/spacecharge/PoissonSolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ namespace impactx::spacecharge
sorted_phi.emplace_back(&phi[lev]);
}

const bool is_igf_2d = false;
const bool do_single_precision_comms = false;
const bool eb_enabled = false;
ablastr::fields::computePhi(
Expand All @@ -95,6 +96,7 @@ namespace impactx::spacecharge
pc.GetParGDB()->boxArray(),
ablastr::utils::enums::GridType::Collocated,
is_solver_igf_on_lev0,
is_igf_2d,
eb_enabled,
do_single_precision_comms,
rel_ref_ratio
Expand Down
2 changes: 1 addition & 1 deletion src/python/impactx/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ __author__: str = (
"Axel Huebl, Chad Mitchell, Ryan Sandberg, Marco Garten, Ji Qiang, et al."
)
__license__: str = "BSD-3-Clause-LBNL"
__version__: str = "24.12"
__version__: str = "25.01"
s: impactx_pybind.CoordSystem # value = <CoordSystem.s: 0>
t: impactx_pybind.CoordSystem # value = <CoordSystem.t: 1>
cxx = impactx_pybind
16 changes: 15 additions & 1 deletion src/python/impactx/impactx_pybind/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Config:
have_gpu: typing.ClassVar[bool] = False
have_mpi: typing.ClassVar[bool] = True
have_omp: typing.ClassVar[bool] = True
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...

class CoordSystem:
"""
Expand All @@ -61,6 +63,8 @@ class CoordSystem:
] # value = {'s': <CoordSystem.s: 0>, 't': <CoordSystem.t: 1>}
s: typing.ClassVar[CoordSystem] # value = <CoordSystem.s: 0>
t: typing.ClassVar[CoordSystem] # value = <CoordSystem.t: 1>
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...
def __eq__(self, other: typing.Any) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
Expand All @@ -77,6 +81,8 @@ class CoordSystem:
def value(self) -> int: ...

class ImpactX:
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...
def DistributionMap(
self, lev: int
) -> amrex.space3d.amrex_3d_pybind.DistributionMapping: ...
Expand Down Expand Up @@ -371,6 +377,8 @@ class ImpactX:
class ImpactXParConstIter(
amrex.space3d.amrex_3d_pybind.ParConstIter_pureSoA_8_0_default
):
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...
@typing.overload
def __init__(
self,
Expand Down Expand Up @@ -399,6 +407,8 @@ class ImpactXParConstIter(
"""

class ImpactXParIter(amrex.space3d.amrex_3d_pybind.ParIter_pureSoA_8_0_default):
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...
@typing.overload
def __init__(
self,
Expand Down Expand Up @@ -431,6 +441,8 @@ class ImpactXParticleContainer(
):
const_iterator = ImpactXParConstIter
iterator = ImpactXParIter
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...
def add_n_particles(
self,
x: amrex.space3d.amrex_3d_pybind.PODVector_real_std,
Expand Down Expand Up @@ -525,6 +537,8 @@ class ImpactXParticleContainer(
"""

class RefPart:
@staticmethod
def _pybind11_conduit_v1_(*args, **kwargs): ...
@staticmethod
def load_file(ref: RefPart, madx_file):
"""
Expand Down Expand Up @@ -720,6 +734,6 @@ __author__: str = (
"Axel Huebl, Chad Mitchell, Ryan Sandberg, Marco Garten, Ji Qiang, et al."
)
__license__: str = "BSD-3-Clause-LBNL"
__version__: str = "24.12"
__version__: str = "25.01"
s: CoordSystem # value = <CoordSystem.s: 0>
t: CoordSystem # value = <CoordSystem.t: 1>
Loading

0 comments on commit 48ba3f9

Please sign in to comment.