Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into add_thread_s…
Browse files Browse the repository at this point in the history
…anitizer
  • Loading branch information
lucafedeli88 committed Jul 18, 2024
2 parents 4981a61 + b58343a commit 5433aa2
Show file tree
Hide file tree
Showing 27 changed files with 136 additions and 968 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach 24.07 && cd -
cd ../amrex && git checkout --detach dcb9cc0383dcc71e38dee9070574e325a812f8bf && cd -
make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_FFT=TRUE USE_CCACHE=TRUE -j 4
ccache -s
Expand Down
23 changes: 19 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,19 @@ 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)
set(_WarpX_IPO_DEFAULT OFF)
set(_WarpX_PYTHON_IPO_DEFAULT ON)
if(DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
set(_WarpX_IPO_DEFAULT ${CMAKE_INTERPROCEDURAL_OPTIMIZATION})
set(_WarpX_PYTHON_IPO_DEFAULT ${CMAKE_INTERPROCEDURAL_OPTIMIZATION})
endif()
option(WarpX_IPO
"Compile WarpX with interprocedural optimization (will take more time)"
${_WarpX_IPO_DEFAULT}
)
option(WarpX_PYTHON_IPO
"Compile Python bindings with interprocedural optimization (IPO) / link-time optimization (LTO)"
ON
${_WarpX_PYTHON_IPO_DEFAULT}
)

set(pyWarpX_VERSION_INFO "" CACHE STRING
Expand Down Expand Up @@ -455,7 +464,7 @@ endif()

# Interprocedural optimization (IPO) / Link-Time Optimization (LTO)
if(WarpX_IPO)
enable_IPO("${_ALL_TARGETS}")
warpx_enable_IPO("${_ALL_TARGETS}")
endif()

# link dependencies
Expand Down Expand Up @@ -488,7 +497,13 @@ foreach(D IN LISTS WarpX_DIMS)
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)
if(DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
warpx_enable_IPO(pyWarpX_${SD})
else()
# conditionally defined target in pybind11
# https://github.com/pybind/pybind11/blob/v2.12.0/tools/pybind11Common.cmake#L397-L403
target_link_libraries(pyWarpX_${SD} PRIVATE pybind11::lto)
endif()
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion Docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ openpmd-viewer # for checksumAPI

# PICMI API docs
# note: keep in sync with version in ../requirements.txt
picmistandard==0.28.0
picmistandard==0.29.0
# for development against an unreleased PICMI version, use:
# picmistandard @ git+https://github.com/picmi-standard/picmi.git#subdirectory=PICMI_Python

Expand Down
8 changes: 4 additions & 4 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ Domain Boundary Conditions
* ``open``: For the electrostatic Poisson solver based on a Integrated Green Function method.

* ``boundary.potential_lo_x/y/z`` and ``boundary.potential_hi_x/y/z`` (default `0`)
Gives the value of the electric potential at the boundaries, for ``pec`` boundaries. With electrostatic solvers
Gives the value of the electric potential, in Volts, at the boundaries, for ``pec`` boundaries. With electrostatic solvers
(i.e., with ``warpx.do_electrostatic = ...``), this is used in order to compute the potential
in the simulation volume at each timestep. When using other solvers (e.g. Maxwell solver),
setting these variables will trigger an electrostatic solve at ``t=0``, to compute the initial
Expand Down Expand Up @@ -603,7 +603,7 @@ Whether the embedded boundary is defined with an analytical function or an STL f
additionally define the electric potential at the embedded boundary with an analytical function:

* ``warpx.eb_potential(x,y,z,t)`` (`string`)
Gives the value of the electric potential at the surface of the embedded boundary,
Gives the value of the electric potential, in Volts, at the surface of the embedded boundary,
as a function of `x`, `y`, `z` and `t`. With electrostatic solvers (i.e., with
``warpx.do_electrostatic = ...``), this is used in order to compute the potential
in the simulation volume at each timestep. When using other solvers (e.g. Maxwell solver),
Expand Down Expand Up @@ -1156,8 +1156,8 @@ Particle initialization
* ``gaussian_parse_momentum_function``: Gaussian momentum distribution where the mean and the standard deviation are given by functions of position in the input file.
Both are assumed to be non-relativistic.
The mean is the normalized momentum, :math:`u_m = \gamma v_m/c`.
The standard deviation is normalized, :math:`u_th = v_th/c`.
For example, this might be `u_th = sqrt(T*q_e/mass)/clight` given the temperature (in eV) and mass.
The standard deviation is normalized, :math:`u_{th} = v_{th}/c`.
For example, this might be ``u_th = sqrt(T*q_e/mass)/clight`` given the temperature (in eV) and mass.
It requires the following arguments:

* ``<species_name>.momentum_function_ux_m(x,y,z)``: mean :math:`u_{x}`
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/collision/analysis_collision_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
dim, species_name)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, fn, do_particles=False)
checksumAPI.evaluate_checksum(test_name, fn)
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@

sigma_th = 2.603e-18
error = np.abs(sigma-sigma_th)/sigma_th
tolerance = 1e-2
tolerance = 2e-2
print('error = ', error)
print('tolerance = ', tolerance)
assert error < tolerance

# Compare checksums with benchmark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# plasma simulations. Journal of Computational Physics, 388, pp.439-453.
# DOI: https://doi.org/10.1016/j.jcp.2019.03.020

