Skip to content

Commit

Permalink
Merge branch 'development' into fix_insulator_BC_time
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgrote committed Dec 6, 2024
2 parents 793059b + a310309 commit dbf3af8
Show file tree
Hide file tree
Showing 23 changed files with 76 additions and 62 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/clang_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ concurrency:
jobs:
build_UB_sanitizer:
name: Clang UB sanitizer
runs-on: ubuntu-22.04
container: ubuntu:23.10
runs-on: ubuntu-24.04
if: github.event.pull_request.draft == false
env:
CC: clang
Expand Down Expand Up @@ -65,10 +64,6 @@ jobs:
- name: run with UB sanitizer
run: |
# We need these two lines because these tests run inside a docker container
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
export OMP_NUM_THREADS=2
#MPI implementations often leak memory
Expand All @@ -81,9 +76,9 @@ jobs:
build_thread_sanitizer:
name: Clang thread sanitizer
runs-on: ubuntu-22.04
container: ubuntu:23.10
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04
# TODO Fix data race conditions and re-enable job
if: 0 #github.event.pull_request.draft == false
env:
CC: clang
CXX: clang++
Expand Down Expand Up @@ -149,10 +144,6 @@ jobs:
export TSAN_OPTIONS='ignore_noninstrumented_modules=1'
export ARCHER_OPTIONS="verbose=1"
# We need these two lines because these tests run inside a docker container
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
export OMP_NUM_THREADS=2
mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
which nvcc || echo "nvcc not in PATH!"
git clone https://github.com/AMReX-Codes/amrex.git ../amrex
cd ../amrex && git checkout --detach 456c93c7d9512f1cdffac0574973d7df41417898 && cd -
cd ../amrex && git checkout --detach 24.12 && 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
5 changes: 0 additions & 5 deletions .github/workflows/dependencies/clang17.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

set -eu -o pipefail

# This dependency file is currently used within a docker container,
# which does not come with sudo.
apt-get -qqq update
apt-get -y install sudo

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
# Python: Ruff linter & formatter
# https://docs.astral.sh/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.1
hooks:
# Run the linter
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion 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(WarpX VERSION 24.11)
project(WarpX VERSION 24.12)

include(${WarpX_SOURCE_DIR}/cmake/WarpXFunctions.cmake)

Expand Down
4 changes: 2 additions & 2 deletions Docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ def __init__(self, *args, **kwargs):
# built documents.
#
# The short X.Y version.
version = "24.11"
version = "24.12"
# The full version, including alpha/beta/rc tags.
release = "24.11"
release = "24.12"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
21 changes: 13 additions & 8 deletions Docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3589,22 +3589,27 @@ This shifts analysis from post-processing to runtime calculation of reduction op
* ``Timestep``
This type outputs the simulation's physical timestep (in seconds) at each mesh refinement level.

* ``<reduced_diags_name>.intervals`` (`string`)
* ``reduced_diags.intervals`` (`string`)
Using the `Intervals Parser`_ syntax, this string defines the timesteps at which reduced
diagnostics are written to file.
diagnostics are written to the file.
This can also be specified for the specific diagnostic by setting ``<reduced_diags_name>.intervals``.

* ``<reduced_diags_name>.path`` (`string`) optional (default `./diags/reducedfiles/`)
The path that the output file will be stored.
* ``reduced_diags.path`` (`string`) optional (default `./diags/reducedfiles/`)
The path where the output file will be stored.
This can also be specified for the specific diagnostic by setting ``<reduced_diags_name>.path``.

* ``<reduced_diags_name>.extension`` (`string`) optional (default `txt`)
The extension of the output file.
* ``reduced_diags.extension`` (`string`) optional (default `txt`)
The extension of the output file (the suffix).
This can also be specified for the specific diagnostic by setting ``<reduced_diags_name>.extension``.

* ``<reduced_diags_name>.separator`` (`string`) optional (default a `whitespace`)
* ``reduced_diags.separator`` (`string`) optional (default a `whitespace`)
The separator between row values in the output file.
The default separator is a whitespace.
This can also be specified for the specific diagnostic by setting ``<reduced_diags_name>.separator``.

* ``<reduced_diags_name>.precision`` (`integer`) optional (default `14`)
* ``reduced_diags.precision`` (`integer`) optional (default `14`)
The precision used when writing out the data to the text files.
This can also be specified for the specific diagnostic by setting ``<reduced_diags_name>.precision``.

