Skip to content

Commit d857b33

Browse files
fix conflict with WarpX
2 parents ca2a20c + 04d1809 commit d857b33

File tree

83 files changed

+1945
-872
lines changed

Some content is hidden

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

83 files changed

+1945
-872
lines changed

.github/workflows/dependencies/hip.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2020 The WarpX Community
4+
#
5+
# License: BSD-3-Clause-LBNL
6+
# Authors: Axel Huebl
7+
8+
# search recursive inside a folder if a file contains tabs
9+
#
10+
# @result 0 if no files are found, else 1
11+
#
12+
13+
set -eu -o pipefail
14+
15+
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
16+
wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key \
17+
| sudo apt-key add -
18+
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' \
19+
| sudo tee /etc/apt/sources.list.d/rocm.list
20+
21+
echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin' \
22+
| sudo tee -a /etc/profile.d/rocm.sh
23+
# we should not need to export HIP_PATH=/opt/rocm/hip with those installs
24+
25+
sudo apt-get update
26+
27+
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#installing-development-packages-for-cross-compilation
28+
# meta-package: rocm-dkms
29+
# OpenCL: rocm-opencl
30+
# other: rocm-dev rocm-utils
31+
sudo apt-get install -y --no-install-recommends \
32+
build-essential \
33+
gfortran \
34+
libnuma-dev \
35+
libopenmpi-dev \
36+
openmpi-bin \
37+
rocm-dev \
38+
rocrand
39+
40+
# activate
41+
#
42+
source /etc/profile.d/rocm.sh
43+
hipcc --version
44+
45+
# cmake-easyinstall
46+
#
47+
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
48+
sudo chmod a+x /usr/local/bin/cmake-easyinstall
49+
export CEI_SUDO="sudo"

.github/workflows/source/wrongFileNameInExamples

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ do
1717
if [[ ${file:0:6 } != inputs ]] &&
1818
[[ ${file:0:12} != PICMI_inputs ]] &&
1919
[[ ${file:0:8 } != analysis ]] &&
20+
[[ ${file: -4} != yaml ]] &&
2021
[[ ${file:0:6 } != README ]]
2122
then
2223
files+=($file)
@@ -32,6 +33,7 @@ then
3233
echo " - inputs : for WarpX input files"
3334
echo " - PICMI_inputs : for PICMI-compliant input scripts"
3435
echo " - analysis : for scripts testing the accuracy of a test"
36+
echo " - *.yaml : for third-party input, e.g. Ascent in situ visualization"
3537
echo " - README : for readme files"
3638
echo ""
3739
echo "Please rename the file(s) to comply, or move to another folder"

.github/workflows/ubuntu.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ jobs:
100100
sudo apt-get install -y intel-oneapi-dpcpp-cpp-compiler intel-oneapi-mkl-devel
101101
set +e
102102
source /opt/intel/oneapi/setvars.sh
103-
source /opt/intel/oneapi/compiler/2021.1-beta08/env/vars.sh
104103
set -e
105104
git clone https://github.com/openPMD/openPMD-api.git
106105
mkdir openPMD-api/build
@@ -113,11 +112,30 @@ jobs:
113112
run: |
114113
set +e
115114
source /opt/intel/oneapi/setvars.sh
116-
source /opt/intel/oneapi/compiler/2021.1-beta08/env/vars.sh
117115
set -e
118116
export CXX=$(which dpcpp)
119117
export CC=$(which clang)
120118
121119
mkdir build_sp && cd build_sp
122120
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DWarpX_MPI=OFF -DWarpX_COMPUTE=DPCPP -DWarpX_OPENPMD=ON -DWarpX_openpmd_internal=OFF -DWarpX_PRECISION=single
123121
make -j 2
122+
123+
build_hip:
124+
name: HIP SP [Linux]
125+
runs-on: ubuntu-20.04
126+
steps:
127+
- uses: actions/checkout@v2
128+
- name: install dependencies
129+
shell: bash
130+
run: .github/workflows/dependencies/hip.sh
131+
- name: build WarpX
132+
shell: bash
133+
run: |
134+
source /etc/profile.d/rocm.sh
135+
hipcc --version
136+
export CXX=$(which hipcc)
137+
export CC=$(which hipcc)
138+
139+
mkdir build_sp && cd build_sp
140+
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DWarpX_MPI=ON -DWarpX_COMPUTE=HIP -DAMD_ARCH=gfx900 -DWarpX_OPENPMD=ON -DWarpX_PRECISION=single
141+
make -j 2

CMakeLists.txt