warpx.random_seed = 1034958209

# algo
algo.particle_shape = 3

Expand Down
2 changes: 1 addition & 1 deletion Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
package_dir = {'pywarpx': 'pywarpx'},
description = """Wrapper of WarpX""",
package_data = package_data,
install_requires = ['numpy', 'picmistandard==0.28.0', 'periodictable'],
install_requires = ['numpy', 'picmistandard==0.29.0', 'periodictable'],
python_requires = '>=3.8',
zip_safe=False
)
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"lev=0": {
"rho": 0.0,
"rho_deuterium": 8203144355.71195,
"rho_helium3": 10.368009592276463
"rho_deuterium": 8203144355.767546,
"rho_helium3": 10.312416024595505
},
"neutron": {
"particle_momentum_x": 2.2543499835759282e-15,
"particle_momentum_y": 2.2526527390783875e-15,
"particle_momentum_z": 2.2619641737859965e-15,
"particle_position_x": 61.961041864660686,
"particle_position_y": 61.78141653674165,
"particle_position_z": 61.741022731492514,
"particle_weight": 505562702.7678892
"particle_momentum_x": 2.260586487910896e-15,
"particle_momentum_y": 2.2564723094408887e-15,
"particle_momentum_z": 2.263164930227645e-15,
"particle_position_x": 62.03084683414219,
"particle_position_y": 61.95011296352698,
"particle_position_z": 62.02404756675538,
"particle_weight": 502851860.91505826
},
"deuterium": {
"particle_momentum_x": 1.3370046499332103e-14,
"particle_momentum_y": 1.3364310231320824e-14,
"particle_momentum_z": 1.3372728873714894e-14,
"particle_position_x": 2560.1613417364665,
"particle_position_y": 2560.082464065988,
"particle_position_z": 2560.0018477161034,
"particle_weight": 7.999999989888742e+17
"particle_momentum_x": 1.3380470537895298e-14,
"particle_momentum_y": 1.3367685546044215e-14,
"particle_momentum_z": 1.3372922616599391e-14,
"particle_position_x": 2559.782513518522,
"particle_position_y": 2559.8747993471684,
"particle_position_z": 2560.2864832238383,
"particle_weight": 7.999999989942968e+17
},
"helium3": {
"particle_momentum_x": 2.2749239620327265e-15,
"particle_momentum_y": 2.268697031603961e-15,
"particle_momentum_z": 2.278045756364995e-15,
"particle_position_x": 61.961041864660686,
"particle_position_y": 61.78141653674165,
"particle_position_z": 61.741022731492514,
"particle_weight": 505562702.7678892
"particle_momentum_x": 2.278275200450756e-15,
"particle_momentum_y": 2.2738610200497133e-15,
"particle_momentum_z": 2.2792408973056887e-15,
"particle_position_x": 62.03084683414219,
"particle_position_y": 61.95011296352698,
"particle_position_z": 62.02404756675538,
"particle_weight": 502851860.91505826
}
}
}
12 changes: 6 additions & 6 deletions Regression/Checksum/benchmarks_json/collisionISO.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"jz": 0.0
},
"electron": {
"particle_momentum_x": 3.579130200773753e-19,
"particle_momentum_y": 3.5788119408700804e-19,
"particle_momentum_z": 3.584163522201744e-19,
"particle_position_x": 1.024188253213835,
"particle_position_y": 1.0238795904737117,
"particle_position_z": 1.02399735048655,
"particle_momentum_x": 3.579989064013309e-19,
"particle_momentum_y": 3.5822945977746767e-19,
"particle_momentum_z": 3.579753452653627e-19,
"particle_position_x": 1.0241322532163375,
"particle_position_y": 1.0238995904625479,
"particle_position_z": 1.02402135051502,
"particle_weight": 714240000000.0
}
}
22 changes: 20 additions & 2 deletions Regression/Checksum/benchmarks_json/collisionXYZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@
"Ex": 0.0,
"Ey": 0.0,
"Ez": 0.0,
"T_electron": 353384.4616461907,
"T_ion": 348277.2774202612
"T_electron": 353604.6247926339,
"T_ion": 347976.6168136309
},
"electron": {
"particle_momentum_x": 8.370755929299189e-19,
"particle_momentum_y": 8.228112213603589e-19,
"particle_momentum_z": 8.204295817378347e-19,
"particle_position_x": 21284971.94721422,
"particle_position_y": 21212829.42991966,
"particle_position_z": 21214774.536558084,
"particle_weight": 7.168263344048695e+28
},
"ion": {
"particle_momentum_x": 2.0074097598289766e-18,
"particle_momentum_y": 1.8203553942782305e-18,
"particle_momentum_z": 1.823420185235695e-18,
"particle_position_x": 21227192.857240494,
"particle_position_y": 21286501.692027714,
"particle_position_z": 21245587.6706009,
"particle_weight": 7.168263344048695e+28
}
}
2 changes: 1 addition & 1 deletion Regression/WarpX-GPU-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ emailBody = Check https://ccse.lbl.gov/pub/GpuRegressionTesting/WarpX/ for more

[AMReX]
dir = /home/regtester/git/amrex/
branch = 24.07
branch = dcb9cc0383dcc71e38dee9070574e325a812f8bf

[source]
dir = /home/regtester/git/WarpX
Expand Down
Loading

0 comments on commit 5433aa2

Please sign in to comment.