Lookup tables and other settings for QED modules
------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@
histuH_rdiag = picmi.ReducedDiagnostic(
diag_type="ParticleHistogram",
name="histuH",
period=100,
species=hydrogen,
bin_number=1000,
bin_min=0.0,
Expand All @@ -208,7 +207,6 @@
histue_rdiag = picmi.ReducedDiagnostic(
diag_type="ParticleHistogram",
name="histue",
period=100,
species=electrons,
bin_number=1000,
bin_min=0.0,
Expand All @@ -222,7 +220,6 @@
histuzAll_rdiag = picmi.ReducedDiagnostic(
diag_type="ParticleHistogram",
name="histuzAll",
period=100,
species=hydrogen,
bin_number=1000,
bin_min=-0.474,
Expand All @@ -233,7 +230,6 @@
field_probe_z_rdiag = picmi.ReducedDiagnostic(
diag_type="FieldProbe",
name="FieldProbe_Z",
period=100,
integrate=0,
probe_geometry="Line",
x_probe=0.0,
Expand All @@ -246,7 +242,6 @@
field_probe_scat_point_rdiag = picmi.ReducedDiagnostic(
diag_type="FieldProbe",
name="FieldProbe_ScatPoint",
period=1,
integrate=0,
probe_geometry="Point",
x_probe=0.0,
Expand All @@ -256,7 +251,6 @@
field_probe_scat_line_rdiag = picmi.ReducedDiagnostic(
diag_type="FieldProbe",
name="FieldProbe_ScatLine",
period=100,
integrate=1,
probe_geometry="Line",
x_probe=-2.5e-6,
Expand All @@ -267,7 +261,8 @@
)

load_balance_costs_rdiag = picmi.ReducedDiagnostic(
diag_type="LoadBalanceCosts", name="LBC", period=100
diag_type="LoadBalanceCosts",
name="LBC",
)

# Set up simulation
Expand All @@ -278,6 +273,7 @@
particle_shape="cubic",
warpx_numprocs=[1, 2], # deactivate `numprocs` for dynamic load balancing
warpx_use_filter=1,
warpx_reduced_diags_intervals=100,
warpx_load_balance_intervals=100,
warpx_load_balance_costs_update="heuristic",
)
Expand Down
3 changes: 1 addition & 2 deletions Examples/Tests/implicit/inputs_test_1d_semi_implicit_picard
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ diag1.electrons.variables = z w ux uy uz
diag1.protons.variables = z w ux uy uz

warpx.reduced_diags_names = particle_energy field_energy
reduced_diags.intervals = 1
particle_energy.type = ParticleEnergy
particle_energy.intervals = 1
field_energy.type = FieldEnergy
field_energy.intervals = 1
3 changes: 1 addition & 2 deletions Examples/Tests/implicit/inputs_test_1d_theta_implicit_picard
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ diag1.electrons.variables = z w ux uy uz
diag1.protons.variables = z w ux uy uz

warpx.reduced_diags_names = particle_energy field_energy
reduced_diags.intervals = 1
particle_energy.type = ParticleEnergy
particle_energy.intervals = 1
field_energy.type = FieldEnergy
field_energy.intervals = 1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ diag1.electrons.variables = x z w ux uy uz
diag1.protons.variables = x z w ux uy uz

warpx.reduced_diags_names = particle_energy field_energy
reduced_diags.intervals = 1
particle_energy.type = ParticleEnergy
particle_energy.intervals = 1
field_energy.type = FieldEnergy
field_energy.intervals = 1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ diag1.electrons.variables = x z w ux uy uz
diag1.protons.variables = x z w ux uy uz

warpx.reduced_diags_names = particle_energy field_energy
reduced_diags.intervals = 1
particle_energy.type = ParticleEnergy
particle_energy.intervals = 1
field_energy.type = FieldEnergy
field_energy.intervals = 1
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ diag1.electrons.variables = x z w ux uy uz
diag1.protons.variables = x z w ux uy uz

warpx.reduced_diags_names = particle_energy field_energy
reduced_diags.intervals = 1
particle_energy.type = ParticleEnergy
particle_energy.intervals = 1
field_energy.type = FieldEnergy
field_energy.intervals = 1
30 changes: 29 additions & 1 deletion Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2770,6 +2770,21 @@ class Simulation(picmistandard.PICMI_Simulation):
warpx_used_inputs_file: string, optional
The name of the text file that the used input parameters is written to,
warpx_reduced_diags_path: string, optional
Sets the default path for reduced diagnostic output files
warpx_reduced_diags_extension: string, optional
Sets the default extension for reduced diagnostic output files
warpx_reduced_diags_intervals: string, optional
Sets the default intervals for reduced diagnostic output files
warpx_reduced_diags_separator: string, optional
Sets the default separator for reduced diagnostic output files
warpx_reduced_diags_precision: integer, optional
Sets the default precision for reduced diagnostic output files
"""

# Set the C++ WarpX interface (see _libwarpx.LibWarpX) as an extension to
Expand Down Expand Up @@ -2836,6 +2851,12 @@ def init(self, kw):
self.checkpoint_signals = kw.pop("warpx_checkpoint_signals", None)
self.numprocs = kw.pop("warpx_numprocs", None)

self.reduced_diags_path = kw.pop("warpx_reduced_diags_path", None)
self.reduced_diags_extension = kw.pop("warpx_reduced_diags_extension", None)
self.reduced_diags_intervals = kw.pop("warpx_reduced_diags_intervals", None)
self.reduced_diags_separator = kw.pop("warpx_reduced_diags_separator", None)
self.reduced_diags_precision = kw.pop("warpx_reduced_diags_precision", None)

self.inputs_initialized = False
self.warpx_initialized = False

Expand Down Expand Up @@ -2902,6 +2923,13 @@ def initialize_inputs(self):

pywarpx.warpx.numprocs = self.numprocs

reduced_diags = pywarpx.warpx.get_bucket("reduced_diags")
reduced_diags.path = self.reduced_diags_path
reduced_diags.extension = self.reduced_diags_extension
reduced_diags.intervals = self.reduced_diags_intervals
reduced_diags.separator = self.reduced_diags_separator
reduced_diags.precision = self.reduced_diags_precision

particle_shape = self.particle_shape
for s in self.species:
if s.particle_shape is not None:
Expand Down Expand Up @@ -3943,7 +3971,7 @@ def __init__(
self,
diag_type,
name=None,
period=1,
period=None,
path=None,
extension=None,
separator=None,
Expand Down
2 changes: 1 addition & 1 deletion Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

setup(
name="pywarpx",
version="24.11",
version="24.12",
packages=["pywarpx"],
package_dir={"pywarpx": "pywarpx"},
description="""Wrapper of WarpX""",
Expand Down
8 changes: 7 additions & 1 deletion Source/Diagnostics/ReducedDiags/ReducedDiags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ m_rd_name{rd_name}
{
BackwardCompatibility();

const ParmParse pp_rd("reduced_diags");
const ParmParse pp_rd_name(m_rd_name);

// read path
pp_rd.query("path", m_path);
pp_rd_name.query("path", m_path);

// read extension
pp_rd.query("extension", m_extension);
pp_rd_name.query("extension", m_extension);

// check if it is a restart run
Expand Down Expand Up @@ -61,13 +64,16 @@ m_rd_name{rd_name}

// read reduced diags intervals
std::vector<std::string> intervals_string_vec = {"1"};
pp_rd_name.getarr("intervals", intervals_string_vec);
pp_rd.queryarr("intervals", intervals_string_vec);
pp_rd_name.queryarr("intervals", intervals_string_vec);
m_intervals = utils::parser::IntervalsParser(intervals_string_vec);

// read separator
pp_rd.query("separator", m_sep);
pp_rd_name.query("separator", m_sep);

// precision of data in the output file
utils::parser::queryWithParser(pp_rd, "precision", m_precision);
utils::parser::queryWithParser(pp_rd_name, "precision", m_precision);
}
// end constructor
Expand Down
2 changes: 0 additions & 2 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -1597,8 +1597,6 @@ private:
*/
void HandleParticlesAtBoundaries (int step, amrex::Real cur_time, int num_moved);

void ScrapeParticles ();

/** Update the E and B fields in the explicit em PIC scheme.
*
* At the beginning, we have B^{n} and E^{n}.
Expand Down
4 changes: 2 additions & 2 deletions Tools/PostProcessing/read_raw_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _read_field(raw_file, field_name):
f.seek(offset)
if header.version == 1:
f.readline() # skip the first line
arr = np.fromfile(f, "float64", np.product(shape))
arr = np.fromfile(f, "float64", np.prod(shape))
arr = arr.reshape(shape, order="F")
box_shape = [slice(low, hig + 1) for low, hig in zip(lo, hi)]
if header.ncomp > 1:
Expand All @@ -225,7 +225,7 @@ def _read_buffer(snapshot, header_fn, _component_names):
lo = box[0] - dom_lo
hi = box[1] - dom_lo
shape = hi - lo + 1
size = np.product(shape)
size = np.prod(shape)
with open(snapshot + "/Level_0/" + fn, "rb") as f:
f.seek(offset)
if header.version == 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module load cmake/3.24.3
module load cray-fftw/3.3.10.6

# optional: for QED support with detailed tables
export BOOST_ROOT=/global/common/software/spackecp/perlmutter/e4s-23.05/default/spack/opt/spack/linux-sles15-zen3/gcc-11.2.0/boost-1.82.0-ow5r5qrgslcwu33grygouajmuluzuzv3
export BOOST_ROOT=/global/common/software/spackecp/perlmutter/e4s-23.08/default/spack/opt/spack/linux-sles15-zen3/gcc-12.3.0/boost-1.83.0-nxqk3hnci5g3wqv75wvsmuke3w74mzxi

# optional: for openPMD and PSATD+RZ support
module load cray-hdf5-parallel/1.12.2.9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module load cudatoolkit
module load cmake/3.24.3

# optional: for QED support with detailed tables
export BOOST_ROOT=/global/common/software/spackecp/perlmutter/e4s-23.05/default/spack/opt/spack/linux-sles15-zen3/gcc-11.2.0/boost-1.82.0-ow5r5qrgslcwu33grygouajmuluzuzv3
export BOOST_ROOT=/global/common/software/spackecp/perlmutter/e4s-23.08/default/spack/opt/spack/linux-sles15-zen3/gcc-12.3.0/boost-1.83.0-nxqk3hnci5g3wqv75wvsmuke3w74mzxi

# optional: for openPMD and PSATD+RZ support
module load cray-hdf5-parallel/1.12.2.9
Expand Down
Loading

0 comments on commit dbf3af8

Please sign in to comment.