+11-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ if(CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1414
endif()
1515

1616

17+
# CMake policies ##############################################################
18+
#
19+
# CMake 3.18+: CMAKE_CUDA_ARCHITECTURES
20+
# https://cmake.org/cmake/help/latest/policy/CMP0104.html
21+
if(POLICY CMP0104)
22+
cmake_policy(SET CMP0104 OLD)
23+
endif()
24+
25+
1726
# CCache Support ##############################################################
1827
#
1928
# this is an optional tool that stores compiled object files; allows fast
@@ -54,8 +63,8 @@ if(NOT WarpX_PRECISION IN_LIST WarpX_PRECISION_VALUES)
5463
message(FATAL_ERROR "WarpX_PRECISION (${WarpX_PRECISION}) must be one of ${WarpX_PRECISION_VALUES}")
5564
endif()
5665

57-
set(WarpX_COMPUTE_VALUES NOACC OMP CUDA DPCPP) # HIP
58-
set(WarpX_COMPUTE OMP CACHE STRING "On-node, accelerated computing backend (NOACC/OMP/CUDA/DPCPP)")
66+
set(WarpX_COMPUTE_VALUES NOACC OMP CUDA DPCPP HIP)
67+
set(WarpX_COMPUTE OMP CACHE STRING "On-node, accelerated computing backend (NOACC/OMP/CUDA/DPCPP/HIP)")
5968
set_property(CACHE WarpX_COMPUTE PROPERTY STRINGS ${WarpX_COMPUTE_VALUES})
6069
if(NOT WarpX_COMPUTE IN_LIST WarpX_COMPUTE_VALUES)
6170
message(FATAL_ERROR "WarpX_PRECISION (${WarpX_COMPUTE}) must be one of ${WarpX_COMPUTE_VALUES}")

Docs/source/building/cmake.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ CMake Option Default & Values Descr
123123
============================= ============================================ =======================================================
124124
``CMAKE_BUILD_TYPE`` **RelWithDebInfo**/Release/Debug Type of build, symbols & optimizations
125125
``WarpX_ASCENT`` ON/**OFF** Ascent in situ visualization
126-
``WarpX_COMPUTE`` NOACC/**OMP**/CUDA/DPCPP On-node, accelerated computing backend
126+
``WarpX_COMPUTE`` NOACC/**OMP**/CUDA/DPCPP/HIP On-node, accelerated computing backend
127127
``WarpX_DIMS`` **3**/2/RZ Simulation dimensionality
128128
``WarpX_MPI`` **ON**/OFF Multi-node support (message-passing)
129129
``WarpX_MPI_THREAD_MULTIPLE`` **ON**/OFF MPI thread-multiple support, i.e. for ``async_io``

Docs/source/building/juwels.rst

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Juwels (JSC)
44
============
55

6+
.. note::
7+
8+
There's currently a bug when building WarpX on Juwels! WarpX does not compile on the latest version of the development branches of WarpX and AMReX.
9+
Below are the latest working commits. Please, checkout to those commits before compiling.
10+
If you need more recent features, select the specific commits with `git cherry-pick <commit hash>`
11+
* WarpX: a548b14e8108ab22294f85516c4e9ea8b1462703
12+
* AMReX: 21269eff092d0a03aff9269b1200c0e408fde90e
13+
614
The `Juwels supercomputer <https://www.fz-juelich.de/ias/jsc/EN/Expertise/Supercomputers/JUWELS/JUWELS_node.html>`_ is located at JSC.
715

816
See `this page <https://apps.fz-juelich.de/jsc/hps/juwels/quickintro.html>`_ for a quick introduction.

Docs/source/building/summit.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ Then, ``cd`` into the directory ``$HOME/src/warpx`` and use the following comman
134134

135135
.. code-block:: bash
136136
137-
make -j 16 COMP=gcc USE_GPU=TRUE USE_OPENPMD=TRUE
137+
mkdir -p build
138+
cd build
139+
cmake .. -DWarpX_OPENPMD=ON -DWarpX_DIMS=3 -DWarpX_COMPUTE=CUDA -DCMAKE_CUDA_ARCHITECTURES=70 -DCUDA_ARCH=7.0
140+
make -j 10
138141
139-
The other :ref:`general compile-time options <building-source>` apply as usual.
142+
The general :ref:`cmake compile-time options <building-cmake>` apply as usual.
140143

141144

142145
Running

Docs/source/running_cpp/parameters.rst

+21-4
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ Particle initialization
376376
precision within a reasonable time ; in that case, users can set a
377377
relaxed precision requirement through ``self_fields_required_precision``.
378378

379+
* ``<species_name>.self_fields_max_iters`` (`integer`, default: 200)
380+
Maximum number of iterations used for MLMG solver for initial space-charge
381+
fields calculation. In case if MLMG converges but fails to reach the desired
382+
``self_fields_required_precision``, this parameter may be increased.
383+
379384
* ``<species_name>.profile`` (`string`)
380385
Density profile for this species. The options are:
381386

@@ -1209,7 +1214,7 @@ Numerics and algorithms
12091214
This option guarantees charge conservation only when used in combination with ``psatd.periodic_single_box_fft=1``, namely for periodic single-box simulations with global FFTs without guard cells.
12101215
The implementation for domain decomposition with local FFTs over guard cells is planned but not yet completed.
12111216

1212-
* ``psatd.update_with_rho`` (`0` or `1`; default: `0`)
1217+
* ``psatd.update_with_rho`` (`0` or `1`)
12131218
If true, the update equation for the electric field is expressed in terms of both the current density and the charge density, namely :math:`\widehat{\boldsymbol{J}}^{\,n+1/2}`, :math:`\widehat\rho^{n}`, and :math:`\widehat\rho^{n+1}`.
12141219
If false, instead, the update equation for the electric field is expressed in terms of the current density :math:`\widehat{\boldsymbol{J}}^{\,n+1/2}` only.
12151220
If charge is expected to be conserved (by setting, for example, ``psatd.current_correction=1``), then the two formulations are expected to be equivalent.
@@ -1276,6 +1281,11 @@ Numerics and algorithms
12761281
12771282
The coefficients :math:`C`, :math:`S`, :math:`\theta`, :math:`\nu`, :math:`\chi_1`, :math:`\chi_2`, and :math:`\chi_3` are defined in (`Lehe et al, PRE 94, 2016 <https://doi.org/10.1103/PhysRevE.94.053305>`_).
12781283

1284+
The default value for ``psatd.update_with_rho`` is ``1`` if ``psatd.v_galilean`` is non-zero or
1285+
in RZ geometry and ``0`` otherwise.
1286+
1287+
Note that ``psatd.update_with_rho=0`` is not supported in RZ geometry.
1288+
12791289
* ``pstad.v_galilean`` (`3 floats`, in units of the speed of light; default `0. 0. 0.`)
12801290
Defines the galilean velocity.
12811291
Non-zero `v_galilean` activates Galilean algorithm, which suppresses the Numerical Cherenkov instability
@@ -1433,11 +1443,12 @@ In-situ capabilities can be used by turning on Sensei or Ascent (provided they a
14331443

14341444
* ``<diag_name>.fields_to_plot`` (list of `strings`, optional)
14351445
Fields written to output.
1436-
Possible values: ``Ex`` ``Ey`` ``Ez`` ``Bx`` ``By`` ``Bz`` ``jx`` ``jy`` ``jz`` ``part_per_cell`` ``rho`` ``F`` ``part_per_grid`` ``part_per_proc`` ``divE`` ``divB`` and ``rho_<species_name>``, where ``<species_name>`` must match the name of one of the available particle species.
1446+
Possible values: ``Ex`` ``Ey`` ``Ez`` ``Bx`` ``By`` ``Bz`` ``jx`` ``jy`` ``jz`` ``part_per_cell`` ``rho`` ``F`` ``part_per_grid`` ``divE`` ``divB`` and ``rho_<species_name>``, where ``<species_name>`` must match the name of one of the available particle species.
14371447
Default is ``<diag_name>.fields_to_plot = Ex Ey Ez Bx By Bz jx jy jz``.
1448+
Note that the fields are averaged on the cell centers before they are written to file.
14381449

14391450
* ``<diag_name>.plot_raw_fields`` (`0` or `1`) optional (default `0`)
1440-
By default, the fields written in the plot files are averaged on the nodes.
1451+
By default, the fields written in the plot files are averaged on the cell centers.
14411452
When ```warpx.plot_raw_fields`` is `1`, then the raw (i.e. unaveraged)
14421453
fields are also saved in the output files.
14431454
Only works with ``<diag_name>.format = plotfile``.
@@ -1462,7 +1473,10 @@ In-situ capabilities can be used by turning on Sensei or Ascent (provided they a
14621473
* ``<diag_name>.coarsening_ratio`` (list of `int`) optional (default `1 1 1`)
14631474
Reduce size of the field output by this ratio in each dimension.
14641475
(This is done by averaging the field over 1 or 2 points along each direction, depending on the staggering).
1465-
``plot_coarsening_ratio`` should be an integer divisor of ``blocking_factor``, defined in the :ref:`parallelization <parallelization_warpx>` section.
1476+
If ``blocking_factor`` and ``max_grid_size`` are used for the domain decomposition, as detailed in
1477+
the :ref:`parallelization <parallelization_warpx>` section, ``coarsening_ratio`` should be an integer
1478+
divisor of ``blocking_factor``. If ``warpx.numprocs`` is used instead, the total number of cells in a given
1479+
dimension must be a multiple of the ``coarsening_ratio`` multiplied by ``numprocs`` in that dimension.
14661480

14671481
* ``<diag_name>.file_prefix`` (`string`) optional (default `diags/plotfiles/plt`)
14681482
Root for output file names. Supports sub-directories.
@@ -1661,6 +1675,9 @@ Reduced Diagnostics
16611675
the maximum value of the norm :math:`|B|` of the magnetic field,
16621676
at mesh refinement levels from 0 to :math:`n`.
16631677

1678+
Note that the fields are averaged on the cell centers before their maximum values are
1679+
computed.
1680+
16641681
* ``ParticleNumber``
16651682
This type computes the total number of macroparticles in the simulation (for each species
16661683
and summed over all species). It can be useful in particular for simulations with creation

0 commit comments

Comments
 (0)