diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index a7cd884039b..e4967bea790 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -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 96db0a665ff1e6bbe638490fd02d3aafb9188f6b && cd - + cd ../amrex && git checkout --detach b3f67385e62f387b548389222840486c0fffca57 && 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 diff --git a/.github/workflows/dependencies/hip.sh b/.github/workflows/dependencies/hip.sh index 1154bb05e58..bf15c2f7101 100755 --- a/.github/workflows/dependencies/hip.sh +++ b/.github/workflows/dependencies/hip.sh @@ -53,6 +53,7 @@ sudo apt-get install -y --no-install-recommends \ rocm-dev \ rocfft-dev \ rocprim-dev \ + rocsparse-dev \ rocrand-dev \ hiprand-dev diff --git a/.github/workflows/dependencies/nvcc11-3.sh b/.github/workflows/dependencies/nvcc11-3.sh index 92e2717e425..050b58b5947 100755 --- a/.github/workflows/dependencies/nvcc11-3.sh +++ b/.github/workflows/dependencies/nvcc11-3.sh @@ -41,7 +41,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 # if we run out of temporary storage in CI: diff --git a/.github/workflows/dependencies/nvcc11-8.sh b/.github/workflows/dependencies/nvcc11-8.sh index 6089360392b..608f6c7a817 100755 --- a/.github/workflows/dependencies/nvcc11-8.sh +++ b/.github/workflows/dependencies/nvcc11-8.sh @@ -41,7 +41,8 @@ sudo apt-get install -y \ cuda-nvml-dev-11-8 \ cuda-nvtx-11-8 \ libcufft-dev-11-8 \ - libcurand-dev-11-8 + libcurand-dev-11-8 \ + libcusparse-dev-11-8 sudo ln -s cuda-11.8 /usr/local/cuda # if we run out of temporary storage in CI: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fffc41ce264..7c396c95b1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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.8.2 + rev: v0.8.3 hooks: # Run the linter - id: ruff diff --git a/Docs/source/developers/testing.rst b/Docs/source/developers/testing.rst index 111e3e7d7cb..57194b54642 100644 --- a/Docs/source/developers/testing.rst +++ b/Docs/source/developers/testing.rst @@ -140,8 +140,8 @@ A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as 1 # dims 2 # nprocs inputs_test_1d_laser_acceleration # inputs - analysis.py # analysis - diags/diag1000100 # output (plotfile) + "analysis.py diags/diag1000100" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -154,8 +154,8 @@ A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as 2 # dims 2 # nprocs inputs_test_2d_laser_acceleration_picmi.py # inputs - analysis.py # analysis - diags/diag1000100 # output (plotfile) + "analysis.py diags/diag1000100" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -168,14 +168,14 @@ A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as 3 # dims 2 # nprocs inputs_test_3d_laser_acceleration_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000100 # output (plotfile) + "analysis_default_restart.py diags/diag1000100" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum test_3d_laser_acceleration # dependency ) Note that the restart has an explicit dependency, namely it can run only provided that the original test, from which the restart checkpoint files will be read, runs first. -* A more complex example. Add the **PICMI test** ``test_rz_laser_acceleration_picmi``, with custom command-line arguments ``--test`` and ``dir``, and openPMD time series output: +* A more complex example. Add the **PICMI test** ``test_rz_laser_acceleration_picmi``, with custom command-line arguments ``--test`` and ``dir``, openPMD time series output, and custom command line arguments for the checksum comparison: .. code-block:: cmake @@ -184,11 +184,13 @@ A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as RZ # dims 2 # nprocs "inputs_test_rz_laser_acceleration_picmi.py --test --dir 1" # inputs - analysis.py # analysis - diags/diag1/ # output (openPMD time series) + "analysis.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/ --skip-particles --rtol 1e-7" # checksum OFF # dependency ) +The ``analysis`` and ``checksum`` commands passed as arguments to ``add_warpx_test`` can be set to ``OFF`` if the intention is to skip the respective analysis for a given test. + If you need a new Python package dependency for testing, please add it in `Regression/requirements.txt `__. Sometimes two or more tests share a large number of input parameters. @@ -196,6 +198,24 @@ The shared input parameters can be collected in a "base" input file that can be If the new test is added in a new directory that did not exist before, please add the name of that directory with the command ``add_subdirectory`` in `Physics_applications/CMakeLists.txt `__ or `Tests/CMakeLists.txt `__, depending on where the new test directory is located. +If not already present, the default regression analysis script ``analysis_default_regression.py`` in the examples above must be linked from `Examples/analysis_default_regression.py `__, by executing once the following command from the test directory: + + .. code-block:: bash + + ln -s ../../analysis_default_regression.py analysis_default_regression.py + +Here is the help message of the default regression analysis script, including usage and list of available options and arguments: + + .. code-block:: bash + + usage: analysis_default_regression.py [-h] [--path PATH] [--rtol RTOL] [--skip-fields] [--skip-particles] + options: + -h, --help show this help message and exit + --path PATH path to output file(s) + --rtol RTOL relative tolerance to compare checksums + --skip-fields skip fields when comparing checksums + --skip-particles skip particles when comparing checksums + Naming conventions for automated tests -------------------------------------- diff --git a/Docs/source/install/hpc/dane.rst b/Docs/source/install/hpc/dane.rst index e9af32130f5..2e0efc99391 100644 --- a/Docs/source/install/hpc/dane.rst +++ b/Docs/source/install/hpc/dane.rst @@ -24,18 +24,19 @@ If you are new to this system, **please see the following resources**: Preparation ----------- -Use the following commands to download the WarpX source code: +Use the following commands to download the WarpX source code. +Note that these commands and the shell scripts all assume the bash shell. .. code-block:: bash - git clone https://github.com/ECP-WarpX/WarpX.git $HOME/src/warpx + git clone https://github.com/ECP-WarpX/WarpX.git /usr/workspace/${USER}/dane/src/warpx We use system software modules, add environment hints and further dependencies via the file ``$HOME/dane_warpx.profile``. Create it now: .. code-block:: bash - cp $HOME/src/warpx/Tools/machines/dane-llnl/dane_warpx.profile.example $HOME/dane_warpx.profile + cp /usr/workspace/${USER}/dane/src/warpx/Tools/machines/dane-llnl/dane_warpx.profile.example $HOME/dane_warpx.profile .. dropdown:: Script Details :color: light @@ -67,7 +68,7 @@ Finally, since Dane does not yet provide software modules for some of our depend .. code-block:: bash - bash $HOME/src/warpx/Tools/machines/dane-llnl/install_dependencies.sh + bash /usr/workspace/${USER}/dane/src/warpx/Tools/machines/dane-llnl/install_dependencies.sh source /usr/workspace/${USER}/dane/venvs/warpx-dane/bin/activate .. dropdown:: Script Details @@ -88,13 +89,13 @@ Use the following :ref:`cmake commands ` to compile the applicat .. code-block:: bash - cd $HOME/src/warpx + cd /usr/workspace/${USER}/dane/src/warpx rm -rf build_dane cmake -S . -B build_dane -DWarpX_FFT=ON -DWarpX_QED_TABLE_GEN=ON -DWarpX_DIMS="1;2;RZ;3" cmake --build build_dane -j 6 -The WarpX application executables are now in ``$HOME/src/warpx/build_dane/bin/``. +The WarpX application executables are now in ``/usr/workspace/${USER}/dane/src/warpx/build_dane/bin/``. Additionally, the following commands will install WarpX as a Python module: .. code-block:: bash @@ -118,7 +119,7 @@ If you already installed WarpX in the past and want to update it, start by getti .. code-block:: bash - cd $HOME/src/warpx + cd /usr/workspace/${USER}/dane/src/warpx # read the output of this command - does it look ok? git status @@ -137,7 +138,7 @@ And, if needed, - log out and into the system, activate the now updated environment profile as usual, - :ref:`execute the dependency install scripts `. -As a last step, clean the build directory ``rm -rf $HOME/src/warpx/build_dane`` and rebuild WarpX. +As a last step, clean the build directory ``rm -rf /usr/workspace/${USER}/dane/src/warpx/build_dane`` and rebuild WarpX. .. _running-cpp-dane: diff --git a/Docs/source/usage/parameters.rst b/Docs/source/usage/parameters.rst index 3787acbd639..31f0e06ab5b 100644 --- a/Docs/source/usage/parameters.rst +++ b/Docs/source/usage/parameters.rst @@ -290,6 +290,21 @@ Overall simulation parameters In electromagnetic mode, this solver can be used to initialize the species' self fields (``.initialize_self_fields=1``) provided that the field BCs are PML (``boundary.field_lo,hi = PML``). + * ``warpx.use_2d_slices_fft_solver`` (`bool`) optional (default: 0): Select the type of Integrated Green Function solver. + If 0, solve Poisson equation in full 3D geometry. + If 1, solve Poisson equation in a quasi 3D geometry, neglecting the :math:`z` derivatives in the Laplacian of the Poisson equation. + In practice, in this case, the code performes many 2D Poisson solves on all :math:`(x,y)` slices, each slice at a given :math:`z`. + This is often a good approximation for ultra-relativistic beams propagating along the :math:`z` direction, with the relativistic solver. + As a consequence, this solver does not need to do an FFT along the :math:`z` direction, + and instead uses only transverse FFTs (along :math:`x` and :math:`y`) at each :math:`z` position (or :math:`z` "slice"). + + * ``ablastr.nprocs_igf_fft`` (`int`) optional (default: number of MPI ranks): Number of MPI ranks used to parallalelize the FFT solver. + This can be less or equal than then number of MPI ranks that are used to run the overall simulation. + It can be useful if the auxiliary simulation boxes fit within a single process, so to avoid extra communications. + The auxiliary boxes are extended boxes in real and spectral space that are used to perform the necessary FFTs. + The extended simulation box size in real space is :math:`2n_x-1, 2n_y-1, 2n_z-1` with the 3D solver, :math:`2n_x-1, 2n_y -1, n_z` with the 2D solver. + The extended simulation box size in spectral space is :math:`n_x, 2n_y-1, 2n_z-1` with the 3D solver, :math:`n_x, 2n_y-1, n_z` with the 2D solver. + * ``warpx.self_fields_required_precision`` (`float`, default: 1.e-11) The relative precision with which the electrostatic space-charge fields should be calculated. More specifically, the space-charge fields are diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index 728c2142932..c4303aaee0b 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -21,8 +21,8 @@ endif() # dims: 1,2,RZ,3 # nprocs: 1 or 2 (maybe refactor later on to just depend on WarpX_MPI) # inputs: inputs file or PICMI script, WarpX_MPI decides w/ or w/o MPI -# analysis: analysis script, always run without MPI -# output: output file(s) to analyze +# analysis: custom test analysis command, always run without MPI +# checksum: default regression analysis command (checksum benchmark) # dependency: name of base test that must run first # function(add_warpx_test @@ -31,7 +31,7 @@ function(add_warpx_test nprocs inputs analysis - output + checksum dependency ) # cannot run MPI tests w/o MPI build @@ -72,14 +72,25 @@ function(add_warpx_test separate_arguments(ANALYSIS_LIST UNIX_COMMAND "${analysis}") list(GET ANALYSIS_LIST 0 ANALYSIS_FILE) cmake_path(SET ANALYSIS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${ANALYSIS_FILE}") - # TODO Enable lines below to handle command-line arguments - #list(LENGTH ANALYSIS_LIST ANALYSIS_LIST_LENGTH) - #if(ANALYSIS_LIST_LENGTH GREATER 1) - # list(SUBLIST ANALYSIS_LIST 1 -1 ANALYSIS_ARGS) - # list(JOIN ANALYSIS_ARGS " " ANALYSIS_ARGS) - #else() - # set(ANALYSIS_ARGS "") - #endif() + list(LENGTH ANALYSIS_LIST ANALYSIS_LIST_LENGTH) + if(ANALYSIS_LIST_LENGTH GREATER 1) + list(SUBLIST ANALYSIS_LIST 1 -1 ANALYSIS_ARGS) + list(JOIN ANALYSIS_ARGS " " ANALYSIS_ARGS) + else() + set(ANALYSIS_ARGS "") + endif() + + # get checksum script and optional command-line arguments + separate_arguments(CHECKSUM_LIST UNIX_COMMAND "${checksum}") + list(GET CHECKSUM_LIST 0 CHECKSUM_FILE) + cmake_path(SET CHECKSUM_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${CHECKSUM_FILE}") + list(LENGTH CHECKSUM_LIST CHECKSUM_LIST_LENGTH) + if(CHECKSUM_LIST_LENGTH GREATER 1) + list(SUBLIST CHECKSUM_LIST 1 -1 CHECKSUM_ARGS) + list(JOIN CHECKSUM_ARGS " " CHECKSUM_ARGS) + else() + set(CHECKSUM_ARGS "") + endif() # Python test? set(python OFF) @@ -175,11 +186,14 @@ function(add_warpx_test # test analysis if(analysis) + # for argparse, do not pass command-line arguments as one quoted string + separate_arguments(ANALYSIS_ARGS UNIX_COMMAND "${ANALYSIS_ARGS}") add_test( NAME ${name}.analysis COMMAND - ${THIS_Python_SCRIPT_EXE} ${ANALYSIS_FILE} - ${output} + ${THIS_Python_SCRIPT_EXE} + ${ANALYSIS_FILE} + ${ANALYSIS_ARGS} WORKING_DIRECTORY ${THIS_WORKING_DIR} ) # test analysis depends on test run @@ -187,13 +201,37 @@ function(add_warpx_test # FIXME Use helper function to handle Windows exceptions set(PYTHONPATH "$ENV{PYTHONPATH}:${CMAKE_PYTHON_OUTPUT_DIRECTORY}") # add paths for custom Python modules - set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Regression/Checksum") set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Regression/PostProcessingUtils") set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Tools/Parser") set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Tools/PostProcessing") set_property(TEST ${name}.analysis APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${PYTHONPATH}") endif() + # checksum analysis + if(checksum) + # for argparse, do not pass command-line arguments as one quoted string + separate_arguments(CHECKSUM_ARGS UNIX_COMMAND "${CHECKSUM_ARGS}") + add_test( + NAME ${name}.checksum + COMMAND + ${THIS_Python_SCRIPT_EXE} + ${CHECKSUM_FILE} + ${CHECKSUM_ARGS} + WORKING_DIRECTORY ${THIS_WORKING_DIR} + ) + # test analysis depends on test run + set_property(TEST ${name}.checksum APPEND PROPERTY DEPENDS "${name}.run") + if(analysis) + # checksum analysis depends on test analysis + set_property(TEST ${name}.checksum APPEND PROPERTY DEPENDS "${name}.analysis") + endif() + # FIXME Use helper function to handle Windows exceptions + set(PYTHONPATH "$ENV{PYTHONPATH}:${CMAKE_PYTHON_OUTPUT_DIRECTORY}") + # add paths for custom Python modules + set(PYTHONPATH "${PYTHONPATH}:${WarpX_SOURCE_DIR}/Regression/Checksum") + set_property(TEST ${name}.checksum APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${PYTHONPATH}") + endif() + # CI: remove test directory after run if(WarpX_TEST_CLEANUP) add_test( @@ -206,6 +244,10 @@ function(add_warpx_test # test cleanup depends on test analysis set_property(TEST ${name}.cleanup APPEND PROPERTY DEPENDS "${name}.analysis") endif() + if(checksum) + # test cleanup depends on test analysis + set_property(TEST ${name}.cleanup APPEND PROPERTY DEPENDS "${name}.checksum") + endif() endif() # Do we depend on another test? @@ -215,6 +257,9 @@ function(add_warpx_test if(analysis) set_property(TEST ${name}.run APPEND PROPERTY DEPENDS "${dependency}.analysis") endif() + if(checksum) + set_property(TEST ${name}.run APPEND PROPERTY DEPENDS "${dependency}.checksum") + endif() if(WarpX_TEST_CLEANUP) # do not clean up dependency test before current test is completed set_property(TEST ${dependency}.cleanup APPEND PROPERTY DEPENDS "${name}.cleanup") diff --git a/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt b/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt index 09e96f04d7f..fbdb6dd221f 100644 --- a/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt +++ b/Examples/Physics_applications/beam_beam_collision/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_beam_beam_collision # inputs - analysis_default_openpmd_regression.py # analysis - diags/diag1/ # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) label_warpx_test(test_3d_beam_beam_collision slow) diff --git a/Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py b/Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py deleted file mode 120000 index 73e5ec47001..00000000000 --- a/Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py +++ /dev/null @@ -1 +0,0 @@ -../../analysis_default_openpmd_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/beam_beam_collision/analysis_default_regression.py b/Examples/Physics_applications/beam_beam_collision/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/beam_beam_collision/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt b/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt index 5af1d0a0664..5403e374849 100644 --- a/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt +++ b/Examples/Physics_applications/capacitive_discharge/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs "inputs_base_1d_picmi.py --test --pythonsolver" # inputs - analysis_1d.py # analysis - diags/diag1000050 # output + "analysis_1d.py" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 1 # dims 2 # nprocs "inputs_base_1d_picmi.py --test --dsmc" # inputs - analysis_dsmc.py # analysis - diags/diag1000050 # output + "analysis_dsmc.py" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) @@ -26,19 +26,19 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_background_mcc # inputs - analysis_default_regression.py # analysis - diags/diag1000050 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) -# FIXME: can we make this a single precision for now? +# FIXME: can we make this single precision for now? #add_warpx_test( # test_2d_background_mcc_dp_psp # name # 2 # dims # 2 # nprocs -## inputs_test_2d_background_mcc_dp_psp # inputs -# analysis_default_regression.py # analysis -# diags/diag1000050 # output +# inputs_test_2d_background_mcc_dp_psp # inputs +# OFF # analysis +# "analysis_default_regression.py --path diags/diag1000050" # checksum # OFF # dependency #) @@ -47,7 +47,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_background_mcc_picmi.py # inputs - analysis_2d.py # analysis - diags/diag1000050 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000050 --rtol 5e-3" # checksum OFF # dependency ) diff --git a/Examples/Physics_applications/capacitive_discharge/analysis_1d.py b/Examples/Physics_applications/capacitive_discharge/analysis_1d.py index e9043e5dc01..82d98c38210 100755 --- a/Examples/Physics_applications/capacitive_discharge/analysis_1d.py +++ b/Examples/Physics_applications/capacitive_discharge/analysis_1d.py @@ -2,14 +2,8 @@ # Copyright 2022 Modern Electron, David Grote -import os -import sys - import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # fmt: off ref_density = np.array([ 1.27989677e+14, 2.23601330e+14, 2.55400265e+14, 2.55664972e+14, @@ -51,9 +45,3 @@ density_data = np.load("ion_density_case_1.npy") print(repr(density_data)) assert np.allclose(density_data, ref_density) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Physics_applications/capacitive_discharge/analysis_2d.py b/Examples/Physics_applications/capacitive_discharge/analysis_2d.py deleted file mode 100755 index d4845ffb718..00000000000 --- a/Examples/Physics_applications/capacitive_discharge/analysis_2d.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2021 Modern Electron - -# This script checks that the inputs_test_2d_background_mcc_picmi.py run more-or-less matches the -# results from the non-PICMI run. The PICMI run is using an external Poisson -# solver that directly solves the Poisson equation using matrix inversion -# rather than the iterative approach from the MLMG solver. - -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=5e-3, -) diff --git a/Examples/Physics_applications/capacitive_discharge/analysis_dsmc.py b/Examples/Physics_applications/capacitive_discharge/analysis_dsmc.py index 1458924b35c..cdaa6bed58f 100755 --- a/Examples/Physics_applications/capacitive_discharge/analysis_dsmc.py +++ b/Examples/Physics_applications/capacitive_discharge/analysis_dsmc.py @@ -2,14 +2,8 @@ # 2023 TAE Technologies -import os -import sys - import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # fmt: off ref_density = np.array([ 1.27942709e+14, 2.23579371e+14, 2.55384387e+14, 2.55660663e+14, @@ -51,9 +45,3 @@ density_data = np.load("ion_density_case_1.npy") print(repr(density_data)) assert np.allclose(density_data, ref_density) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Physics_applications/free_electron_laser/CMakeLists.txt b/Examples/Physics_applications/free_electron_laser/CMakeLists.txt index f5bc8d857d2..168f06c9859 100644 --- a/Examples/Physics_applications/free_electron_laser/CMakeLists.txt +++ b/Examples/Physics_applications/free_electron_laser/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_fel # inputs - analysis_fel.py # analysis - diags/diag_labframe # output + "analysis_fel.py diags/diag_labframe" # analysis + "analysis_default_regression.py --path diags/diag_labframe" # checksum OFF # dependency ) diff --git a/Examples/Physics_applications/free_electron_laser/analysis_default_regression.py b/Examples/Physics_applications/free_electron_laser/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/free_electron_laser/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/free_electron_laser/analysis_fel.py b/Examples/Physics_applications/free_electron_laser/analysis_fel.py index 3ab80d195c0..b96ddd47147 100755 --- a/Examples/Physics_applications/free_electron_laser/analysis_fel.py +++ b/Examples/Physics_applications/free_electron_laser/analysis_fel.py @@ -17,16 +17,12 @@ lab-frame diagnostics and boosted-frame diagnostics. """ -import os import sys import numpy as np from openpmd_viewer import OpenPMDTimeSeries from scipy.constants import c, e, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Physical parameters of the test gamma_bunch = 100.6 Bu = 0.5 @@ -136,10 +132,3 @@ def extract_peak_E_boost(iteration): lambda_radiation_lab = lambda_radiation_boost / (2 * gamma_boost) lambda_expected = lambda_u / (2 * gamma_boost**2) assert abs(lambda_radiation_lab - lambda_expected) / lambda_expected < 0.01 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Physics_applications/laser_acceleration/CMakeLists.txt b/Examples/Physics_applications/laser_acceleration/CMakeLists.txt index 46e97a53d54..28b0e30c2b4 100644 --- a/Examples/Physics_applications/laser_acceleration/CMakeLists.txt +++ b/Examples/Physics_applications/laser_acceleration/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_laser_acceleration # inputs - analysis_default_regression.py # analysis - diags/diag1000100 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_laser_acceleration_fluid_boosted # inputs - analysis_1d_fluid_boosted.py # analysis - diags/diag1000001 # output + "analysis_1d_fluid_boosted.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) label_warpx_test(test_1d_laser_acceleration_fluid_boosted slow) @@ -27,8 +27,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_laser_acceleration_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000100 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -37,8 +37,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_acceleration_boosted # inputs - analysis_default_regression.py # analysis - diags/diag1000002 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -47,8 +47,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_acceleration_mr # inputs - analysis_default_regression.py # analysis - diags/diag1000200 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) @@ -57,8 +57,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_acceleration_mr_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000200 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) @@ -67,8 +67,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_refined_injection # inputs - analysis_refined_injection.py # analysis - diags/diag1000200 # output + "analysis_refined_injection.py diags/diag1000200" # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) @@ -77,8 +77,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_laser_acceleration # inputs - analysis_default_openpmd_regression.py # analysis - diags/diag1/ # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) @@ -87,8 +87,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_laser_acceleration_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000100 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -97,8 +97,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_laser_acceleration_single_precision_comms # inputs - analysis_default_openpmd_regression.py # analysis - diags/diag1/ # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) @@ -107,8 +107,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_laser_acceleration # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -117,8 +117,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_laser_acceleration_opmd # inputs - analysis_openpmd_rz.py # analysis - diags/diag1/ # output + "analysis_openpmd_rz.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) @@ -127,8 +127,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_laser_acceleration_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) label_warpx_test(test_rz_laser_acceleration_picmi slow) diff --git a/Examples/Physics_applications/laser_acceleration/analysis_1d_fluid_boosted.py b/Examples/Physics_applications/laser_acceleration/analysis_1d_fluid_boosted.py index 03369d48adf..bd45f30edbb 100755 --- a/Examples/Physics_applications/laser_acceleration/analysis_1d_fluid_boosted.py +++ b/Examples/Physics_applications/laser_acceleration/analysis_1d_fluid_boosted.py @@ -10,7 +10,6 @@ # This is a script that analyses the simulation results from # the script `inputs_1d`. This simulates a 1D WFA with Pondermotive Envelope: # REF: (Equations 20-23) https://journals.aps.org/rmp/pdf/10.1103/RevModPhys.81.1229 -import os import sys import matplotlib @@ -24,9 +23,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -187,9 +183,3 @@ def odefcn(phi, xi, kp, a0, c, tau, xi_0, lambda_laser): print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py b/Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py index 0e07ddf914c..f136ffeb1d4 100755 --- a/Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py +++ b/Examples/Physics_applications/laser_acceleration/analysis_openpmd_rz.py @@ -1,14 +1,10 @@ #!/usr/bin/env python3 -import os import sys import numpy as np import openpmd_api as io -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - filename = sys.argv[1] series = io.Series(f"{filename}/openpmd_%T.h5", io.Access.read_only) @@ -67,10 +63,3 @@ assert ( (electron_meanz > 0) and (beam_meanz < 0) ), "problem with openPMD+RZ. Maybe openPMD+RZ mixed up the order of rho_ diagnostics?" - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Physics_applications/laser_acceleration/analysis_refined_injection.py b/Examples/Physics_applications/laser_acceleration/analysis_refined_injection.py index d481075c112..8df5e422ddb 100755 --- a/Examples/Physics_applications/laser_acceleration/analysis_refined_injection.py +++ b/Examples/Physics_applications/laser_acceleration/analysis_refined_injection.py @@ -9,16 +9,12 @@ # This script tests the "warpx.refine_plasma=1" option by comparing # the actual number of electrons at step 200 to the expected value -import os import sys import yt yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -58,9 +54,3 @@ rho_slice = rho[13:51, 475] # Test uniformity up to 0.5% relative variation assert rho_slice.std() < 0.005 * abs(rho_slice.mean()) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Physics_applications/laser_ion/CMakeLists.txt b/Examples/Physics_applications/laser_ion/CMakeLists.txt index 66d53165290..cc67bef685c 100644 --- a/Examples/Physics_applications/laser_ion/CMakeLists.txt +++ b/Examples/Physics_applications/laser_ion/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_ion_acc # inputs - analysis_test_laser_ion.py # analysis - diags/diagInst/ # output + "analysis_test_laser_ion.py diags/diagInst/" # analysis + "analysis_default_regression.py --path diags/diagInst/" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_ion_acc_picmi.py # inputs - analysis_test_laser_ion.py # analysis - diags/diagInst/ # output + "analysis_test_laser_ion.py diags/diagInst/" # analysis + "analysis_default_regression.py --path diags/diagInst/" # checksum OFF # dependency ) diff --git a/Examples/Physics_applications/laser_ion/analysis_default_regression.py b/Examples/Physics_applications/laser_ion/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/laser_ion/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/laser_ion/analysis_test_laser_ion.py b/Examples/Physics_applications/laser_ion/analysis_test_laser_ion.py index d2106d33803..360d5d48b5f 100755 --- a/Examples/Physics_applications/laser_ion/analysis_test_laser_ion.py +++ b/Examples/Physics_applications/laser_ion/analysis_test_laser_ion.py @@ -6,9 +6,6 @@ import numpy as np import openpmd_api as io -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - def load_field_from_iteration( series, iteration: int, field: str, coord: str = None @@ -67,14 +64,6 @@ def compare_time_avg_with_instantaneous_diags(dir_inst: str, dir_avg: str): if __name__ == "__main__": - # NOTE: works only in the example directory due to relative path import - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", - ) - # TODO: implement intervals parser for PICMI that allows more complex output periods test_name = os.path.split(os.getcwd())[1] if "picmi" not in test_name: diff --git a/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt b/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt index 00a0f80b457..68e81e4b9e4 100644 --- a/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt +++ b/Examples/Physics_applications/plasma_acceleration/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_plasma_acceleration_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1001000 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1001000" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_plasma_acceleration_boosted # inputs - analysis_default_regression.py # analysis - diags/diag1000020 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_plasma_acceleration_mr # inputs - analysis_default_regression.py # analysis - diags/diag1000400 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000400" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_plasma_acceleration_mr_momentum_conserving # inputs - analysis_default_regression.py # analysis - diags/diag1000400 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000400" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_acceleration_boosted # inputs - analysis_default_regression.py # analysis - diags/diag1000005 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000005" # checksum OFF # dependency ) @@ -56,8 +56,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_acceleration_boosted_hybrid # inputs - analysis_default_regression.py # analysis - diags/diag1000025 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000025" # checksum OFF # dependency ) @@ -66,8 +66,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_acceleration_mr_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000002 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -76,7 +76,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_acceleration_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Physics_applications/plasma_mirror/CMakeLists.txt b/Examples/Physics_applications/plasma_mirror/CMakeLists.txt index 073245f758a..0d183ebbf4c 100644 --- a/Examples/Physics_applications/plasma_mirror/CMakeLists.txt +++ b/Examples/Physics_applications/plasma_mirror/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_plasma_mirror # inputs - analysis_default_regression.py # analysis - diags/diag1000020 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) diff --git a/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt b/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt index 95349e525cc..f48cba16496 100644 --- a/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt +++ b/Examples/Physics_applications/spacecraft_charging/CMakeLists.txt @@ -7,8 +7,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_spacecraft_charging_picmi.py # inputs - analysis.py # analysis - diags/diag1/ # output + "analysis.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) endif() diff --git a/Examples/Physics_applications/spacecraft_charging/analysis.py b/Examples/Physics_applications/spacecraft_charging/analysis.py index 1795f5dfb6e..8e13657b62e 100755 --- a/Examples/Physics_applications/spacecraft_charging/analysis.py +++ b/Examples/Physics_applications/spacecraft_charging/analysis.py @@ -12,7 +12,6 @@ by the following exponential function: phi(t)=v0(1-exp(-t/tau)) """ -import os import sys import matplotlib.pyplot as plt @@ -22,8 +21,6 @@ from scipy.optimize import curve_fit yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] ts = OpenPMDTimeSeries(filename) @@ -74,10 +71,3 @@ def func(x, v0, tau): assert (diff_v0 < tolerance_v0) and ( diff_tau < tolerance_tau ), "Test spacecraft_charging did not pass" - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Physics_applications/spacecraft_charging/analysis_default_regression.py b/Examples/Physics_applications/spacecraft_charging/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/spacecraft_charging/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/thomson_parabola_spectrometer/CMakeLists.txt b/Examples/Physics_applications/thomson_parabola_spectrometer/CMakeLists.txt index 93b5d338fec..4a285ca0872 100644 --- a/Examples/Physics_applications/thomson_parabola_spectrometer/CMakeLists.txt +++ b/Examples/Physics_applications/thomson_parabola_spectrometer/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_thomson_parabola_spectrometer # inputs - analysis_default_openpmd_regression.py # analysis - diags/diag1 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1" # checksum OFF # dependency ) diff --git a/Examples/Physics_applications/thomson_parabola_spectrometer/analysis.py b/Examples/Physics_applications/thomson_parabola_spectrometer/analysis.py old mode 100644 new mode 100755 index 3485ffc6712..6f61ed92c72 --- a/Examples/Physics_applications/thomson_parabola_spectrometer/analysis.py +++ b/Examples/Physics_applications/thomson_parabola_spectrometer/analysis.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np diff --git a/Examples/Physics_applications/thomson_parabola_spectrometer/analysis_default_openpmd_regression.py b/Examples/Physics_applications/thomson_parabola_spectrometer/analysis_default_openpmd_regression.py deleted file mode 120000 index 73e5ec47001..00000000000 --- a/Examples/Physics_applications/thomson_parabola_spectrometer/analysis_default_openpmd_regression.py +++ /dev/null @@ -1 +0,0 @@ -../../analysis_default_openpmd_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/thomson_parabola_spectrometer/analysis_default_regression.py b/Examples/Physics_applications/thomson_parabola_spectrometer/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Physics_applications/thomson_parabola_spectrometer/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Physics_applications/uniform_plasma/CMakeLists.txt b/Examples/Physics_applications/uniform_plasma/CMakeLists.txt index 79dec989c1f..6d0f37ab726 100644 --- a/Examples/Physics_applications/uniform_plasma/CMakeLists.txt +++ b/Examples/Physics_applications/uniform_plasma/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_uniform_plasma # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_uniform_plasma # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -26,7 +26,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_uniform_plasma_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000010 # output + "analysis_default_restart.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010 --rtol 1e-12" # checksum test_3d_uniform_plasma # dependency ) diff --git a/Examples/Tests/accelerator_lattice/CMakeLists.txt b/Examples/Tests/accelerator_lattice/CMakeLists.txt index f3a28d30d4a..accccde34d0 100644 --- a/Examples/Tests/accelerator_lattice/CMakeLists.txt +++ b/Examples/Tests/accelerator_lattice/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_hard_edged_quadrupoles # inputs - analysis.py # analysis - diags/diag1000050 # output + "analysis.py diags/diag1000050" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_hard_edged_quadrupoles_boosted # inputs - analysis.py # analysis - diags/diag1000050 # output + "analysis.py diags/diag1000050" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) @@ -26,7 +26,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_hard_edged_quadrupoles_moving # inputs - analysis.py # analysis - diags/diag1000050 # output + "analysis.py diags/diag1000050" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) diff --git a/Examples/Tests/accelerator_lattice/analysis.py b/Examples/Tests/accelerator_lattice/analysis.py index b208d086d8c..f53d54cbe12 100755 --- a/Examples/Tests/accelerator_lattice/analysis.py +++ b/Examples/Tests/accelerator_lattice/analysis.py @@ -15,7 +15,6 @@ The motion is slow enough that relativistic effects are ignored. """ -import os import sys import numpy as np @@ -23,8 +22,6 @@ from scipy.constants import c, e, m_e yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] ds = yt.load(filename) @@ -130,9 +127,3 @@ def applylens(x0, vx0, vz0, gamma, lens_length, lens_strength): assert abs(np.abs((ux - ux_sim) / ux)) < 0.002, Exception( "error in x particle velocity" ) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/accelerator_lattice/analysis_default_regression.py b/Examples/Tests/accelerator_lattice/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/accelerator_lattice/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/boosted_diags/CMakeLists.txt b/Examples/Tests/boosted_diags/CMakeLists.txt index 8deb7f2bee2..b749d7153ea 100644 --- a/Examples/Tests/boosted_diags/CMakeLists.txt +++ b/Examples/Tests/boosted_diags/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_laser_acceleration_btd # inputs - analysis.py # analysis - diags/diag1000003 # output + "analysis.py diags/diag1000003" # analysis + "analysis_default_regression.py --path diags/diag1000003" # checksum OFF # dependency ) diff --git a/Examples/Tests/boosted_diags/analysis.py b/Examples/Tests/boosted_diags/analysis.py index 0d4794a8894..3c26b343d78 100755 --- a/Examples/Tests/boosted_diags/analysis.py +++ b/Examples/Tests/boosted_diags/analysis.py @@ -16,7 +16,6 @@ between the full back-transformed diagnostic and the reduced diagnostic (i.e., x-z slice) . """ -import os import sys import numpy as np @@ -26,9 +25,6 @@ yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - filename = sys.argv[1] # Tolerances to check consistency between legacy BTD and new BTD @@ -55,9 +51,3 @@ ts = OpenPMDTimeSeries("./diags/diag2/") (w,) = ts.get_particle(["w"], species="beam", iteration=3) assert (400 < len(w)) & (len(w) < 600) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/boosted_diags/analysis_default_regression.py b/Examples/Tests/boosted_diags/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/boosted_diags/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/boundaries/CMakeLists.txt b/Examples/Tests/boundaries/CMakeLists.txt index fccd45e2ebf..00a53742cb9 100644 --- a/Examples/Tests/boundaries/CMakeLists.txt +++ b/Examples/Tests/boundaries/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_particle_boundaries # inputs - analysis.py # analysis - diags/diag1000008 # output + "analysis.py diags/diag1000008" # analysis + "analysis_default_regression.py --path diags/diag1000008" # checksum OFF # dependency ) diff --git a/Examples/Tests/boundaries/analysis.py b/Examples/Tests/boundaries/analysis.py index ce3251ea406..9630c07d0ab 100755 --- a/Examples/Tests/boundaries/analysis.py +++ b/Examples/Tests/boundaries/analysis.py @@ -14,7 +14,6 @@ and checks that they end up in the correct place (or are deleted). """ -import os import sys import numpy as np @@ -22,8 +21,6 @@ from scipy.constants import c, m_e yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # The min and max size of the box along the three axis. dmin = -1.0 @@ -110,9 +107,3 @@ def do_periodic(x): assert np.all( np.abs((zz - zza) / zz) < 1.0e-15 ), "Periodic particle position not correct" - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/boundaries/analysis_default_regression.py b/Examples/Tests/boundaries/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/boundaries/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/btd_rz/CMakeLists.txt b/Examples/Tests/btd_rz/CMakeLists.txt index 6a85f653c65..3c4bfffb609 100644 --- a/Examples/Tests/btd_rz/CMakeLists.txt +++ b/Examples/Tests/btd_rz/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_btd # inputs - analysis.py # analysis - diags/diag1000289 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000289" # checksum OFF # dependency ) diff --git a/Examples/Tests/btd_rz/analysis.py b/Examples/Tests/btd_rz/analysis.py index 87f74599105..c3f4f0243fa 100755 --- a/Examples/Tests/btd_rz/analysis.py +++ b/Examples/Tests/btd_rz/analysis.py @@ -8,17 +8,11 @@ # fields recorded by the backtransformed diagnostics have the right amplitude, # wavelength, and envelope (i.e. gaussian envelope with the right duration. -import os -import sys - import numpy as np from openpmd_viewer import OpenPMDTimeSeries from scipy.constants import c, e, m_e from scipy.optimize import curve_fit -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - def gaussian_laser(z, a0, z0_phase, z0_prop, ctau, lambda0): """ @@ -34,8 +28,6 @@ def fit_function(z, z0_phase): return gaussian_laser(z, a0, z0_phase, z0_b + Lprop_b, ctau0, lambda0) -plotfile = sys.argv[1] - # The values must be consistent with the values provided in the simulation input t_current = 80e-15 # Time of the snapshot1 z0_antenna = -1.0e-6 # position of laser @@ -57,9 +49,3 @@ def fit_function(z, z0_phase): ## Check that the a0 agrees within 5% of the predicted value assert np.allclose(Ex, Ex_fit, atol=0.18 * Ex.max()) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/btd_rz/analysis_default_regression.py b/Examples/Tests/btd_rz/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/btd_rz/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/collider_relevant_diags/CMakeLists.txt b/Examples/Tests/collider_relevant_diags/CMakeLists.txt index 338f66970bc..d7bd38a9475 100644 --- a/Examples/Tests/collider_relevant_diags/CMakeLists.txt +++ b/Examples/Tests/collider_relevant_diags/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_collider_diagnostics # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) diff --git a/Examples/Tests/collider_relevant_diags/analysis.py b/Examples/Tests/collider_relevant_diags/analysis.py index 232bc47af21..17e63e69076 100755 --- a/Examples/Tests/collider_relevant_diags/analysis.py +++ b/Examples/Tests/collider_relevant_diags/analysis.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import os import sys import numpy as np @@ -8,9 +7,6 @@ import pandas as pd from scipy.constants import c, e, hbar, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - sys.path.append("../../../../warpx/Tools/Parser/") from input_file_parser import parse_input_file @@ -179,9 +175,3 @@ def dL_dt(): # dL/dt dL_dt_cr = df[[col for col in df.columns if "dL_dt" in col]].to_numpy() assert np.allclose(dL_dt_cr, dL_dt(), rtol=1e-8) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/collider_relevant_diags/analysis_default_regression.py b/Examples/Tests/collider_relevant_diags/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/collider_relevant_diags/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/collision/CMakeLists.txt b/Examples/Tests/collision/CMakeLists.txt index 36f8a1cb1d6..522dafbfbfb 100644 --- a/Examples/Tests/collision/CMakeLists.txt +++ b/Examples/Tests/collision/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_collision_z # inputs - analysis_collision_1d.py # analysis - diags/diag1000600 # output + "analysis_collision_1d.py diags/diag1000600" # analysis + "analysis_default_regression.py --path diags/diag1000600" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_collision_xz # inputs - analysis_collision_2d.py # analysis - diags/diag1000150 # output + "analysis_collision_2d.py diags/diag1000150" # analysis + "analysis_default_regression.py --path diags/diag1000150" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_collision_xz_picmi.py # inputs - analysis_collision_2d.py # analysis - diags/diag1000150 # output + "analysis_collision_2d.py diags/diag1000150" # analysis + "analysis_default_regression.py --path diags/diag1000150" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_collision_iso # inputs - analysis_collision_3d_isotropization.py # analysis - diags/diag1000100 # output + "analysis_collision_3d_isotropization.py diags/diag1000100" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_collision_xyz # inputs - analysis_collision_3d.py # analysis - diags/diag1000150 # output + "analysis_collision_3d.py diags/diag1000150" # analysis + "analysis_default_regression.py --path diags/diag1000150" # checksum OFF # dependency ) @@ -56,7 +56,7 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_collision # inputs - analysis_collision_rz.py # analysis - diags/diag1000150 # output + "analysis_collision_rz.py diags/diag1000150" # analysis + "analysis_default_regression.py --path diags/diag1000150 --skip-particles" # checksum OFF # dependency ) diff --git a/Examples/Tests/collision/analysis_collision_1d.py b/Examples/Tests/collision/analysis_collision_1d.py index 97ddee0591d..d5cf8b1cebd 100755 --- a/Examples/Tests/collision/analysis_collision_1d.py +++ b/Examples/Tests/collision/analysis_collision_1d.py @@ -15,16 +15,12 @@ # Both populations belong to the same carbon12 ion species. # See test T1b from JCP 413 (2020) by D. Higginson, et al. # -import os import sys import numpy as np import yt from scipy.constants import e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file last_fn = sys.argv[1] ds = yt.load(last_fn) @@ -123,9 +119,3 @@ print("TApar at 30ps error = ", error) print("tolerance = ", tolerance) assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/collision/analysis_collision_2d.py b/Examples/Tests/collision/analysis_collision_2d.py index 7ce3e4cdf2e..7e2746be752 100755 --- a/Examples/Tests/collision/analysis_collision_2d.py +++ b/Examples/Tests/collision/analysis_collision_2d.py @@ -32,9 +32,6 @@ import post_processing_utils import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - test_name = os.path.split(os.getcwd())[1] tolerance = 0.001 @@ -120,9 +117,3 @@ post_processing_utils.check_random_filter( last_fn, random_filter_fn, random_fraction, dim, species_name ) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/collision/analysis_collision_3d.py b/Examples/Tests/collision/analysis_collision_3d.py index 59c625d3cb8..c160d020cdc 100755 --- a/Examples/Tests/collision/analysis_collision_3d.py +++ b/Examples/Tests/collision/analysis_collision_3d.py @@ -25,16 +25,12 @@ import glob import math -import os import sys import numpy import post_processing_utils import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 0.001 ng = 512 @@ -110,9 +106,3 @@ post_processing_utils.check_random_filter( last_fn, random_filter_fn, random_fraction, dim, species_name ) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/collision/analysis_collision_3d_isotropization.py b/Examples/Tests/collision/analysis_collision_3d_isotropization.py index 2cfe7f9fffd..2656c5bac4d 100755 --- a/Examples/Tests/collision/analysis_collision_3d_isotropization.py +++ b/Examples/Tests/collision/analysis_collision_3d_isotropization.py @@ -11,16 +11,12 @@ # https://smileipic.github.io/tutorials/advanced_collisions.html # https://smileipic.github.io/Smilei/Understand/collisions.html#test-cases-for-collisions -import os import sys import numpy as np import scipy.constants as sc import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - e = sc.e pi = sc.pi ep0 = sc.epsilon_0 @@ -63,9 +59,3 @@ print(f"error = {error}") print(f"tolerance = {tolerance}") assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/collision/analysis_collision_rz.py b/Examples/Tests/collision/analysis_collision_rz.py index 2df2f6500d2..b37887943f8 100755 --- a/Examples/Tests/collision/analysis_collision_rz.py +++ b/Examples/Tests/collision/analysis_collision_rz.py @@ -16,16 +16,12 @@ # tolerance: 1.0e-30 # Possible running time: ~ 1.0 s -import os import sys from glob import glob import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 1.0e-15 last_fn = sys.argv[1] @@ -54,10 +50,3 @@ print("error = ", error) print("tolerance = ", tolerance) assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - do_particles=False, -) diff --git a/Examples/Tests/collision/analysis_default_regression.py b/Examples/Tests/collision/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/collision/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/diff_lumi_diag/CMakeLists.txt b/Examples/Tests/diff_lumi_diag/CMakeLists.txt index 481847a023d..f16449a976c 100644 --- a/Examples/Tests/diff_lumi_diag/CMakeLists.txt +++ b/Examples/Tests/diff_lumi_diag/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_diff_lumi_diag_leptons # inputs - analysis.py # analysis - diags/diag1000080 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000080 --rtol 1e-2" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_diff_lumi_diag_photons # inputs - analysis.py # analysis - diags/diag1000080 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000080 --rtol 1e-2" # checksum OFF # dependency ) diff --git a/Examples/Tests/diff_lumi_diag/analysis.py b/Examples/Tests/diff_lumi_diag/analysis.py index 41501b1915d..cadb21023ab 100755 --- a/Examples/Tests/diff_lumi_diag/analysis.py +++ b/Examples/Tests/diff_lumi_diag/analysis.py @@ -5,14 +5,10 @@ # In that case, the differential luminosity can be calculated analytically. import os -import sys import numpy as np from read_raw_data import read_reduced_diags_histogram -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Extract the differential luminosity from the file _, _, E_bin, bin_data = read_reduced_diags_histogram( "./diags/reducedfiles/DifferentialLuminosity_beam1_beam2.txt" @@ -55,10 +51,3 @@ print("Relative error: ", error) print("Tolerance: ", tol) assert error < tol - -# compare checksums -evaluate_checksum( - test_name=test_name, - output_file=sys.argv[1], - rtol=1e-2, -) diff --git a/Examples/Tests/diff_lumi_diag/analysis_default_regression.py b/Examples/Tests/diff_lumi_diag/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/diff_lumi_diag/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/divb_cleaning/CMakeLists.txt b/Examples/Tests/divb_cleaning/CMakeLists.txt index d4aae31472e..d851a7ca322 100644 --- a/Examples/Tests/divb_cleaning/CMakeLists.txt +++ b/Examples/Tests/divb_cleaning/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_divb_cleaning # inputs - analysis.py # analysis - diags/diag1000400 # output + "analysis.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400" # checksum OFF # dependency ) diff --git a/Examples/Tests/divb_cleaning/analysis.py b/Examples/Tests/divb_cleaning/analysis.py index d72226a01cc..6fcd8f6f755 100755 --- a/Examples/Tests/divb_cleaning/analysis.py +++ b/Examples/Tests/divb_cleaning/analysis.py @@ -8,15 +8,11 @@ import sys -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -import os - import numpy as np import yt yt.funcs.mylog.setLevel(50) -from checksumAPI import evaluate_checksum from scipy.constants import c # Name of the last plotfile @@ -51,9 +47,3 @@ tolerance = 1e-1 assert rel_error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/divb_cleaning/analysis_default_regression.py b/Examples/Tests/divb_cleaning/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/divb_cleaning/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/dive_cleaning/CMakeLists.txt b/Examples/Tests/dive_cleaning/CMakeLists.txt index c23c2aef539..c5fe87baad0 100644 --- a/Examples/Tests/dive_cleaning/CMakeLists.txt +++ b/Examples/Tests/dive_cleaning/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_dive_cleaning # inputs - analysis.py # analysis - diags/diag1000128 # output + "analysis.py diags/diag1000128" # analysis + "analysis_default_regression.py --path diags/diag1000128" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_dive_cleaning # inputs - analysis.py # analysis - diags/diag1000128 # output + "analysis.py diags/diag1000128" # analysis + "analysis_default_regression.py --path diags/diag1000128" # checksum OFF # dependency ) diff --git a/Examples/Tests/dive_cleaning/analysis_default_regression.py b/Examples/Tests/dive_cleaning/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/dive_cleaning/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/effective_potential_electrostatic/CMakeLists.txt b/Examples/Tests/effective_potential_electrostatic/CMakeLists.txt index a6545e8c5f3..528ee6d1e08 100644 --- a/Examples/Tests/effective_potential_electrostatic/CMakeLists.txt +++ b/Examples/Tests/effective_potential_electrostatic/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_effective_potential_electrostatic_picmi.py # inputs - analysis.py # analysis - diags/field_diag/ # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/field_diag/" # checksum OFF # dependency ) diff --git a/Examples/Tests/effective_potential_electrostatic/analysis.py b/Examples/Tests/effective_potential_electrostatic/analysis.py index 5aa9b045af0..b51cd129252 100755 --- a/Examples/Tests/effective_potential_electrostatic/analysis.py +++ b/Examples/Tests/effective_potential_electrostatic/analysis.py @@ -7,9 +7,6 @@ # --- with the analytically calculated density based on the input parameters # --- of the test simulation at each output timestep. -import os -import sys - import dill import matplotlib.pyplot as plt import numpy as np @@ -79,12 +76,3 @@ def get_radial_function(field, info): plt.grid() plt.legend() plt.show() - -if len(sys.argv) > 1: - sys.path.insert(1, "../../../../warpx/Regression/Checksum/") - import checksumAPI - - filename = sys.argv[1] - - test_name = os.path.split(os.getcwd())[1] - checksumAPI.evaluate_checksum(test_name, filename, output_format="openpmd") diff --git a/Examples/Tests/effective_potential_electrostatic/analysis_default_regression.py b/Examples/Tests/effective_potential_electrostatic/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/effective_potential_electrostatic/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt b/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt index 1325d1a6bf5..039181096a8 100644 --- a/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt +++ b/Examples/Tests/electrostatic_dirichlet_bc/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_dirichlet_bc # inputs - analysis.py # analysis - diags/diag1000100 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_dirichlet_bc_picmi.py # inputs - analysis.py # analysis - diags/diag1000100 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) diff --git a/Examples/Tests/electrostatic_dirichlet_bc/analysis.py b/Examples/Tests/electrostatic_dirichlet_bc/analysis.py index 1b8f6923c1c..82fe061c3a8 100755 --- a/Examples/Tests/electrostatic_dirichlet_bc/analysis.py +++ b/Examples/Tests/electrostatic_dirichlet_bc/analysis.py @@ -14,16 +14,10 @@ # Possible running time: ~ 19 s import glob -import os -import re -import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - files = sorted(glob.glob("diags/diag1*"))[1:] assert len(files) > 0 @@ -45,11 +39,3 @@ assert np.allclose(potentials_lo, expected_potentials_lo, rtol=0.1) assert np.allclose(potentials_hi, expected_potentials_hi, rtol=0.1) - -# compare checksums -test_name = os.path.split(os.getcwd())[1] -test_name = re.sub("_picmi", "", test_name) # same checksums for PICMI test -evaluate_checksum( - test_name=test_name, - output_file=sys.argv[1], -) diff --git a/Examples/Tests/electrostatic_dirichlet_bc/analysis_default_regression.py b/Examples/Tests/electrostatic_dirichlet_bc/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/electrostatic_dirichlet_bc/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/electrostatic_sphere/CMakeLists.txt b/Examples/Tests/electrostatic_sphere/CMakeLists.txt index 3d17c4462f8..fc69ac8ba6e 100644 --- a/Examples/Tests/electrostatic_sphere/CMakeLists.txt +++ b/Examples/Tests/electrostatic_sphere/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere # inputs - analysis_electrostatic_sphere.py # analysis - diags/diag1000030 # output + "analysis_electrostatic_sphere.py diags/diag1000030" # analysis + "analysis_default_regression.py --path diags/diag1000030" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_lab_frame # inputs - analysis_electrostatic_sphere.py # analysis - diags/diag1000030 # output + "analysis_electrostatic_sphere.py diags/diag1000030" # analysis + "analysis_default_regression.py --path diags/diag1000030" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_lab_frame_mr_emass_10 # inputs - analysis_electrostatic_sphere.py # analysis - diags/diag1000002 # output + "analysis_electrostatic_sphere.py diags/diag1000002" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_rel_nodal # inputs - analysis_electrostatic_sphere.py # analysis - diags/diag1000030 # output + "analysis_electrostatic_sphere.py diags/diag1000030" # analysis + "analysis_default_regression.py --path diags/diag1000030" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_adaptive # inputs - analysis_electrostatic_sphere.py # analysis - diags/diag1000054 # output + "analysis_electrostatic_sphere.py diags/diag1000054" # analysis + "analysis_default_regression.py --path diags/diag1000054" # checksum OFF # dependency ) @@ -56,7 +56,7 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_electrostatic_sphere # inputs - analysis_electrostatic_sphere.py # analysis - diags/diag1000030 # output + "analysis_electrostatic_sphere.py diags/diag1000030" # analysis + "analysis_default_regression.py --path diags/diag1000030" # checksum OFF # dependency ) diff --git a/Examples/Tests/electrostatic_sphere/analysis_default_regression.py b/Examples/Tests/electrostatic_sphere/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/electrostatic_sphere/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py b/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py index dd15a6492f1..2176dcbd7c4 100755 --- a/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py +++ b/Examples/Tests/electrostatic_sphere/analysis_electrostatic_sphere.py @@ -28,9 +28,6 @@ from scipy.constants import c from scipy.optimize import fsolve -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - yt.funcs.mylog.setLevel(0) # Open plotfile specified in command line @@ -192,9 +189,3 @@ def return_energies(iteration): assert abs((Ek_i + Ep_i) - (Ek_f + Ep_f)) < 0.003 * ( Ek_i + Ep_i ) # Check conservation of energy - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt b/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt index 7f7b1389119..0511212c4d5 100644 --- a/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt +++ b/Examples/Tests/electrostatic_sphere_eb/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_eb # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_eb_mixed_bc # inputs - analysis_default_regression.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) endif() @@ -31,8 +31,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_electrostatic_sphere_eb_picmi.py # inputs - analysis.py # analysis - diags/diag1000002 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) endif() @@ -43,8 +43,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_electrostatic_sphere_eb # inputs - analysis_rz.py # analysis - diags/diag1000001 # output + "analysis_rz.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001 --skip-particles" # checksum OFF # dependency ) endif() @@ -55,8 +55,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_electrostatic_sphere_eb_mr # inputs - analysis_rz_mr.py # analysis - diags/diag1/ # output + "analysis_rz_mr.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/electrostatic_sphere_eb/analysis.py b/Examples/Tests/electrostatic_sphere_eb/analysis.py index e12070119ac..114db2871ee 100755 --- a/Examples/Tests/electrostatic_sphere_eb/analysis.py +++ b/Examples/Tests/electrostatic_sphere_eb/analysis.py @@ -4,13 +4,8 @@ # using the same reference file as for the non-PICMI test since the two # tests are otherwise the same. -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") # Check reduced diagnostics for charge on EB import numpy as np -from checksumAPI import evaluate_checksum from scipy.constants import epsilon_0 # Theoretical charge on the embedded boundary, for sphere at potential phi_0 @@ -27,9 +22,3 @@ data_eighth = np.loadtxt("diags/reducedfiles/eb_charge_one_eighth.txt") q_sim_eighth = data_eighth[1, 2] assert abs((q_sim_eighth - q_th / 8) / (q_th / 8)) < 0.06 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/electrostatic_sphere_eb/analysis_rz.py b/Examples/Tests/electrostatic_sphere_eb/analysis_rz.py index e3976c95e68..be9033e2b14 100755 --- a/Examples/Tests/electrostatic_sphere_eb/analysis_rz.py +++ b/Examples/Tests/electrostatic_sphere_eb/analysis_rz.py @@ -16,16 +16,12 @@ # tolerance: 0.004 # Possible running time: < 1 s -import os import sys import numpy as np import yt from unyt import m -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 0.0041 fn = sys.argv[1] @@ -66,10 +62,3 @@ print("max error of Er = ", errmax_Er) print("tolerance = ", tolerance) assert errmax_phi < tolerance and errmax_Er < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - do_particles=False, -) diff --git a/Examples/Tests/electrostatic_sphere_eb/analysis_rz_mr.py b/Examples/Tests/electrostatic_sphere_eb/analysis_rz_mr.py index 586b35fc7a4..55365bd4c76 100755 --- a/Examples/Tests/electrostatic_sphere_eb/analysis_rz_mr.py +++ b/Examples/Tests/electrostatic_sphere_eb/analysis_rz_mr.py @@ -12,15 +12,11 @@ # Thus the analytical solution has the form: # phi(r) = A+B*log(r), Er(r) = -B/r. -import os import sys import numpy as np from openpmd_viewer import OpenPMDTimeSeries -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 0.004 print(f"tolerance = {tolerance}") @@ -109,10 +105,3 @@ def get_error_per_lev(ts, level): nlevels = 0 if level_fields == [] else int(level_fields[-1][-1]) for level in range(nlevels + 1): get_error_per_lev(ts, level) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Tests/embedded_boundary_cube/CMakeLists.txt b/Examples/Tests/embedded_boundary_cube/CMakeLists.txt index 0044ed04ec8..ac509955088 100644 --- a/Examples/Tests/embedded_boundary_cube/CMakeLists.txt +++ b/Examples/Tests/embedded_boundary_cube/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 2 # dims 1 # nprocs inputs_test_2d_embedded_boundary_cube # inputs - analysis_fields_2d.py # analysis - diags/diag1000114 # output + "analysis_fields_2d.py diags/diag1000114" # analysis + "analysis_default_regression.py --path diags/diag1000114" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_embedded_boundary_cube # inputs - analysis_fields.py # analysis - diags/diag1000208 # output + "analysis_fields.py diags/diag1000208" # analysis + "analysis_default_regression.py --path diags/diag1000208" # checksum OFF # dependency ) endif() @@ -31,8 +31,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_embedded_boundary_cube_macroscopic # inputs - analysis_fields.py # analysis - diags/diag1000208 # output + "analysis_fields.py diags/diag1000208" # analysis + "analysis_default_regression.py --path diags/diag1000208" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/embedded_boundary_cube/analysis_default_regression.py b/Examples/Tests/embedded_boundary_cube/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/embedded_boundary_cube/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/embedded_boundary_cube/analysis_fields.py b/Examples/Tests/embedded_boundary_cube/analysis_fields.py index 3202ccfaca2..4cb4a60f603 100755 --- a/Examples/Tests/embedded_boundary_cube/analysis_fields.py +++ b/Examples/Tests/embedded_boundary_cube/analysis_fields.py @@ -8,9 +8,6 @@ import yt from scipy.constants import c, mu_0, pi -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # This is a script that analyses the simulation results from # the script `inputs_3d`. This simulates a TMmnp mode in a PEC cubic resonator. # The magnetic field in the simulation is given (in theory) by: @@ -109,9 +106,3 @@ Bz_sim = data[("mesh", "Bz")].to_ndarray() rel_err_z = np.sqrt(np.sum(np.square(Bz_sim - Bz_th)) / np.sum(np.square(Bz_th))) assert rel_err_z < rel_tol_err - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/embedded_boundary_cube/analysis_fields_2d.py b/Examples/Tests/embedded_boundary_cube/analysis_fields_2d.py index 454d78169b7..bb35ad93cb8 100755 --- a/Examples/Tests/embedded_boundary_cube/analysis_fields_2d.py +++ b/Examples/Tests/embedded_boundary_cube/analysis_fields_2d.py @@ -1,15 +1,11 @@ #!/usr/bin/env python3 -import os import sys import numpy as np import yt from scipy.constants import c, mu_0, pi -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # This is a script that analyses the simulation results from # the script `inputs_3d`. This simulates a TMmnp mode in a PEC cubic resonator. # The magnetic field in the simulation is given (in theory) by: @@ -62,9 +58,3 @@ # Compute relative l^2 error on Ey Ey_sim = data["Ey"].to_ndarray() rel_err_y = np.sqrt(np.sum(np.square(Ey_sim / c - By_th)) / np.sum(np.square(By_th))) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt b/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt index 6297cf1fa5c..456e9f9b630 100644 --- a/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt +++ b/Examples/Tests/embedded_boundary_diffraction/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_embedded_boundary_diffraction # inputs - analysis_fields.py # analysis - diags/diag1/ # output + "analysis_fields.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/embedded_boundary_diffraction/analysis_default_regression.py b/Examples/Tests/embedded_boundary_diffraction/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/embedded_boundary_diffraction/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py b/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py index 8f0b7818516..599bcea71f9 100755 --- a/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py +++ b/Examples/Tests/embedded_boundary_diffraction/analysis_fields.py @@ -7,16 +7,12 @@ theta_diffraction = 1.22 * lambda / d """ -import os import sys import numpy as np from openpmd_viewer import OpenPMDTimeSeries from scipy.ndimage import gaussian_filter1d -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - filename = sys.argv[1] ts = OpenPMDTimeSeries(filename) @@ -41,10 +37,3 @@ def r_first_minimum(iz): # Check that this corresponds to the prediction from the Airy pattern theta_diffraction = np.arcsin(1.22 * 0.1 / 0.4) / 2 assert np.all(abs(r[50:] - theta_diffraction * info.z[50:]) < 0.03) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt b/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt index fe820c76f22..3e79e526218 100644 --- a/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt +++ b/Examples/Tests/embedded_boundary_python_api/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_embedded_boundary_picmi.py # inputs - analysis.py # analysis - diags/diag1000002 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/embedded_boundary_python_api/analysis.py b/Examples/Tests/embedded_boundary_python_api/analysis.py deleted file mode 100755 index 7fda682f618..00000000000 --- a/Examples/Tests/embedded_boundary_python_api/analysis.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python3 - -# This script just checks that the PICMI file executed successfully. -# If it did there will be a plotfile for the final step. - -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -step = int(sys.argv[1][-5:]) -assert step == 2 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/embedded_boundary_python_api/analysis_default_regression.py b/Examples/Tests/embedded_boundary_python_api/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/embedded_boundary_python_api/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt b/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt index fcfe97905d8..cb7fa405210 100644 --- a/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt +++ b/Examples/Tests/embedded_boundary_rotated_cube/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 2 # dims 1 # nprocs inputs_test_2d_embedded_boundary_rotated_cube # inputs - analysis_fields_2d.py # analysis - diags/diag1000068 # output + "analysis_fields_2d.py diags/diag1000068" # analysis + "analysis_default_regression.py --path diags/diag1000068" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_embedded_boundary_rotated_cube # inputs - analysis_fields_3d.py # analysis - diags/diag1000111 # output + "analysis_fields_3d.py diags/diag1000111" # analysis + "analysis_default_regression.py --path diags/diag1000111" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/embedded_boundary_rotated_cube/analysis_default_regression.py b/Examples/Tests/embedded_boundary_rotated_cube/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/embedded_boundary_rotated_cube/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_2d.py b/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_2d.py index 451913fd54d..dbb74b174e7 100755 --- a/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_2d.py +++ b/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_2d.py @@ -1,15 +1,11 @@ #!/usr/bin/env python3 -import os import sys import numpy as np import yt from scipy.constants import c, mu_0, pi -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # This is a script that analyses the simulation results from # the script `inputs_3d`. This simulates a TMmnp mode in a PEC cubic resonator. # The magnetic field in the simulation is given (in theory) by: @@ -67,9 +63,3 @@ # Compute relative l^2 error on By rel_err_y = np.sqrt(np.sum(np.square(By_sim - By_th)) / np.sum(np.square(By_th))) assert rel_err_y < rel_tol_err - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_3d.py b/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_3d.py index 838c9c82479..00d1ba2280f 100755 --- a/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_3d.py +++ b/Examples/Tests/embedded_boundary_rotated_cube/analysis_fields_3d.py @@ -7,16 +7,12 @@ # License: BSD-3-Clause-LBNL -import os import sys import numpy as np import yt from scipy.constants import c, mu_0, pi -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # This is a script that analyses the simulation results from # the script `inputs_3d`. This simulates a TMmnp mode in a PEC cubic resonator rotated by pi/8. # The magnetic field in the simulation is given (in theory) by: @@ -143,9 +139,3 @@ np.sum(np.square(Bz_sim[:, :, :, 0] - Bz_th)) / np.sum(np.square(Bz_th)) ) assert rel_err_z < rel_tol_err - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/embedded_circle/CMakeLists.txt b/Examples/Tests/embedded_circle/CMakeLists.txt index 4b9ee426569..1a0577da82e 100644 --- a/Examples/Tests/embedded_circle/CMakeLists.txt +++ b/Examples/Tests/embedded_circle/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 2 # dims 2 # nprocs inputs_test_2d_embedded_circle # inputs - analysis.py # analysis - diags/diag1000011 + OFF # analysis + "analysis_default_regression.py --path diags/diag1000011 --rtol 1e-2" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/embedded_circle/analysis.py b/Examples/Tests/embedded_circle/analysis.py deleted file mode 100755 index d1bb04fedb6..00000000000 --- a/Examples/Tests/embedded_circle/analysis.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=1e-2, -) diff --git a/Examples/Tests/embedded_circle/analysis_default_regression.py b/Examples/Tests/embedded_circle/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/embedded_circle/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt b/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt index c89d439b75e..a925cc537f4 100644 --- a/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt +++ b/Examples/Tests/energy_conserving_thermal_plasma/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_energy_conserving_thermal_plasma # inputs - analysis.py # analysis - diags/diag1000500 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000500" # checksum OFF # dependency ) diff --git a/Examples/Tests/energy_conserving_thermal_plasma/analysis.py b/Examples/Tests/energy_conserving_thermal_plasma/analysis.py index 0d29f85e7eb..5991d888e20 100755 --- a/Examples/Tests/energy_conserving_thermal_plasma/analysis.py +++ b/Examples/Tests/energy_conserving_thermal_plasma/analysis.py @@ -12,14 +12,8 @@ # than other gathering scheme. This tests checks that the energy does not increase by # more than 0.3% over the duration of the simulatoin. -import os -import sys - import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Get energy as a function of time, from reduced diagnostics EFdata = np.genfromtxt("./diags/reducedfiles/EF.txt") # Field energy EPdata = np.genfromtxt("./diags/reducedfiles/EP.txt") # Particle energy @@ -29,9 +23,3 @@ print(abs(E - E[0]) / E[0]) # Check that the energy is conserved to 0.3% assert np.all(abs(E - E[0]) / E[0] < 0.003) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/energy_conserving_thermal_plasma/analysis_default_regression.py b/Examples/Tests/energy_conserving_thermal_plasma/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/energy_conserving_thermal_plasma/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/field_ionization/CMakeLists.txt b/Examples/Tests/field_ionization/CMakeLists.txt index 9154173ac5f..71e34dbc5fc 100644 --- a/Examples/Tests/field_ionization/CMakeLists.txt +++ b/Examples/Tests/field_ionization/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_ionization_boost # inputs - analysis.py # analysis - diags/diag1000420 # output + "analysis.py diags/diag1000420" # analysis + "analysis_default_regression.py --path diags/diag1000420" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_ionization_lab # inputs - analysis.py # analysis - diags/diag1001600 # output + "analysis.py diags/diag1001600" # analysis + "analysis_default_regression.py --path diags/diag1001600" # checksum OFF # dependency ) @@ -26,7 +26,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_ionization_picmi.py # inputs - analysis.py # analysis - diags/diag1001600 # output + "analysis.py diags/diag1001600" # analysis + "analysis_default_regression.py --path diags/diag1001600" # checksum OFF # dependency ) diff --git a/Examples/Tests/field_ionization/analysis.py b/Examples/Tests/field_ionization/analysis.py index a02c293601b..bafc47f2145 100755 --- a/Examples/Tests/field_ionization/analysis.py +++ b/Examples/Tests/field_ionization/analysis.py @@ -18,15 +18,12 @@ ions are N5+, in agreement with theory from Chen's article. """ -import os import sys import numpy as np import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Open plotfile specified in command line, and get ion's ionization level. filename = sys.argv[1] @@ -106,9 +103,3 @@ print("particle_orig_z has reasonable values") except yt.utilities.exceptions.YTFieldNotFound: pass # The backtransformed diagnostic version of the test does not have orig_z - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/field_ionization/analysis_default_regression.py b/Examples/Tests/field_ionization/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/field_ionization/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/field_probe/CMakeLists.txt b/Examples/Tests/field_probe/CMakeLists.txt index bbddbd7839e..8b052dc3b66 100644 --- a/Examples/Tests/field_probe/CMakeLists.txt +++ b/Examples/Tests/field_probe/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 2 # dims 2 # nprocs inputs_test_2d_field_probe # inputs - analysis.py # analysis - diags/diag1000544 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000544" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/field_probe/analysis.py b/Examples/Tests/field_probe/analysis.py index e974e284b65..57085fb7cdc 100755 --- a/Examples/Tests/field_probe/analysis.py +++ b/Examples/Tests/field_probe/analysis.py @@ -18,15 +18,9 @@ which can be solved analytically. """ -import os -import sys - import numpy as np import pandas as pd -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - filename = "diags/reducedfiles/FP_line.txt" # Open data file @@ -65,9 +59,3 @@ def I_envelope(x, lam=0.2e-6, a=0.3e-6, D=1.7e-6): print("Average error greater than 2.5%") assert averror < 2.5 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/field_probe/analysis_default_regression.py b/Examples/Tests/field_probe/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/field_probe/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/flux_injection/CMakeLists.txt b/Examples/Tests/flux_injection/CMakeLists.txt index 0929fc3d4c4..000d5c74917 100644 --- a/Examples/Tests/flux_injection/CMakeLists.txt +++ b/Examples/Tests/flux_injection/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_flux_injection # inputs - analysis_flux_injection_3d.py # analysis - diags/diag1000002 # output + "analysis_flux_injection_3d.py diags/diag1000002" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_flux_injection # inputs - analysis_flux_injection_rz.py # analysis - diags/diag1000120 # output + "analysis_flux_injection_rz.py diags/diag1000120" # analysis + "analysis_default_regression.py --path diags/diag1000120" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_flux_injection_from_eb # inputs - analysis_flux_injection_from_eb.py # analysis - diags/diag1000010 # output + "analysis_flux_injection_from_eb.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_flux_injection_from_eb # inputs - analysis_flux_injection_from_eb.py # analysis - diags/diag1000010 # output + "analysis_flux_injection_from_eb.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -46,7 +46,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_flux_injection_from_eb # inputs - analysis_flux_injection_from_eb.py # analysis - diags/diag1000010 # output + "analysis_flux_injection_from_eb.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Tests/flux_injection/analysis_default_regression.py b/Examples/Tests/flux_injection/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/flux_injection/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/flux_injection/analysis_flux_injection_3d.py b/Examples/Tests/flux_injection/analysis_flux_injection_3d.py index dc89780703d..53baf9511f4 100755 --- a/Examples/Tests/flux_injection/analysis_flux_injection_3d.py +++ b/Examples/Tests/flux_injection/analysis_flux_injection_3d.py @@ -21,7 +21,6 @@ of space) """ -import os import sys import matplotlib.pyplot as plt @@ -30,9 +29,6 @@ from scipy.constants import c, m_e, m_p from scipy.special import erf -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - yt.funcs.mylog.setLevel(0) # Open plotfile specified in command line @@ -146,9 +142,3 @@ def compare_gaussian_flux(u, w, u_th, u_m, label=""): plt.tight_layout() plt.savefig("Distribution.png") - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/flux_injection/analysis_flux_injection_from_eb.py b/Examples/Tests/flux_injection/analysis_flux_injection_from_eb.py index c9e1c6df42c..0f2a37eea71 100755 --- a/Examples/Tests/flux_injection/analysis_flux_injection_from_eb.py +++ b/Examples/Tests/flux_injection/analysis_flux_injection_from_eb.py @@ -13,7 +13,6 @@ the particle distributions are consistent with the expected distributions. """ -import os import re import sys @@ -23,9 +22,6 @@ from scipy.constants import c, m_e from scipy.special import erf -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -import checksumAPI - yt.funcs.mylog.setLevel(0) # Open plotfile specified in command line @@ -155,7 +151,3 @@ def compare_gaussian_flux(u, w, u_th, u_m, label=""): plt.tight_layout() plt.savefig("Distribution.png") - -# Verify checksum -test_name = os.path.split(os.getcwd())[1] -checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/Tests/flux_injection/analysis_flux_injection_rz.py b/Examples/Tests/flux_injection/analysis_flux_injection_rz.py index 33b487cc36b..170fb08128d 100755 --- a/Examples/Tests/flux_injection/analysis_flux_injection_rz.py +++ b/Examples/Tests/flux_injection/analysis_flux_injection_rz.py @@ -25,15 +25,11 @@ - The total number of electrons corresponds to the expected flux. """ -import os import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - yt.funcs.mylog.setLevel(0) # Open plotfile specified in command line @@ -56,9 +52,3 @@ assert np.allclose(w.sum(), n_tot, rtol=0.05) # Check that the particles are at the right radius assert np.all((r >= 1.48) & (r <= 1.92)) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/gaussian_beam/CMakeLists.txt b/Examples/Tests/gaussian_beam/CMakeLists.txt index ae0cf57ed15..2a1f4918458 100644 --- a/Examples/Tests/gaussian_beam/CMakeLists.txt +++ b/Examples/Tests/gaussian_beam/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_focusing_gaussian_beam # inputs - analysis.py # analysis - diags/diag1000000 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000000" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_gaussian_beam_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Tests/gaussian_beam/analysis.py b/Examples/Tests/gaussian_beam/analysis.py index a2278b2cf7a..a5a6caf8e42 100755 --- a/Examples/Tests/gaussian_beam/analysis.py +++ b/Examples/Tests/gaussian_beam/analysis.py @@ -7,15 +7,9 @@ # License: BSD-3-Clause-LBNL -import os -import sys - import numpy as np -from scipy.constants import c, eV, m_e, micro, nano - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum from openpmd_viewer import OpenPMDTimeSeries +from scipy.constants import c, eV, m_e, micro, nano GeV = 1e9 * eV energy = 125.0 * GeV @@ -67,9 +61,3 @@ def s(z, sigma0, emit): assert np.allclose(sx, sx_theory, rtol=0.051, atol=0) assert np.allclose(sy, sy_theory, rtol=0.038, atol=0) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/implicit/CMakeLists.txt b/Examples/Tests/implicit/CMakeLists.txt index eeb1ff87804..e4bde9bbeaf 100644 --- a/Examples/Tests/implicit/CMakeLists.txt +++ b/Examples/Tests/implicit/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_semi_implicit_picard # inputs - analysis_1d.py # analysis - diags/diag1000100 # output + "analysis_1d.py" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_theta_implicit_picard # inputs - analysis_1d.py # analysis - diags/diag1000100 # output + "analysis_1d.py" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_theta_implicit_jfnk_vandb # inputs - analysis_vandb_jfnk_2d.py # analysis - diags/diag1000020 # output + "analysis_vandb_jfnk_2d.py diags/diag1000020" # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_theta_implicit_jfnk_vandb_filtered # inputs - analysis_vandb_jfnk_2d.py # analysis - diags/diag1000020 # output + "analysis_vandb_jfnk_2d.py diags/diag1000020" # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_theta_implicit_jfnk_vandb_picmi.py # inputs - analysis_vandb_jfnk_2d.py # analysis - diags/diag1000020 # output + "analysis_vandb_jfnk_2d.py diags/diag1000020" # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) @@ -57,8 +57,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_theta_implicit_strang_psatd # inputs - analysis_2d_psatd.py # analysis - diags/diag1000020 # output + "analysis_2d_psatd.py" # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/implicit/analysis_1d.py b/Examples/Tests/implicit/analysis_1d.py index 665fcaac951..aa54cd279ce 100755 --- a/Examples/Tests/implicit/analysis_1d.py +++ b/Examples/Tests/implicit/analysis_1d.py @@ -11,13 +11,9 @@ # the script `inputs_1d`. This simulates a 1D periodic plasma using the implicit solver. import os import re -import sys import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - field_energy = np.loadtxt("diags/reducedfiles/field_energy.txt", skiprows=1) particle_energy = np.loadtxt("diags/reducedfiles/particle_energy.txt", skiprows=1) @@ -37,9 +33,3 @@ print(f"tolerance: {tolerance_rel}") assert max_delta_E < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/implicit/analysis_2d_psatd.py b/Examples/Tests/implicit/analysis_2d_psatd.py index 3ccc3880189..507fc6f2c4a 100755 --- a/Examples/Tests/implicit/analysis_2d_psatd.py +++ b/Examples/Tests/implicit/analysis_2d_psatd.py @@ -10,17 +10,9 @@ # This is a script that analyses the simulation results from the script `inputs_vandb_2d`. # This simulates a 2D periodic plasma using the implicit solver # with the Villasenor deposition using shape factor 2. -import os -import sys import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -import checksumAPI - -# this will be the name of the plot file -fn = sys.argv[1] - field_energy = np.loadtxt("diags/reducedfiles/field_energy.txt", skiprows=1) particle_energy = np.loadtxt("diags/reducedfiles/particle_energy.txt", skiprows=1) @@ -36,6 +28,3 @@ print(f"tolerance: {tolerance_rel_energy}") assert max_delta_E < tolerance_rel_energy - -test_name = os.path.split(os.getcwd())[1] -checksumAPI.evaluate_checksum(test_name, fn) diff --git a/Examples/Tests/implicit/analysis_default_regression.py b/Examples/Tests/implicit/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/implicit/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py b/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py index 29a2c870574..dcbacdfde1f 100755 --- a/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py +++ b/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py @@ -10,19 +10,12 @@ # This is a script that analyses the simulation results from the script `inputs_vandb_2d`. # This simulates a 2D periodic plasma using the implicit solver # with the Villasenor deposition using shape factor 2. -import os import sys import numpy as np import yt from scipy.constants import e, epsilon_0 -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -# this will be the name of the plot file -fn = sys.argv[1] - field_energy = np.loadtxt("diags/reducedfiles/field_energy.txt", skiprows=1) particle_energy = np.loadtxt("diags/reducedfiles/particle_energy.txt", skiprows=1) @@ -65,9 +58,3 @@ print(f"tolerance: {tolerance_rel_charge}") assert drho_rms < tolerance_rel_charge - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/initial_distribution/CMakeLists.txt b/Examples/Tests/initial_distribution/CMakeLists.txt index 04af9708cb2..06fce4dddcb 100644 --- a/Examples/Tests/initial_distribution/CMakeLists.txt +++ b/Examples/Tests/initial_distribution/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_initial_distribution # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) diff --git a/Examples/Tests/initial_distribution/analysis.py b/Examples/Tests/initial_distribution/analysis.py index 834934df255..8b2c8ca74e2 100755 --- a/Examples/Tests/initial_distribution/analysis.py +++ b/Examples/Tests/initial_distribution/analysis.py @@ -18,17 +18,11 @@ # 9 denotes gaussian_parser distribution w/ spatially-varying mean and thermal velocity # The distribution is obtained through reduced diagnostic ParticleHistogram. -import os -import sys - import numpy as np import scipy.constants as scc import scipy.special as scs from read_raw_data import read_reduced_diags, read_reduced_diags_histogram -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # print tolerance tolerance = 0.02 print("Tolerance:", tolerance) @@ -448,9 +442,3 @@ def Gaussian(mean, sigma, u): print("gaussian_parse_momentum_function velocity difference:", f9_error) assert f9_error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/initial_distribution/analysis_default_regression.py b/Examples/Tests/initial_distribution/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/initial_distribution/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/initial_plasma_profile/CMakeLists.txt b/Examples/Tests/initial_plasma_profile/CMakeLists.txt index eb45e64dfab..064bbc29907 100644 --- a/Examples/Tests/initial_plasma_profile/CMakeLists.txt +++ b/Examples/Tests/initial_plasma_profile/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_parabolic_channel_initialization # inputs - analysis.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001 --skip-particles --rtol 1e-4" # checksum OFF # dependency ) diff --git a/Examples/Tests/initial_plasma_profile/analysis.py b/Examples/Tests/initial_plasma_profile/analysis.py deleted file mode 100755 index d372bd30a93..00000000000 --- a/Examples/Tests/initial_plasma_profile/analysis.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2020 Michael Rowan -# -# This file is part of WarpX. -# -# License: BSD-3-Clause-LBNL - -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=1e-4, - do_particles=False, -) diff --git a/Examples/Tests/initial_plasma_profile/analysis_default_regression.py b/Examples/Tests/initial_plasma_profile/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/initial_plasma_profile/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/ion_stopping/CMakeLists.txt b/Examples/Tests/ion_stopping/CMakeLists.txt index 83e15287e18..666b28244dd 100644 --- a/Examples/Tests/ion_stopping/CMakeLists.txt +++ b/Examples/Tests/ion_stopping/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_ion_stopping # inputs - analysis.py # analysis - diags/diag1000010 # output + "analysis.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Tests/ion_stopping/analysis.py b/Examples/Tests/ion_stopping/analysis.py index 45983538025..6b92bb304a5 100755 --- a/Examples/Tests/ion_stopping/analysis.py +++ b/Examples/Tests/ion_stopping/analysis.py @@ -11,16 +11,12 @@ # is used in the C++ to check the resulting # particle energies. -import os import sys import numpy as np import yt from scipy.constants import e, epsilon_0, k, m_e, m_p -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Define constants using the WarpX names for the evals below q_e = e kb = k @@ -193,9 +189,3 @@ def stopping_from_ions(dt, ni, Ti, mi, Zi, Zb, ion_mass, ion_energy): assert np.all(error2 < tolerance) assert np.all(error3 < tolerance) assert np.all(error4 < tolerance) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/ion_stopping/analysis_default_regression.py b/Examples/Tests/ion_stopping/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/ion_stopping/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/langmuir/CMakeLists.txt b/Examples/Tests/langmuir/CMakeLists.txt index b259083c695..c01fed9125a 100644 --- a/Examples/Tests/langmuir/CMakeLists.txt +++ b/Examples/Tests/langmuir/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_langmuir_multi # inputs - analysis_1d.py # analysis - diags/diag1000080 # output + "analysis_1d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_mr # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_mr_anisotropic # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_mr_momentum_conserving # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -57,8 +57,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_mr_psatd # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -68,8 +68,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_nodal # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -78,8 +78,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000040 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) @@ -89,8 +89,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_psatd # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -101,8 +101,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_langmuir_multi_psatd_current_correction # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -113,8 +113,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_langmuir_multi_psatd_current_correction_nodal # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -125,8 +125,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_psatd_momentum_conserving # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -137,8 +137,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_psatd_multiJ # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -149,8 +149,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_psatd_multiJ_nodal # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -161,8 +161,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_langmuir_multi_psatd_nodal # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -173,8 +173,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_langmuir_multi_psatd_vay_deposition # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -185,8 +185,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_langmuir_multi_psatd_vay_deposition_nodal # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -197,8 +197,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_langmuir_multi_psatd_vay_deposition_particle_shape_4 # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -208,8 +208,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) @@ -218,8 +218,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_nodal # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) @@ -228,8 +228,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_langmuir_multi_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000040 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) @@ -239,8 +239,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_psatd # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -251,8 +251,8 @@ if(WarpX_FFT) 3 # dims 1 # nprocs inputs_test_3d_langmuir_multi_psatd_current_correction # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -263,8 +263,8 @@ if(WarpX_FFT) 3 # dims 1 # nprocs inputs_test_3d_langmuir_multi_psatd_current_correction_nodal # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -275,8 +275,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_psatd_div_cleaning # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -287,8 +287,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_psatd_momentum_conserving # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -299,8 +299,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_psatd_multiJ # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -311,8 +311,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_psatd_multiJ_nodal # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -323,8 +323,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_langmuir_multi_psatd_nodal # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -335,8 +335,8 @@ if(WarpX_FFT) 3 # dims 1 # nprocs inputs_test_3d_langmuir_multi_psatd_vay_deposition # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) endif() @@ -347,8 +347,8 @@ if(WarpX_FFT) 3 # dims 1 # nprocs inputs_test_3d_langmuir_multi_psatd_vay_deposition_nodal # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) label_warpx_test(test_3d_langmuir_multi_psatd_vay_deposition_nodal slow) @@ -359,8 +359,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_langmuir_multi # inputs - analysis_rz.py # analysis - diags/diag1000080 # output + "analysis_rz.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -369,8 +369,8 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_langmuir_multi_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000040 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) @@ -380,8 +380,8 @@ if(WarpX_FFT) RZ # dims 2 # nprocs inputs_test_rz_langmuir_multi_psatd # inputs - analysis_rz.py # analysis - diags/diag1000080 # output + "analysis_rz.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -392,8 +392,8 @@ if(WarpX_FFT) RZ # dims 1 # nprocs inputs_test_rz_langmuir_multi_psatd_current_correction # inputs - analysis_rz.py # analysis - diags/diag1000080 # output + "analysis_rz.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() @@ -404,8 +404,8 @@ if(WarpX_FFT) RZ # dims 2 # nprocs inputs_test_rz_langmuir_multi_psatd_multiJ # inputs - analysis_rz.py # analysis - diags/diag1000080 # output + "analysis_rz.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/langmuir/analysis_1d.py b/Examples/Tests/langmuir/analysis_1d.py index 8eefd95b4f7..60a088d1309 100755 --- a/Examples/Tests/langmuir/analysis_1d.py +++ b/Examples/Tests/langmuir/analysis_1d.py @@ -26,9 +26,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # test name test_name = os.path.split(os.getcwd())[1] @@ -125,9 +122,3 @@ def get_theoretical_field(field, t): print("error_rel = {}".format(error_rel)) print("tolerance = {}".format(tolerance)) assert error_rel < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir/analysis_2d.py b/Examples/Tests/langmuir/analysis_2d.py index 31995e896a5..3aa246008a6 100755 --- a/Examples/Tests/langmuir/analysis_2d.py +++ b/Examples/Tests/langmuir/analysis_2d.py @@ -26,9 +26,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # test name test_name = os.path.split(os.getcwd())[1] @@ -162,9 +159,3 @@ def get_theoretical_field(field, t): print("error_rel = {}".format(error_rel)) print("tolerance = {}".format(tolerance)) assert error_rel < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir/analysis_3d.py b/Examples/Tests/langmuir/analysis_3d.py index 05f1c585ec0..75b9c5ba71c 100755 --- a/Examples/Tests/langmuir/analysis_3d.py +++ b/Examples/Tests/langmuir/analysis_3d.py @@ -26,9 +26,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # test name test_name = os.path.split(os.getcwd())[1] @@ -211,9 +208,3 @@ def get_theoretical_field(field, t): print("error_rel = {}".format(error_rel)) print("tolerance = {}".format(tolerance)) assert error_rel < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir/analysis_rz.py b/Examples/Tests/langmuir/analysis_rz.py index 64f8cfb6313..a0697b93ab9 100755 --- a/Examples/Tests/langmuir/analysis_rz.py +++ b/Examples/Tests/langmuir/analysis_rz.py @@ -29,9 +29,6 @@ import post_processing_utils from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -182,9 +179,3 @@ def Ez(z, r, epsilon, k0, w0, wp, t): post_processing_utils.check_random_filter( fn, random_filter_fn, random_fraction, dim, species_name ) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir_fluids/CMakeLists.txt b/Examples/Tests/langmuir_fluids/CMakeLists.txt index 054e9c80d3a..df6732200c6 100644 --- a/Examples/Tests/langmuir_fluids/CMakeLists.txt +++ b/Examples/Tests/langmuir_fluids/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_langmuir_fluid # inputs - analysis_1d.py # analysis - diags/diag1000080 # output + "analysis_1d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_langmuir_fluid # inputs - analysis_2d.py # analysis - diags/diag1000080 # output + "analysis_2d.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_langmuir_fluid # inputs - analysis_3d.py # analysis - diags/diag1000040 # output + "analysis_3d.py diags/diag1000040" # analysis + "analysis_default_regression.py --path diags/diag1000040" # checksum OFF # dependency ) @@ -36,7 +36,7 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_langmuir_fluid # inputs - analysis_rz.py # analysis - diags/diag1000080 # output + "analysis_rz.py diags/diag1000080" # analysis + "analysis_default_regression.py --path diags/diag1000080" # checksum OFF # dependency ) diff --git a/Examples/Tests/langmuir_fluids/analysis_1d.py b/Examples/Tests/langmuir_fluids/analysis_1d.py index c448303783f..f60c76660b5 100755 --- a/Examples/Tests/langmuir_fluids/analysis_1d.py +++ b/Examples/Tests/langmuir_fluids/analysis_1d.py @@ -11,7 +11,6 @@ # the script `inputs.multi.rt`. This simulates a 1D periodic plasma wave. # The electric field in the simulation is given (in theory) by: # $$ E_z = \epsilon \,\frac{m_e c^2 k_z}{q_e}\sin(k_z z)\sin( \omega_p t)$$ -import os import sys import matplotlib @@ -25,9 +24,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -147,9 +143,3 @@ def get_theoretical_rho_field(field, t): print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir_fluids/analysis_2d.py b/Examples/Tests/langmuir_fluids/analysis_2d.py index d8ba50a9df1..46b9948884c 100755 --- a/Examples/Tests/langmuir_fluids/analysis_2d.py +++ b/Examples/Tests/langmuir_fluids/analysis_2d.py @@ -13,7 +13,6 @@ # $$ E_x = \epsilon \,\frac{m_e c^2 k_x}{q_e}\sin(k_x x)\cos(k_y y)\cos(k_z z)\sin( \omega_p t)$$ # $$ E_y = \epsilon \,\frac{m_e c^2 k_y}{q_e}\cos(k_x x)\sin(k_y y)\cos(k_z z)\sin( \omega_p t)$$ # $$ E_z = \epsilon \,\frac{m_e c^2 k_z}{q_e}\cos(k_x x)\cos(k_y y)\sin(k_z z)\sin( \omega_p t)$$ -import os import sys import matplotlib.pyplot as plt @@ -25,9 +24,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -177,9 +173,3 @@ def get_theoretical_rho_field(field, t): print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir_fluids/analysis_3d.py b/Examples/Tests/langmuir_fluids/analysis_3d.py index 899dc72424b..6a15c175843 100755 --- a/Examples/Tests/langmuir_fluids/analysis_3d.py +++ b/Examples/Tests/langmuir_fluids/analysis_3d.py @@ -13,7 +13,6 @@ # $$ E_x = \epsilon \,\frac{m_e c^2 k_x}{q_e}\sin(k_x x)\cos(k_y y)\cos(k_z z)\sin( \omega_p t)$$ # $$ E_y = \epsilon \,\frac{m_e c^2 k_y}{q_e}\cos(k_x x)\sin(k_y y)\cos(k_z z)\sin( \omega_p t)$$ # $$ E_z = \epsilon \,\frac{m_e c^2 k_z}{q_e}\cos(k_x x)\cos(k_y y)\sin(k_z z)\sin( \omega_p t)$$ -import os import sys import matplotlib.pyplot as plt @@ -25,9 +24,6 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -211,9 +207,3 @@ def get_theoretical_rho_field(field, t): print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/langmuir_fluids/analysis_default_regression.py b/Examples/Tests/langmuir_fluids/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/langmuir_fluids/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/langmuir_fluids/analysis_rz.py b/Examples/Tests/langmuir_fluids/analysis_rz.py index 0e918a6ab31..de6853db556 100755 --- a/Examples/Tests/langmuir_fluids/analysis_rz.py +++ b/Examples/Tests/langmuir_fluids/analysis_rz.py @@ -14,7 +14,6 @@ # Unrelated to the Langmuir waves, we also test the plotfile particle filter function in this # analysis script. import os -import re import sys import matplotlib @@ -28,17 +27,11 @@ import numpy as np from scipy.constants import c, e, epsilon_0, m_e -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] test_name = os.path.split(os.getcwd())[1] -# Parse test name and check if current correction (psatd.current_correction) is applied -current_correction = True if re.search("current_correction", fn) else False - # Parameters (these parameters must match the parameters in `inputs.multi.rz.rt`) epsilon = 0.01 n = 2.0e24 @@ -225,9 +218,3 @@ def rho(z, r, epsilon, k0, w0, wp, t): print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/larmor/CMakeLists.txt b/Examples/Tests/larmor/CMakeLists.txt index 6a3368a4fca..f089b4dc958 100644 --- a/Examples/Tests/larmor/CMakeLists.txt +++ b/Examples/Tests/larmor/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_larmor # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Tests/laser_injection/CMakeLists.txt b/Examples/Tests/laser_injection/CMakeLists.txt index a15075bb43e..30d18c6d063 100644 --- a/Examples/Tests/laser_injection/CMakeLists.txt +++ b/Examples/Tests/laser_injection/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_laser_injection # inputs - analysis_1d.py # analysis - diags/diag1000240 # output + "analysis_1d.py diags/diag1000240" # analysis + "analysis_default_regression.py --path diags/diag1000240" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_injection # inputs - analysis_2d.py # analysis - diags/diag1000240 # output + "analysis_2d.py diags/diag1000240" # analysis + "analysis_default_regression.py --path diags/diag1000240" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_laser_injection # inputs - analysis_3d.py # analysis - diags/diag1000020 # output + "analysis_3d.py" # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_laser_injection_implicit # inputs - analysis_1d.py # analysis - diags/diag1000240 # output + "analysis_1d.py diags/diag1000240" # analysis + "analysis_default_regression.py --path diags/diag1000240" # checksum OFF # dependency ) @@ -46,7 +46,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_injection_implicit # inputs - analysis_2d.py # analysis - diags/diag1000240 # output + "analysis_2d.py diags/diag1000240" # analysis + "analysis_default_regression.py --path diags/diag1000240" # checksum OFF # dependency ) diff --git a/Examples/Tests/laser_injection/analysis_1d.py b/Examples/Tests/laser_injection/analysis_1d.py index 5ce7065c967..98ce6ca47c5 100755 --- a/Examples/Tests/laser_injection/analysis_1d.py +++ b/Examples/Tests/laser_injection/analysis_1d.py @@ -12,7 +12,6 @@ # the simulation and it compares it with theory. It also checks that the # central frequency of the Fourier transform is the expected one. -import os import sys import matplotlib @@ -23,9 +22,6 @@ import numpy as np from scipy.signal import hilbert -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.05 @@ -192,12 +188,6 @@ def main(): check_laser(filename_end) - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - if __name__ == "__main__": main() diff --git a/Examples/Tests/laser_injection/analysis_2d.py b/Examples/Tests/laser_injection/analysis_2d.py index 5e2d9ebf280..33b87823ebd 100755 --- a/Examples/Tests/laser_injection/analysis_2d.py +++ b/Examples/Tests/laser_injection/analysis_2d.py @@ -17,7 +17,6 @@ # the simulation and it compares it with theory. It also checks that the # central frequency of the Fourier transform is the expected one. -import os import sys import matplotlib @@ -29,9 +28,6 @@ from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.signal import hilbert -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.05 @@ -225,12 +221,6 @@ def main(): check_laser(filename_end) - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - if __name__ == "__main__": main() diff --git a/Examples/Tests/laser_injection/analysis_3d.py b/Examples/Tests/laser_injection/analysis_3d.py index 153b721b526..2ce123169d5 100755 --- a/Examples/Tests/laser_injection/analysis_3d.py +++ b/Examples/Tests/laser_injection/analysis_3d.py @@ -8,26 +8,14 @@ # License: BSD-3-Clause-LBNL -import os -import sys - import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # you can save an image to be displayed on the website t = np.arange(0.0, 2.0, 0.01) s = 1 + np.sin(2 * np.pi * t) plt.plot(t, s) plt.savefig("laser_analysis.png") - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection/analysis_default_regression.py b/Examples/Tests/laser_injection/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/laser_injection/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/laser_injection_from_file/CMakeLists.txt b/Examples/Tests/laser_injection_from_file/CMakeLists.txt index 4b4024b9029..d585160bc8f 100644 --- a/Examples/Tests/laser_injection_from_file/CMakeLists.txt +++ b/Examples/Tests/laser_injection_from_file/CMakeLists.txt @@ -7,7 +7,7 @@ add_warpx_test( 1 # nprocs inputs_test_1d_laser_injection_from_lasy_file_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 1 # dims 1 # nprocs inputs_test_1d_laser_injection_from_lasy_file # inputs - analysis_1d.py # analysis - diags/diag1000251 # output + "analysis_1d.py diags/diag1000251" # analysis + "analysis_default_regression.py --path diags/diag1000251" # checksum test_1d_laser_injection_from_lasy_file_prepare # dependency ) @@ -27,7 +27,7 @@ add_warpx_test( 1 # nprocs inputs_test_1d_laser_injection_from_lasy_file_boost_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 1 # dims 1 # nprocs inputs_test_1d_laser_injection_from_lasy_file_boost # inputs - analysis_1d_boost.py # analysis - diags/diag1000001 # output + "analysis_1d_boost.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum test_1d_laser_injection_from_lasy_file_boost_prepare # dependency ) @@ -47,7 +47,7 @@ add_warpx_test( 1 # nprocs inputs_test_2d_laser_injection_from_binary_file_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -56,8 +56,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_laser_injection_from_binary_file # inputs - analysis_2d_binary.py # analysis - diags/diag1000250 # output + "analysis_2d_binary.py diags/diag1000250" # analysis + "analysis_default_regression.py --path diags/diag1000250" # checksum test_2d_laser_injection_from_binary_file_prepare # dependency ) @@ -67,7 +67,7 @@ add_warpx_test( 1 # nprocs inputs_test_2d_laser_injection_from_lasy_file_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -76,8 +76,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_laser_injection_from_lasy_file # inputs - analysis_2d.py # analysis - diags/diag1000251 # output + "analysis_2d.py diags/diag1000251" # analysis + "analysis_default_regression.py --path diags/diag1000251" # checksum test_2d_laser_injection_from_lasy_file_prepare # dependency ) @@ -87,7 +87,7 @@ add_warpx_test( 1 # nprocs inputs_test_3d_laser_injection_from_lasy_file_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -96,8 +96,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_laser_injection_from_lasy_file # inputs - analysis_3d.py # analysis - diags/diag1000251 # output + "analysis_3d.py diags/diag1000251" # analysis + "analysis_default_regression.py --path diags/diag1000251" # checksum test_3d_laser_injection_from_lasy_file_prepare # dependency ) @@ -107,7 +107,7 @@ add_warpx_test( 1 # nprocs inputs_test_rz_laser_injection_from_lasy_file_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -116,8 +116,8 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_laser_injection_from_lasy_file # inputs - analysis_rz.py # analysis - diags/diag1000252 # output + "analysis_rz.py diags/diag1000252" # analysis + "analysis_default_regression.py --path diags/diag1000252" # checksum test_rz_laser_injection_from_lasy_file_prepare # dependency ) @@ -127,7 +127,7 @@ add_warpx_test( 1 # nprocs inputs_test_rz_laser_injection_from_RZ_lasy_file_prepare.py # inputs OFF # analysis - OFF # output + OFF # checksum OFF # dependency ) @@ -136,7 +136,7 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_laser_injection_from_RZ_lasy_file # inputs - analysis_from_RZ_file.py # analysis - diags/diag1000612 # output + "analysis_from_RZ_file.py diags/diag1000612" # analysis + "analysis_default_regression.py --path diags/diag1000612" # checksum test_rz_laser_injection_from_RZ_lasy_file_prepare # dependency ) diff --git a/Examples/Tests/laser_injection_from_file/analysis_1d.py b/Examples/Tests/laser_injection_from_file/analysis_1d.py index c6542ed1ac8..bd6a78f5949 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_1d.py +++ b/Examples/Tests/laser_injection_from_file/analysis_1d.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 1D, for both envelope and central frequency -import os import sys import matplotlib @@ -27,9 +26,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -112,9 +108,3 @@ def gauss_env(T, Z): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py b/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py index e410369cb45..b51b32714de 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py +++ b/Examples/Tests/laser_injection_from_file/analysis_1d_boost.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 1D, for both envelope and central frequency -import os import sys import matplotlib @@ -27,9 +26,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -112,9 +108,3 @@ def gauss_env(T, Z): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection_from_file/analysis_2d.py b/Examples/Tests/laser_injection_from_file/analysis_2d.py index 1e6704f55a5..21f5c186b7a 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_2d.py +++ b/Examples/Tests/laser_injection_from_file/analysis_2d.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 2D, for both envelope and central frequency -import os import sys import matplotlib @@ -27,9 +26,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -138,9 +134,3 @@ def gauss_env(T, X, Y, Z): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py b/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py index 7fc14824471..d223026a073 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py +++ b/Examples/Tests/laser_injection_from_file/analysis_2d_binary.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 2D, for both envelope and central frequency -import os import sys import matplotlib @@ -26,9 +25,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -145,9 +141,3 @@ def gauss_env(T, XX, ZZ): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection_from_file/analysis_3d.py b/Examples/Tests/laser_injection_from_file/analysis_3d.py index 3921e3d5930..cc19b742134 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_3d.py +++ b/Examples/Tests/laser_injection_from_file/analysis_3d.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in 3D, for both envelope and central frequency -import os import sys import matplotlib @@ -27,9 +26,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -144,9 +140,3 @@ def gauss_env(T, X, Y, Z): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection_from_file/analysis_default_regression.py b/Examples/Tests/laser_injection_from_file/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/laser_injection_from_file/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py b/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py index f797ddb5d90..041e2917ece 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py +++ b/Examples/Tests/laser_injection_from_file/analysis_from_RZ_file.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in RZ, for both envelope and central frequency -import os import sys import matplotlib @@ -28,9 +27,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -146,9 +142,3 @@ def laguerre_env(T, X, Y, Z, p, m): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_injection_from_file/analysis_rz.py b/Examples/Tests/laser_injection_from_file/analysis_rz.py index c37c6d8b3c2..1ad73b34c4b 100755 --- a/Examples/Tests/laser_injection_from_file/analysis_rz.py +++ b/Examples/Tests/laser_injection_from_file/analysis_rz.py @@ -13,7 +13,6 @@ # - Compute the theory for laser envelope at time T # - Compare theory and simulation in RZ, for both envelope and central frequency -import os import sys import matplotlib @@ -27,9 +26,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Maximum acceptable error for this test relative_error_threshold = 0.065 @@ -139,9 +135,3 @@ def gauss_env(T, X, Y, Z): relative_error_freq = np.abs(freq - exp_freq) / exp_freq print("Relative error frequency: ", relative_error_freq) assert relative_error_freq < relative_error_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/laser_on_fine/CMakeLists.txt b/Examples/Tests/laser_on_fine/CMakeLists.txt index 479374137df..9d9e48e54be 100644 --- a/Examples/Tests/laser_on_fine/CMakeLists.txt +++ b/Examples/Tests/laser_on_fine/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_laser_on_fine # inputs - analysis_default_regression.py # analysis - diags/diag1000050 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) diff --git a/Examples/Tests/load_external_field/CMakeLists.txt b/Examples/Tests/load_external_field/CMakeLists.txt index 0713dc877df..8641f307e16 100644 --- a/Examples/Tests/load_external_field/CMakeLists.txt +++ b/Examples/Tests/load_external_field/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_load_external_field_grid_picmi.py # inputs - analysis_3d.py # analysis - diags/diag1000300 # output + "analysis_3d.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_load_external_field_particle_picmi.py # inputs - analysis_3d.py # analysis - diags/diag1000300 # output + "analysis_3d.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_load_external_field_grid # inputs - analysis_rz.py # analysis - diags/diag1000300 # output + "analysis_rz.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_load_external_field_grid_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000300 # output + "analysis_default_restart.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum test_rz_load_external_field_grid # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_load_external_field_particles # inputs - analysis_rz.py # analysis - diags/diag1000300 # output + "analysis_rz.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -56,7 +56,7 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_load_external_field_particles_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000300 # output + "analysis_default_restart.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum test_rz_load_external_field_particles # dependency ) diff --git a/Examples/Tests/load_external_field/analysis_3d.py b/Examples/Tests/load_external_field/analysis_3d.py index 05cba3ea7bd..433a4bad5e8 100755 --- a/Examples/Tests/load_external_field/analysis_3d.py +++ b/Examples/Tests/load_external_field/analysis_3d.py @@ -16,15 +16,11 @@ # tolerance: 1.0e-8 # Possible running time: 2.756646401 s -import os import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 1.0e-8 x0 = 0.12238072 y0 = 0.00965394 @@ -43,9 +39,3 @@ print("error = ", error) print("tolerance = ", tolerance) assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/load_external_field/analysis_default_regression.py b/Examples/Tests/load_external_field/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/load_external_field/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/load_external_field/analysis_rz.py b/Examples/Tests/load_external_field/analysis_rz.py index 7de160cdd50..e5601647d4a 100755 --- a/Examples/Tests/load_external_field/analysis_rz.py +++ b/Examples/Tests/load_external_field/analysis_rz.py @@ -16,15 +16,11 @@ # tolerance: 1.0e-8 # Possible running time: 0.327827743 s -import os import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 1.0e-8 r0 = 0.12402005 z0 = 4.3632492 @@ -40,9 +36,3 @@ print("error = ", error) print("tolerance = ", tolerance) assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/magnetostatic_eb/CMakeLists.txt b/Examples/Tests/magnetostatic_eb/CMakeLists.txt index 3eb2da03136..5c0a87fd10a 100644 --- a/Examples/Tests/magnetostatic_eb/CMakeLists.txt +++ b/Examples/Tests/magnetostatic_eb/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_magnetostatic_eb # inputs - analysis_default_regression.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_magnetostatic_eb_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) endif() @@ -31,8 +31,8 @@ if(WarpX_EB) RZ # dims 1 # nprocs inputs_test_rz_magnetostatic_eb_picmi.py # inputs - analysis_rz.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001 --skip-particles" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/magnetostatic_eb/analysis_rz.py b/Examples/Tests/magnetostatic_eb/analysis_rz.py deleted file mode 100755 index f31069ad230..00000000000 --- a/Examples/Tests/magnetostatic_eb/analysis_rz.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - do_particles=False, -) diff --git a/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt b/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt index 2c65c0a6ecb..c02d8abc567 100644 --- a/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt +++ b/Examples/Tests/maxwell_hybrid_qed/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_maxwell_hybrid_qed_solver # inputs - analysis.py # analysis - diags/diag1000300 # output + "analysis.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/maxwell_hybrid_qed/analysis_default_regression.py b/Examples/Tests/maxwell_hybrid_qed/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/maxwell_hybrid_qed/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/nci_fdtd_stability/CMakeLists.txt b/Examples/Tests/nci_fdtd_stability/CMakeLists.txt index e58e5bfb58f..9af4034c3ca 100644 --- a/Examples/Tests/nci_fdtd_stability/CMakeLists.txt +++ b/Examples/Tests/nci_fdtd_stability/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_nci_corrector # inputs - analysis_ncicorr.py # analysis - diags/diag1000600 # output + "analysis_ncicorr.py diags/diag1000600" # analysis + "analysis_default_regression.py --path diags/diag1000600" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_nci_corrector_mr # inputs - analysis_ncicorr.py # analysis - diags/diag1000600 # output + "analysis_ncicorr.py diags/diag1000600" # analysis + "analysis_default_regression.py --path diags/diag1000600" # checksum OFF # dependency ) diff --git a/Examples/Tests/nci_fdtd_stability/analysis_default_regression.py b/Examples/Tests/nci_fdtd_stability/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/nci_fdtd_stability/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/nci_fdtd_stability/analysis_ncicorr.py b/Examples/Tests/nci_fdtd_stability/analysis_ncicorr.py index ad635bf0fbe..290cdea819f 100755 --- a/Examples/Tests/nci_fdtd_stability/analysis_ncicorr.py +++ b/Examples/Tests/nci_fdtd_stability/analysis_ncicorr.py @@ -8,7 +8,6 @@ # License: BSD-3-Clause-LBNL -import os import re import sys @@ -18,9 +17,6 @@ yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - fn = sys.argv[1] use_MR = re.search("nci_correctorMR", fn) is not None @@ -49,9 +45,3 @@ print("energy from this run: %s" % energy) assert energy < energy_threshold - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/nci_psatd_stability/CMakeLists.txt b/Examples/Tests/nci_psatd_stability/CMakeLists.txt index f2b4ceae8ba..210fb13f542 100644 --- a/Examples/Tests/nci_psatd_stability/CMakeLists.txt +++ b/Examples/Tests/nci_psatd_stability/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_averaged_galilean_psatd # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_averaged_galilean_psatd_hybrid # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -31,8 +31,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_comoving_psatd_hybrid # inputs - analysis_default_regression.py # analysis - diags/diag1000400 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000400" # checksum OFF # dependency ) endif() @@ -43,8 +43,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_galilean_psatd # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -55,8 +55,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_galilean_psatd_current_correction # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -67,8 +67,8 @@ if(WarpX_FFT) 2 # dims 1 # nprocs inputs_test_2d_galilean_psatd_current_correction_psb # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -79,8 +79,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_galilean_psatd_hybrid # inputs - analysis_default_regression.py # analysis - diags/diag1000400 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000400" # checksum OFF # dependency ) endif() @@ -91,8 +91,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_averaged_galilean_psatd # inputs - analysis_galilean.py # analysis - diags/diag1000160 # output + "analysis_galilean.py diags/diag1000160" # analysis + "analysis_default_regression.py --path diags/diag1000160 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -103,8 +103,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_averaged_galilean_psatd_hybrid # inputs - analysis_galilean.py # analysis - diags/diag1000160 # output + "analysis_galilean.py diags/diag1000160" # analysis + "analysis_default_regression.py --path diags/diag1000160 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -115,8 +115,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_galilean_psatd # inputs - analysis_galilean.py # analysis - diags/diag1000300 # output + "analysis_galilean.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -127,8 +127,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_galilean_psatd_current_correction # inputs - analysis_galilean.py # analysis - diags/diag1000300 # output + "analysis_galilean.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -139,8 +139,8 @@ if(WarpX_FFT) 3 # dims 1 # nprocs inputs_test_3d_galilean_psatd_current_correction_psb # inputs - analysis_galilean.py # analysis - diags/diag1000300 # output + "analysis_galilean.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -151,8 +151,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_uniform_plasma_multiJ # inputs - analysis_multiJ.py # analysis - diags/diag1000300 # output + "analysis_multiJ.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) endif() @@ -163,8 +163,8 @@ if(WarpX_FFT) RZ # dims 1 # nprocs inputs_test_rz_galilean_psatd # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -175,8 +175,8 @@ if(WarpX_FFT) RZ # dims 2 # nprocs inputs_test_rz_galilean_psatd_current_correction # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -187,8 +187,8 @@ if(WarpX_FFT) RZ # dims 1 # nprocs inputs_test_rz_galilean_psatd_current_correction_psb # inputs - analysis_galilean.py # analysis - diags/diag1000400 # output + "analysis_galilean.py diags/diag1000400" # analysis + "analysis_default_regression.py --path diags/diag1000400 --rtol 1e-8" # checksum OFF # dependency ) endif() @@ -199,8 +199,8 @@ if(WarpX_FFT) RZ # dims 2 # nprocs inputs_test_rz_multiJ_psatd # inputs - analysis_default_regression.py # analysis - diags/diag1000025 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000025" # checksum OFF # dependency ) label_warpx_test(test_rz_multiJ_psatd slow) diff --git a/Examples/Tests/nci_psatd_stability/analysis_galilean.py b/Examples/Tests/nci_psatd_stability/analysis_galilean.py index 99f14d91371..43bdaedabbf 100755 --- a/Examples/Tests/nci_psatd_stability/analysis_galilean.py +++ b/Examples/Tests/nci_psatd_stability/analysis_galilean.py @@ -13,7 +13,6 @@ (suppressed by the Galilean PSATD method, without or with averaging, respectively). """ -import os import re import sys @@ -22,8 +21,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -117,10 +114,3 @@ print(f"err_charge = {err_charge}") print(f"tol_charge = {tol_charge}") assert err_charge < tol_charge - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=1e-8, -) diff --git a/Examples/Tests/nci_psatd_stability/analysis_multiJ.py b/Examples/Tests/nci_psatd_stability/analysis_multiJ.py index 6dcfb6565fe..19ba722781b 100755 --- a/Examples/Tests/nci_psatd_stability/analysis_multiJ.py +++ b/Examples/Tests/nci_psatd_stability/analysis_multiJ.py @@ -10,7 +10,6 @@ both J and rho constant in time, and with divergence cleaning). """ -import os import sys import numpy as np @@ -18,8 +17,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -49,9 +46,3 @@ print(f"err_energy = {err_energy}") print(f"tol_energy = {tol_energy}") assert err_energy < tol_energy - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/nodal_electrostatic/CMakeLists.txt b/Examples/Tests/nodal_electrostatic/CMakeLists.txt index a6b3f5b0102..026ab1a34bc 100644 --- a/Examples/Tests/nodal_electrostatic/CMakeLists.txt +++ b/Examples/Tests/nodal_electrostatic/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_nodal_electrostatic_solver # inputs - analysis.py # analysis - diags/diag1000010 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) label_warpx_test(test_3d_nodal_electrostatic_solver slow) diff --git a/Examples/Tests/nodal_electrostatic/analysis.py b/Examples/Tests/nodal_electrostatic/analysis.py index f015d525280..b6d22d60a79 100755 --- a/Examples/Tests/nodal_electrostatic/analysis.py +++ b/Examples/Tests/nodal_electrostatic/analysis.py @@ -1,13 +1,7 @@ #!/usr/bin/env python3 -import os -import sys - import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # check that the maximum chi value is small fname = "diags/reducedfiles/ParticleExtrema_beam_p.txt" chi_max = np.loadtxt(fname)[:, 19] @@ -17,9 +11,3 @@ fname = "diags/reducedfiles/ParticleNumber.txt" pho_num = np.loadtxt(fname)[:, 7] assert pho_num.all() == 0.0 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/nodal_electrostatic/analysis_default_regression.py b/Examples/Tests/nodal_electrostatic/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/nodal_electrostatic/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/nuclear_fusion/CMakeLists.txt b/Examples/Tests/nuclear_fusion/CMakeLists.txt index c3ee8848e59..74d937601bd 100644 --- a/Examples/Tests/nuclear_fusion/CMakeLists.txt +++ b/Examples/Tests/nuclear_fusion/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_proton_boron_fusion # inputs - analysis_proton_boron_fusion.py # analysis - diags/diag1000001 # output + "analysis_proton_boron_fusion.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_deuterium_deuterium_fusion # inputs - analysis_two_product_fusion.py # analysis - diags/diag1000001 # output + "analysis_two_product_fusion.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_deuterium_deuterium_fusion_intraspecies # inputs - analysis_deuterium_deuterium_3d_intraspecies.py # analysis - diags/diag1000010 # output + "analysis_deuterium_deuterium_3d_intraspecies.py" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_deuterium_tritium_fusion # inputs - analysis_two_product_fusion.py # analysis - diags/diag1000001 # output + "analysis_two_product_fusion.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_proton_boron_fusion # inputs - analysis_proton_boron_fusion.py # analysis - diags/diag1000001 # output + "analysis_proton_boron_fusion.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -56,7 +56,7 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_deuterium_tritium_fusion # inputs - analysis_two_product_fusion.py # analysis - diags/diag1000001 # output + "analysis_two_product_fusion.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) diff --git a/Examples/Tests/nuclear_fusion/analysis_default_regression.py b/Examples/Tests/nuclear_fusion/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/nuclear_fusion/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/nuclear_fusion/analysis_deuterium_deuterium_3d_intraspecies.py b/Examples/Tests/nuclear_fusion/analysis_deuterium_deuterium_3d_intraspecies.py index 8ae0e768815..2b06a8c3f25 100755 --- a/Examples/Tests/nuclear_fusion/analysis_deuterium_deuterium_3d_intraspecies.py +++ b/Examples/Tests/nuclear_fusion/analysis_deuterium_deuterium_3d_intraspecies.py @@ -23,14 +23,8 @@ # Nuclear fusion, 32(4), p.611. # DOI: https://doi.org/10.1088/0029-5515/32/4/I07 -import os -import sys - import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Load data from reduced diagnostics (physical time and neutron weights) time = np.loadtxt("./reduced_diags/particle_number.txt", usecols=1) neutron = np.loadtxt("./reduced_diags/particle_number.txt", usecols=9) @@ -48,9 +42,3 @@ print("error = ", error) print("tolerance = ", tolerance) assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py b/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py index c69080ac726..917cd86f258 100755 --- a/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py +++ b/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py @@ -5,16 +5,12 @@ # # License: BSD-3-Clause-LBNL -import os import re import sys -import yt - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import numpy as np import scipy.constants as scc -from checksumAPI import evaluate_checksum +import yt ## This script performs various checks for the proton boron nuclear fusion module. The simulation ## that we check is made of 5 different tests, each with different proton, boron and alpha species. @@ -880,12 +876,6 @@ def main(): rho_end = field_data_end["rho"].to_ndarray() check_charge_conservation(rho_start, rho_end) - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - if __name__ == "__main__": main() diff --git a/Examples/Tests/nuclear_fusion/analysis_two_product_fusion.py b/Examples/Tests/nuclear_fusion/analysis_two_product_fusion.py index 1a458a25e4a..38ab699a3a4 100755 --- a/Examples/Tests/nuclear_fusion/analysis_two_product_fusion.py +++ b/Examples/Tests/nuclear_fusion/analysis_two_product_fusion.py @@ -5,16 +5,12 @@ # # License: BSD-3-Clause-LBNL -import os import re import sys -import yt - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import numpy as np import scipy.constants as scc -from checksumAPI import evaluate_checksum +import yt ## This script performs various checks for the fusion module. The simulation ## that we check is made of 2 different tests, each with different reactant and product species. @@ -555,12 +551,6 @@ def main(): rho_end = field_data_end["rho"].to_ndarray() check_charge_conservation(rho_start, rho_end) - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - if __name__ == "__main__": main() diff --git a/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt b/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt index a08c321d88d..03843fe29f6 100644 --- a/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt +++ b/Examples/Tests/ohm_solver_em_modes/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs "inputs_test_1d_ohm_solver_em_modes_picmi.py --test --dim 1 --bdir z" # inputs - analysis.py # analysis - diags/field_diag000250 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/field_diag000250" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( RZ # dims 2 # nprocs "inputs_test_rz_ohm_solver_em_modes_picmi.py --test" # inputs - analysis_rz.py # analysis - diags/diag1000100 # output + "analysis_rz.py" # analysis + "analysis_default_regression.py --path diags/diag1000100 --rtol 1e-6" # checksum OFF # dependency ) label_warpx_test(test_rz_ohm_solver_em_modes_picmi slow) diff --git a/Examples/Tests/ohm_solver_em_modes/analysis.py b/Examples/Tests/ohm_solver_em_modes/analysis.py index bee634415d9..e2075944932 100755 --- a/Examples/Tests/ohm_solver_em_modes/analysis.py +++ b/Examples/Tests/ohm_solver_em_modes/analysis.py @@ -347,16 +347,3 @@ def get_analytic_L_mode(w): ) if not sim.test: plt.show() - -if sim.test: - import os - import sys - - sys.path.insert(1, "../../../../warpx/Regression/Checksum/") - from checksumAPI import evaluate_checksum - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) diff --git a/Examples/Tests/ohm_solver_em_modes/analysis_default_regression.py b/Examples/Tests/ohm_solver_em_modes/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/ohm_solver_em_modes/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/ohm_solver_em_modes/analysis_rz.py b/Examples/Tests/ohm_solver_em_modes/analysis_rz.py index a1eb185bbf6..841e1177630 100755 --- a/Examples/Tests/ohm_solver_em_modes/analysis_rz.py +++ b/Examples/Tests/ohm_solver_em_modes/analysis_rz.py @@ -181,17 +181,3 @@ def process(it): assert np.allclose( amps, np.array([61.02377286, 19.80026021, 100.47687017, 10.83331295]) ) - -if sim.test: - import os - import sys - - sys.path.insert(1, "../../../../warpx/Regression/Checksum/") - from checksumAPI import evaluate_checksum - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=1e-6, - ) diff --git a/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt b/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt index 501b1ce2ced..a57ef7bb922 100644 --- a/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt +++ b/Examples/Tests/ohm_solver_ion_Landau_damping/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs "inputs_test_2d_ohm_solver_landau_damping_picmi.py --test --dim 2 --temp_ratio 0.1" # inputs - analysis.py # analysis - diags/diag1000100 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) label_warpx_test(test_2d_ohm_solver_landau_damping_picmi slow) diff --git a/Examples/Tests/ohm_solver_ion_Landau_damping/analysis.py b/Examples/Tests/ohm_solver_ion_Landau_damping/analysis.py index 620331cf13f..bd193260f2f 100755 --- a/Examples/Tests/ohm_solver_ion_Landau_damping/analysis.py +++ b/Examples/Tests/ohm_solver_ion_Landau_damping/analysis.py @@ -111,16 +111,3 @@ ax1.set_title(f"Ion Landau damping - {sim.dim}d") plt.tight_layout() plt.savefig(f"diags/ion_Landau_damping_T_ratio_{sim.T_ratio}.png") - -if sim.test: - import os - import sys - - sys.path.insert(1, "../../../../warpx/Regression/Checksum/") - from checksumAPI import evaluate_checksum - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) diff --git a/Examples/Tests/ohm_solver_ion_Landau_damping/analysis_default_regression.py b/Examples/Tests/ohm_solver_ion_Landau_damping/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/ohm_solver_ion_Landau_damping/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt b/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt index 81c6b0d41fd..288f8e32e53 100644 --- a/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt +++ b/Examples/Tests/ohm_solver_ion_beam_instability/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs "inputs_test_1d_ohm_solver_ion_beam_picmi.py --test --dim 1 --resonant" # inputs - analysis.py # analysis - diags/diag1002500 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1002500" # checksum OFF # dependency ) label_warpx_test(test_1d_ohm_solver_ion_beam_picmi slow) diff --git a/Examples/Tests/ohm_solver_ion_beam_instability/analysis.py b/Examples/Tests/ohm_solver_ion_beam_instability/analysis.py index 3b0a18f29d5..978b8b9a731 100755 --- a/Examples/Tests/ohm_solver_ion_beam_instability/analysis.py +++ b/Examples/Tests/ohm_solver_ion_beam_instability/analysis.py @@ -230,16 +230,3 @@ assert np.isclose(m4_rms_error, 1.515, atol=0.01) assert np.isclose(m5_rms_error, 0.718, atol=0.01) assert np.isclose(m6_rms_error, 0.357, atol=0.01) - - # checksum check - import os - import sys - - sys.path.insert(1, "../../../../warpx/Regression/Checksum/") - from checksumAPI import evaluate_checksum - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) diff --git a/Examples/Tests/ohm_solver_ion_beam_instability/analysis_default_regression.py b/Examples/Tests/ohm_solver_ion_beam_instability/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/ohm_solver_ion_beam_instability/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt b/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt index cef47a7d95e..02b4f5e3cb9 100644 --- a/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt +++ b/Examples/Tests/ohm_solver_magnetic_reconnection/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs "inputs_test_2d_ohm_solver_magnetic_reconnection_picmi.py --test" # inputs - analysis.py # analysis - diags/diag1000020 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) diff --git a/Examples/Tests/ohm_solver_magnetic_reconnection/analysis.py b/Examples/Tests/ohm_solver_magnetic_reconnection/analysis.py index e7b41d4fbb4..84ab7140fd4 100755 --- a/Examples/Tests/ohm_solver_magnetic_reconnection/analysis.py +++ b/Examples/Tests/ohm_solver_magnetic_reconnection/analysis.py @@ -184,16 +184,3 @@ def animate(i): writervideo = FFMpegWriter(fps=14) anim.save("diags/mag_reconnection.mp4", writer=writervideo) - -if sim.test: - import os - import sys - - sys.path.insert(1, "../../../../warpx/Regression/Checksum/") - from checksumAPI import evaluate_checksum - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) diff --git a/Examples/Tests/ohm_solver_magnetic_reconnection/analysis_default_regression.py b/Examples/Tests/ohm_solver_magnetic_reconnection/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/ohm_solver_magnetic_reconnection/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt b/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt index c5ec4583da1..94fe240263c 100644 --- a/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt +++ b/Examples/Tests/open_bc_poisson_solver/CMakeLists.txt @@ -7,8 +7,20 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_open_bc_poisson_solver # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000001 --rtol 1e-2" # checksum + OFF # dependency + ) +endif() + +if(WarpX_FFT) + add_warpx_test( + test_3d_open_bc_poisson_solver_sliced # name + 3 # dims + 2 # nprocs + inputs_test_3d_open_bc_poisson_solver_sliced # inputs + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1000001 --rtol 1e-2" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/open_bc_poisson_solver/analysis.py b/Examples/Tests/open_bc_poisson_solver/analysis.py index 8ffd9ef52e2..fda9da96cf6 100755 --- a/Examples/Tests/open_bc_poisson_solver/analysis.py +++ b/Examples/Tests/open_bc_poisson_solver/analysis.py @@ -1,16 +1,12 @@ #!/usr/bin/env python3 import os -import sys import numpy as np from openpmd_viewer import OpenPMDTimeSeries from scipy.constants import epsilon_0, pi from scipy.special import erf -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - sigmaz = 300e-6 sigmax = 516e-9 sigmay = 7.7e-9 @@ -60,11 +56,3 @@ def evaluate_E(x, y, z): assert np.allclose(Ex_warpx, Ex_theory, rtol=0.032, atol=0) assert np.allclose(Ey_warpx, Ey_theory, rtol=0.029, atol=0) - - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=1e-2, -) diff --git a/Examples/Tests/open_bc_poisson_solver/analysis_default_regression.py b/Examples/Tests/open_bc_poisson_solver/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/open_bc_poisson_solver/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/open_bc_poisson_solver/inputs_test_3d_open_bc_poisson_solver_sliced b/Examples/Tests/open_bc_poisson_solver/inputs_test_3d_open_bc_poisson_solver_sliced new file mode 100644 index 00000000000..e2639c59e74 --- /dev/null +++ b/Examples/Tests/open_bc_poisson_solver/inputs_test_3d_open_bc_poisson_solver_sliced @@ -0,0 +1,3 @@ +FILE = inputs_test_3d_open_bc_poisson_solver + +warpx.use_2d_slices_fft_solver = 1 diff --git a/Examples/Tests/particle_boundary_interaction/CMakeLists.txt b/Examples/Tests/particle_boundary_interaction/CMakeLists.txt index 5bbb34c0d95..56739cf636b 100644 --- a/Examples/Tests/particle_boundary_interaction/CMakeLists.txt +++ b/Examples/Tests/particle_boundary_interaction/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_particle_boundary_interaction_picmi.py # inputs - analysis.py # analysis - diags/diag1/ # output + "analysis.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/particle_boundary_interaction/analysis.py b/Examples/Tests/particle_boundary_interaction/analysis.py index d06200157d2..062569d5553 100755 --- a/Examples/Tests/particle_boundary_interaction/analysis.py +++ b/Examples/Tests/particle_boundary_interaction/analysis.py @@ -8,7 +8,6 @@ An input file inputs_test_rz_particle_boundary_interaction_picmi.py is used. """ -import os import sys import numpy as np @@ -16,8 +15,6 @@ from openpmd_viewer import OpenPMDTimeSeries yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Open plotfile specified in command line filename = sys.argv[1] @@ -49,10 +46,3 @@ assert ( (diff_x < tolerance) and (y[0] < 1e-8) and (diff_z < tolerance) ), "Test particle_boundary_interaction did not pass" - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Tests/particle_boundary_interaction/analysis_default_regression.py b/Examples/Tests/particle_boundary_interaction/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particle_boundary_interaction/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particle_boundary_process/CMakeLists.txt b/Examples/Tests/particle_boundary_process/CMakeLists.txt index 499cf445da5..d99121afea0 100644 --- a/Examples/Tests/particle_boundary_process/CMakeLists.txt +++ b/Examples/Tests/particle_boundary_process/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_particle_reflection_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -17,8 +17,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_particle_absorption # inputs - analysis_absorption.py # analysis - diags/diag1000060 # output + "analysis_absorption.py diags/diag1000060" # analysis + "analysis_default_regression.py --path diags/diag1000060" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/particle_boundary_process/analysis_absorption.py b/Examples/Tests/particle_boundary_process/analysis_absorption.py index 79e8d0e4bc6..498a456d871 100755 --- a/Examples/Tests/particle_boundary_process/analysis_absorption.py +++ b/Examples/Tests/particle_boundary_process/analysis_absorption.py @@ -6,14 +6,10 @@ # absence of the cube, none of the particles would have had time to exit # the problem domain yet. -import os import sys import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # all particles are still there ds40 = yt.load("diags/diag1000040") np40 = ds40.index.particle_headers["electrons"].num_particles @@ -24,9 +20,3 @@ ds60 = yt.load(filename) np60 = ds60.index.particle_headers["electrons"].num_particles assert np60 == 0 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/particle_boundary_scrape/CMakeLists.txt b/Examples/Tests/particle_boundary_scrape/CMakeLists.txt index 9b303afcc0f..5d2c52f30e0 100644 --- a/Examples/Tests/particle_boundary_scrape/CMakeLists.txt +++ b/Examples/Tests/particle_boundary_scrape/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_particle_scrape # inputs - analysis_scrape.py # analysis - diags/diag1000060 # output + "analysis_scrape.py diags/diag1000060" # analysis + "analysis_default_regression.py --path diags/diag1000060" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_particle_scrape_picmi.py # inputs - analysis_scrape.py # analysis - diags/diag1000060 # output + "analysis_scrape.py diags/diag1000060" # analysis + "analysis_default_regression.py --path diags/diag1000060" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/particle_boundary_scrape/analysis_default_regression.py b/Examples/Tests/particle_boundary_scrape/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particle_boundary_scrape/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particle_data_python/CMakeLists.txt b/Examples/Tests/particle_data_python/CMakeLists.txt index e58fe72670a..6bae89fd41b 100644 --- a/Examples/Tests/particle_data_python/CMakeLists.txt +++ b/Examples/Tests/particle_data_python/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_particle_attr_access_picmi.py # inputs - analysis.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs "inputs_test_2d_particle_attr_access_picmi.py --unique" # inputs - analysis.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -26,7 +26,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_prev_positions_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Tests/particle_data_python/analysis.py b/Examples/Tests/particle_data_python/analysis.py deleted file mode 100755 index 0b0cce3295b..00000000000 --- a/Examples/Tests/particle_data_python/analysis.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2021 Modern Electron -# -# License: BSD-3-Clause-LBNL - -# This script just checks that the PICMI file executed successfully. -# If it did there will be a plotfile for the final step. - -import sys - -step = int(sys.argv[1][-5:]) - -assert step == 10 diff --git a/Examples/Tests/particle_fields_diags/CMakeLists.txt b/Examples/Tests/particle_fields_diags/CMakeLists.txt index a83818b6966..414d303629a 100644 --- a/Examples/Tests/particle_fields_diags/CMakeLists.txt +++ b/Examples/Tests/particle_fields_diags/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_particle_fields_diags # inputs - analysis_particle_diags.py # analysis - diags/diag1000200 # output + "analysis_particle_diags.py diags/diag1000200" # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( # test_3d_particle_fields_diags_single_precision # name # 3 # dims # 2 # nprocs -## inputs_test_3d_particle_fields_diags # inputs -# analysis_particle_diags_single.py # analysis -# diags/diag1000200 # output +# inputs_test_3d_particle_fields_diags # inputs +# "analysis_particle_diags_single.py diags/diag1000200" # analysis +# "analysis_default_regression.py --path diags/diag1000200 --rtol 1e-3" # checksum # OFF # dependency #) diff --git a/Examples/Tests/particle_fields_diags/analysis_default_regression.py b/Examples/Tests/particle_fields_diags/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particle_fields_diags/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particle_fields_diags/analysis_particle_diags_impl.py b/Examples/Tests/particle_fields_diags/analysis_particle_diags_impl.py index 01a7436a787..f59e0aed8bf 100755 --- a/Examples/Tests/particle_fields_diags/analysis_particle_diags_impl.py +++ b/Examples/Tests/particle_fields_diags/analysis_particle_diags_impl.py @@ -11,7 +11,6 @@ # Various particle and field quantities are written to file using the reduced diagnostics # and compared with the corresponding quantities computed from the data in the plotfiles. -import os import sys import numpy as np @@ -19,9 +18,6 @@ import yt from scipy.constants import c, e, m_e, m_p -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - def do_analysis(single_precision=False): fn = sys.argv[1] @@ -228,8 +224,6 @@ def do_analysis(single_precision=False): error_plt = dict() error_opmd = dict() tolerance = 5e-3 if single_precision else 1e-12 - # if single precision, increase tolerance from default value - check_tolerance = 5e-3 if single_precision else 1e-9 for k in values_yt.keys(): # check that the zeros line up, since we'll be ignoring them in the error calculation @@ -247,10 +241,3 @@ def do_analysis(single_precision=False): ) assert error_opmd[k] < tolerance print(k, "relative error openPMD = ", error_opmd[k]) - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=check_tolerance, - ) diff --git a/Examples/Tests/particle_pusher/CMakeLists.txt b/Examples/Tests/particle_pusher/CMakeLists.txt index 3d8f1496587..cd414316b67 100644 --- a/Examples/Tests/particle_pusher/CMakeLists.txt +++ b/Examples/Tests/particle_pusher/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_particle_pusher # inputs - analysis.py # analysis - diags/diag1010000 # output + "analysis.py diags/diag1010000" # analysis + "analysis_default_regression.py --path diags/diag1010000" # checksum OFF # dependency ) diff --git a/Examples/Tests/particle_pusher/analysis.py b/Examples/Tests/particle_pusher/analysis.py index 9ed92507d4d..ae7b2054c28 100755 --- a/Examples/Tests/particle_pusher/analysis.py +++ b/Examples/Tests/particle_pusher/analysis.py @@ -22,14 +22,10 @@ # tolerance: 0.001 # Possible running time: ~ 4.0 s -import os import sys import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 0.001 filename = sys.argv[1] @@ -40,9 +36,3 @@ print("error = ", abs(x)) print("tolerance = ", tolerance) assert abs(x) < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/particle_pusher/analysis_default_regression.py b/Examples/Tests/particle_pusher/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particle_pusher/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particle_thermal_boundary/CMakeLists.txt b/Examples/Tests/particle_thermal_boundary/CMakeLists.txt index eeae6660e02..2f0cbba4ee6 100644 --- a/Examples/Tests/particle_thermal_boundary/CMakeLists.txt +++ b/Examples/Tests/particle_thermal_boundary/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_particle_thermal_boundary # inputs - analysis.py # analysis - diags/diag1002000 # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1002000" # checksum OFF # dependency ) diff --git a/Examples/Tests/particle_thermal_boundary/analysis.py b/Examples/Tests/particle_thermal_boundary/analysis.py index 621bf2032be..81f8a73b474 100755 --- a/Examples/Tests/particle_thermal_boundary/analysis.py +++ b/Examples/Tests/particle_thermal_boundary/analysis.py @@ -14,14 +14,8 @@ beyond 2% in the time that it takes all particles to cross the domain boundary """ -import os -import sys - import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - FE_rdiag = "./diags/reducedfiles/EF.txt" init_Fenergy = np.loadtxt(FE_rdiag)[1, 2] final_Fenergy = np.loadtxt(FE_rdiag)[-1, 2] @@ -32,9 +26,3 @@ init_Penergy = np.loadtxt(PE_rdiag)[0, 2] final_Penergy = np.loadtxt(PE_rdiag)[-1, 2] assert abs(final_Penergy - init_Penergy) / init_Penergy < 0.02 - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/particle_thermal_boundary/analysis_default_regression.py b/Examples/Tests/particle_thermal_boundary/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particle_thermal_boundary/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particles_in_pml/CMakeLists.txt b/Examples/Tests/particles_in_pml/CMakeLists.txt index fb539461ec2..4f150c6d4e4 100644 --- a/Examples/Tests/particles_in_pml/CMakeLists.txt +++ b/Examples/Tests/particles_in_pml/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_particles_in_pml # inputs - analysis_particles_in_pml.py # analysis - diags/diag1000180 # output + "analysis_particles_in_pml.py diags/diag1000180" # analysis + "analysis_default_regression.py --path diags/diag1000180" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_particles_in_pml_mr # inputs - analysis_particles_in_pml.py # analysis - diags/diag1000300 # output + "analysis_particles_in_pml.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_particles_in_pml # inputs - analysis_particles_in_pml.py # analysis - diags/diag1000120 # output + "analysis_particles_in_pml.py diags/diag1000120" # analysis + "analysis_default_regression.py --path diags/diag1000120" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_particles_in_pml_mr # inputs - analysis_particles_in_pml.py # analysis - diags/diag1000200 # output + "analysis_particles_in_pml.py diags/diag1000200" # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) label_warpx_test(test_3d_particles_in_pml_mr slow) diff --git a/Examples/Tests/particles_in_pml/analysis_default_regression.py b/Examples/Tests/particles_in_pml/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/particles_in_pml/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/particles_in_pml/analysis_particles_in_pml.py b/Examples/Tests/particles_in_pml/analysis_particles_in_pml.py index 8e7d95eda08..63ef4c7d2ff 100755 --- a/Examples/Tests/particles_in_pml/analysis_particles_in_pml.py +++ b/Examples/Tests/particles_in_pml/analysis_particles_in_pml.py @@ -18,14 +18,11 @@ charge, with associated fields, behind them. """ -import os import sys import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Open plotfile specified in command line filename = sys.argv[1] @@ -66,9 +63,3 @@ print("tolerance_abs: " + str(tolerance_abs)) assert max_Efield < tolerance_abs - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/pass_mpi_communicator/CMakeLists.txt b/Examples/Tests/pass_mpi_communicator/CMakeLists.txt index ac60636b931..4f5a8b4965c 100644 --- a/Examples/Tests/pass_mpi_communicator/CMakeLists.txt +++ b/Examples/Tests/pass_mpi_communicator/CMakeLists.txt @@ -10,7 +10,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_pass_mpi_comm_picmi.py # inputs - OFF #analysis.py # analysis - OFF # output + OFF # analysis + OFF # checksum OFF # dependency ) diff --git a/Examples/Tests/pass_mpi_communicator/analysis_default_regression.py b/Examples/Tests/pass_mpi_communicator/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/pass_mpi_communicator/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/pec/CMakeLists.txt b/Examples/Tests/pec/CMakeLists.txt index e0bab40d058..f331249ded0 100644 --- a/Examples/Tests/pec/CMakeLists.txt +++ b/Examples/Tests/pec/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_pec_field # inputs - analysis_pec.py # analysis - diags/diag1000125 # output + "analysis_pec.py diags/diag1000125" # analysis + "analysis_default_regression.py --path diags/diag1000125" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_pec_field_mr # inputs - analysis_pec_mr.py # analysis - diags/diag1000125 # output + "analysis_pec_mr.py diags/diag1000125" # analysis + "analysis_default_regression.py --path diags/diag1000125" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_pec_particle # inputs - analysis_default_regression.py # analysis - diags/diag1000020 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000020" # checksum OFF # dependency ) @@ -36,7 +36,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_pec_field_insulator # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) diff --git a/Examples/Tests/pec/analysis_pec.py b/Examples/Tests/pec/analysis_pec.py index 29d9a4e26f4..251a17e017c 100755 --- a/Examples/Tests/pec/analysis_pec.py +++ b/Examples/Tests/pec/analysis_pec.py @@ -11,7 +11,6 @@ # The electric field (Ey) is a standing wave due to the PEC boundary condition, # and as a result, the minimum and maximum value after reflection would be two times the value at initialization due to constructive interference. # Additionally, the value of Ey at the boundary must be equal to zero. -import os import sys import matplotlib @@ -24,9 +23,6 @@ import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -89,9 +85,3 @@ assert max_Ey_error_rel < tolerance_rel assert min_Ey_error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/pec/analysis_pec_mr.py b/Examples/Tests/pec/analysis_pec_mr.py index 069a1d01afa..a99c4b0bafb 100755 --- a/Examples/Tests/pec/analysis_pec_mr.py +++ b/Examples/Tests/pec/analysis_pec_mr.py @@ -11,7 +11,6 @@ # The electric field (Ey) is a standing wave due to the PEC boundary condition, # and as a result, the minimum and maximum value after reflection would be two times the value at initialization due to constructive interference. # Additionally, the value of Ey at the boundary must be equal to zero. -import os import sys import matplotlib @@ -24,9 +23,6 @@ import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # this will be the name of the plot file fn = sys.argv[1] @@ -89,9 +85,3 @@ assert max_Ey_error_rel < tolerance_rel assert min_Ey_error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/photon_pusher/CMakeLists.txt b/Examples/Tests/photon_pusher/CMakeLists.txt index 7926d8faeaf..78bc1d0b416 100644 --- a/Examples/Tests/photon_pusher/CMakeLists.txt +++ b/Examples/Tests/photon_pusher/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_photon_pusher # inputs - analysis.py # analysis - diags/diag1000050 # output + "analysis.py diags/diag1000050" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) diff --git a/Examples/Tests/photon_pusher/analysis.py b/Examples/Tests/photon_pusher/analysis.py index 2a77e325bc5..e2ccfc42656 100755 --- a/Examples/Tests/photon_pusher/analysis.py +++ b/Examples/Tests/photon_pusher/analysis.py @@ -7,15 +7,11 @@ # # License: BSD-3-Clause-LBNL -import os import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # This script checks if photons initialized with different momenta and # different initial directions propagate along straight lines at the speed of # light. The plotfile to be analyzed is passed as a command line argument. @@ -153,12 +149,6 @@ def check(): assert (max(disc_pos) <= tol_pos) and (max(disc_mom) <= tol_mom) - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - # This function generates the input file to test the photon pusher. def generate(): diff --git a/Examples/Tests/photon_pusher/analysis_default_regression.py b/Examples/Tests/photon_pusher/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/photon_pusher/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/plasma_lens/CMakeLists.txt b/Examples/Tests/plasma_lens/CMakeLists.txt index bc13ae433bc..f6d6ea6daeb 100644 --- a/Examples/Tests/plasma_lens/CMakeLists.txt +++ b/Examples/Tests/plasma_lens/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_lens # inputs - analysis.py # analysis - diags/diag1000084 # output + "analysis.py diags/diag1000084" # analysis + "analysis_default_regression.py --path diags/diag1000084" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_lens_boosted # inputs - analysis.py # analysis - diags/diag1000084 # output + "analysis.py diags/diag1000084" # analysis + "analysis_default_regression.py --path diags/diag1000084" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_lens_hard_edged # inputs - analysis.py # analysis - diags/diag1000084 # output + "analysis.py diags/diag1000084" # analysis + "analysis_default_regression.py --path diags/diag1000084" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_lens_picmi.py # inputs - analysis.py # analysis - diags/diag1000084 # output + "analysis.py diags/diag1000084" # analysis + "analysis_default_regression.py --path diags/diag1000084" # checksum OFF # dependency ) @@ -46,7 +46,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_plasma_lens_short # inputs - analysis.py # analysis - diags/diag1000084 # output + "analysis.py diags/diag1000084" # analysis + "analysis_default_regression.py --path diags/diag1000084" # checksum OFF # dependency ) diff --git a/Examples/Tests/plasma_lens/analysis.py b/Examples/Tests/plasma_lens/analysis.py index 46036573940..44671eea791 100755 --- a/Examples/Tests/plasma_lens/analysis.py +++ b/Examples/Tests/plasma_lens/analysis.py @@ -15,8 +15,6 @@ The motion is slow enough that relativistic effects are ignored. """ -import os -import re import sys import numpy as np @@ -24,8 +22,6 @@ from scipy.constants import c, e, m_e yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] ds = yt.load(filename) @@ -194,11 +190,3 @@ def applylens(x0, vx0, vz0, gamma, lens_length, lens_strength): assert abs(np.abs((uy - uy_sim) / uy)) < velocity_tolerance, Exception( "error in y particle velocity" ) - -# compare checksums -test_name = os.path.split(os.getcwd())[1] -test_name = re.sub("_picmi", "", test_name) # same checksums for PICMI test -evaluate_checksum( - test_name=test_name, - output_file=sys.argv[1], -) diff --git a/Examples/Tests/plasma_lens/analysis_default_regression.py b/Examples/Tests/plasma_lens/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/plasma_lens/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/pml/CMakeLists.txt b/Examples/Tests/pml/CMakeLists.txt index c63412dc763..8ba70f77aef 100644 --- a/Examples/Tests/pml/CMakeLists.txt +++ b/Examples/Tests/pml/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_pml_x_ckc # inputs - analysis_pml_ckc.py # analysis - diags/diag1000300 # output + "analysis_pml_ckc.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -17,8 +17,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_pml_x_galilean # inputs - analysis_pml_psatd.py # analysis - diags/diag1000300 # output + "analysis_pml_psatd.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) endif() @@ -29,8 +29,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_pml_x_psatd # inputs - analysis_pml_psatd.py # analysis - diags/diag1000300 # output + "analysis_pml_psatd.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) endif() @@ -41,8 +41,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_pml_x_psatd_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000300 # output + "analysis_default_restart.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum test_2d_pml_x_psatd # dependency ) endif() @@ -52,8 +52,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_pml_x_yee # inputs - analysis_pml_yee.py # analysis - diags/diag1000300 # output + "analysis_pml_yee.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum OFF # dependency ) @@ -62,8 +62,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_pml_x_yee_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000300 # output + "analysis_default_restart.py diags/diag1000300" # analysis + "analysis_default_regression.py --path diags/diag1000300" # checksum test_2d_pml_x_yee # dependency ) @@ -73,8 +73,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_pml_psatd_dive_divb_cleaning # inputs - analysis_default_regression.py # analysis - diags/diag1000100 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) endif() @@ -85,8 +85,8 @@ if(WarpX_FFT) RZ # dims 2 # nprocs inputs_test_rz_pml_psatd # inputs - analysis_pml_psatd_rz.py # analysis - diags/diag1000500 # output + "analysis_pml_psatd_rz.py diags/diag1000500" # analysis + "analysis_default_regression.py --path diags/diag1000500" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/pml/analysis_pml_ckc.py b/Examples/Tests/pml/analysis_pml_ckc.py index f6637e2d47b..b50cbb867e6 100755 --- a/Examples/Tests/pml/analysis_pml_ckc.py +++ b/Examples/Tests/pml/analysis_pml_ckc.py @@ -8,7 +8,6 @@ # License: BSD-3-Clause-LBNL -import os import sys import numpy as np @@ -16,8 +15,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -56,9 +53,3 @@ print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/pml/analysis_pml_psatd.py b/Examples/Tests/pml/analysis_pml_psatd.py index 4f44c0f3432..156f58362ce 100755 --- a/Examples/Tests/pml/analysis_pml_psatd.py +++ b/Examples/Tests/pml/analysis_pml_psatd.py @@ -16,8 +16,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -74,9 +72,3 @@ print("reflectivity_max = " + str(reflectivity_max)) assert reflectivity < reflectivity_max - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/pml/analysis_pml_psatd_rz.py b/Examples/Tests/pml/analysis_pml_psatd_rz.py index fb662e36d40..f06b7a52c6c 100755 --- a/Examples/Tests/pml/analysis_pml_psatd_rz.py +++ b/Examples/Tests/pml/analysis_pml_psatd_rz.py @@ -16,15 +16,12 @@ the pulse will remain with in the domain. """ -import os import sys import numpy as np import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Open plotfile specified in command line filename = sys.argv[1] @@ -54,9 +51,3 @@ tolerance_abs = 2.0 print("tolerance_abs: " + str(tolerance_abs)) assert max_Efield < tolerance_abs - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/pml/analysis_pml_yee.py b/Examples/Tests/pml/analysis_pml_yee.py index 5f6d21e579c..b6aad4ccb7e 100755 --- a/Examples/Tests/pml/analysis_pml_yee.py +++ b/Examples/Tests/pml/analysis_pml_yee.py @@ -8,7 +8,6 @@ # License: BSD-3-Clause-LBNL -import os import sys import numpy as np @@ -16,8 +15,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -56,9 +53,3 @@ print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/point_of_contact_eb/CMakeLists.txt b/Examples/Tests/point_of_contact_eb/CMakeLists.txt index b8d7ba1131f..700eba6f92f 100644 --- a/Examples/Tests/point_of_contact_eb/CMakeLists.txt +++ b/Examples/Tests/point_of_contact_eb/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 3 # dims 2 # nprocs inputs_test_3d_point_of_contact_eb # inputs - analysis.py # analysis - diags/diag1/ # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_point_of_contact_eb # inputs - analysis.py # analysis - diags/diag1/ # output + "analysis.py" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/point_of_contact_eb/analysis.py b/Examples/Tests/point_of_contact_eb/analysis.py index 1c9dbc85f4c..55a65f2cee3 100755 --- a/Examples/Tests/point_of_contact_eb/analysis.py +++ b/Examples/Tests/point_of_contact_eb/analysis.py @@ -8,16 +8,11 @@ An input file inputs_test_3d_point_of_contact_eb is used. """ -import os -import sys - import numpy as np import yt from openpmd_viewer import OpenPMDTimeSeries yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum ts_scraping = OpenPMDTimeSeries("./diags/diag2/particles_at_eb/") @@ -92,10 +87,3 @@ and (diff_ny < tolerance_n) and (np.abs(nz) < 1e-8) ), "Test point_of_contact did not pass" - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - output_format="openpmd", -) diff --git a/Examples/Tests/point_of_contact_eb/analysis_default_regression.py b/Examples/Tests/point_of_contact_eb/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/point_of_contact_eb/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/projection_divb_cleaner/CMakeLists.txt b/Examples/Tests/projection_divb_cleaner/CMakeLists.txt index 307ae7656c5..40b84bd0397 100644 --- a/Examples/Tests/projection_divb_cleaner/CMakeLists.txt +++ b/Examples/Tests/projection_divb_cleaner/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_projection_divb_cleaner_callback_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 1 # nprocs inputs_test_3d_projection_divb_cleaner_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000001 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -26,7 +26,7 @@ add_warpx_test( RZ # dims 1 # nprocs inputs_test_rz_projection_divb_cleaner # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) diff --git a/Examples/Tests/projection_divb_cleaner/analysis.py b/Examples/Tests/projection_divb_cleaner/analysis.py index 2324c370032..5db145eba7e 100755 --- a/Examples/Tests/projection_divb_cleaner/analysis.py +++ b/Examples/Tests/projection_divb_cleaner/analysis.py @@ -16,15 +16,11 @@ # tolerance: 1.0e-8 # Possible running time: 0.327827743 s -import os import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 4e-3 filename = sys.argv[1] @@ -72,9 +68,3 @@ print("error = ", error) print("tolerance = ", tolerance) assert error < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/python_wrappers/CMakeLists.txt b/Examples/Tests/python_wrappers/CMakeLists.txt index 0045a181606..060cdd7c183 100644 --- a/Examples/Tests/python_wrappers/CMakeLists.txt +++ b/Examples/Tests/python_wrappers/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_python_wrappers_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000100 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000100" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/qed/CMakeLists.txt b/Examples/Tests/qed/CMakeLists.txt index 5dd786f26a1..d38c2e4fc69 100644 --- a/Examples/Tests/qed/CMakeLists.txt +++ b/Examples/Tests/qed/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_qed_breit_wheeler # inputs - analysis_breit_wheeler_yt.py # analysis - diags/diag1000002 # output + "analysis_breit_wheeler_yt.py diags/diag1000002" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_qed_breit_wheeler_opmd # inputs - analysis_breit_wheeler_opmd.py # analysis - diags/diag1/ # output + "analysis_breit_wheeler_opmd.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_qed_quantum_sync # inputs - analysis_quantum_sync.py # analysis - diags/diag1000002 # output + "analysis_quantum_sync.py diags/diag1000002" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_breit_wheeler # inputs - analysis_breit_wheeler_yt.py # analysis - diags/diag1000002 # output + "analysis_breit_wheeler_yt.py diags/diag1000002" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -46,8 +46,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_breit_wheeler_opmd # inputs - analysis_breit_wheeler_opmd.py # analysis - diags/diag1/ # output + "analysis_breit_wheeler_opmd.py diags/diag1/" # analysis + "analysis_default_regression.py --path diags/diag1/" # checksum OFF # dependency ) @@ -56,8 +56,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_quantum_sync # inputs - analysis_quantum_sync.py # analysis - diags/diag1000002 # output + "analysis_quantum_sync.py diags/diag1000002" # analysis + "analysis_default_regression.py --path diags/diag1000002" # checksum OFF # dependency ) @@ -66,8 +66,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_schwinger_1 # inputs - analysis_schwinger.py # analysis - diags/diag1000001 # output + "analysis_schwinger.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -76,8 +76,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_schwinger_2 # inputs - analysis_schwinger.py # analysis - diags/diag1000001 # output + "analysis_schwinger.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -86,8 +86,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_schwinger_3 # inputs - analysis_schwinger.py # analysis - diags/diag1000001 # output + "analysis_schwinger.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -96,7 +96,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_qed_schwinger_4 # inputs - analysis_schwinger.py # analysis - diags/diag1000001 # output + "analysis_schwinger.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) diff --git a/Examples/Tests/qed/analysis_breit_wheeler_opmd.py b/Examples/Tests/qed/analysis_breit_wheeler_opmd.py index b88f00a85dc..1803305f008 100755 --- a/Examples/Tests/qed/analysis_breit_wheeler_opmd.py +++ b/Examples/Tests/qed/analysis_breit_wheeler_opmd.py @@ -12,10 +12,6 @@ import analysis_breit_wheeler_core as ac import openpmd_api as io -# sys.path.insert(1, '../../../../warpx/Regression/Checksum/') -# from checksumAPI import evaluate_checksum - - # This script is a frontend for the analysis routines # in analysis_breit_wheeler_core.py (please refer to this file for # a full description). It reads output files in openPMD @@ -72,13 +68,6 @@ def main(): ac.check(dt, particle_data) - # compare checksums - # evaluate_checksum( - # test_name=os.path.split(os.getcwd())[1], - # output_file=sys.argv[1], - # output_format="openpmd", - # ) - if __name__ == "__main__": main() diff --git a/Examples/Tests/qed/analysis_breit_wheeler_yt.py b/Examples/Tests/qed/analysis_breit_wheeler_yt.py index 48c45c990b0..bd8f4454723 100755 --- a/Examples/Tests/qed/analysis_breit_wheeler_yt.py +++ b/Examples/Tests/qed/analysis_breit_wheeler_yt.py @@ -7,14 +7,10 @@ # -*- coding: utf-8 -*- -import os import sys -import yt - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") import analysis_breit_wheeler_core as ac -from checksumAPI import evaluate_checksum +import yt # This script is a frontend for the analysis routines # in analysis_breit_wheeler_core.py (please refer to this file for @@ -58,12 +54,6 @@ def main(): ac.check(dt, particle_data) - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - if __name__ == "__main__": main() diff --git a/Examples/Tests/qed/analysis_default_regression.py b/Examples/Tests/qed/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/qed/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/qed/analysis_quantum_sync.py b/Examples/Tests/qed/analysis_quantum_sync.py index 531a0eac195..e4ede19260c 100755 --- a/Examples/Tests/qed/analysis_quantum_sync.py +++ b/Examples/Tests/qed/analysis_quantum_sync.py @@ -8,19 +8,15 @@ # -*- coding: utf-8 -*- -import os import sys +import matplotlib.pyplot as plt import numpy as np import scipy.integrate as integ import scipy.special as spe import scipy.stats as st import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -import matplotlib.pyplot as plt -from checksumAPI import evaluate_checksum - # This script performs detailed checks of the Quantum Synchrotron photon emission process. # Two electron populations and two positron populations are initialized with different momenta in different # directions in a background EM field (with non-zero components along each direction). @@ -348,12 +344,6 @@ def check(): print("*************\n") - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - def main(): check() diff --git a/Examples/Tests/qed/analysis_schwinger.py b/Examples/Tests/qed/analysis_schwinger.py index 4ad21e3d518..5d1c5485ba3 100755 --- a/Examples/Tests/qed/analysis_schwinger.py +++ b/Examples/Tests/qed/analysis_schwinger.py @@ -18,9 +18,6 @@ import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # define some parameters c = 299792458.0 @@ -160,9 +157,3 @@ def do_analysis(Ex, Ey, Ez, Bx, By, Bz): do_analysis(Ex_test, Ey_test, Ez_test, Bx_test, By_test, Bz_test) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/radiation_reaction/CMakeLists.txt b/Examples/Tests/radiation_reaction/CMakeLists.txt index 8696cf0f9b7..3286f4efd93 100644 --- a/Examples/Tests/radiation_reaction/CMakeLists.txt +++ b/Examples/Tests/radiation_reaction/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_radiation_reaction # inputs - analysis.py # analysis - diags/diag1000064 # output + "analysis.py diags/diag1000064" # analysis + "analysis_default_regression.py --path diags/diag1000064" # checksum OFF # dependency ) diff --git a/Examples/Tests/radiation_reaction/analysis.py b/Examples/Tests/radiation_reaction/analysis.py index 74155a89cb3..0d4fcf12e8e 100755 --- a/Examples/Tests/radiation_reaction/analysis.py +++ b/Examples/Tests/radiation_reaction/analysis.py @@ -30,15 +30,11 @@ # 3) H. Spohn, Dynamics of charged particles and their radiation field # (Cambridge University Press, Cambridge, 2004) -import os import sys import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Input filename inputname = "inputs" # ________________________________________ @@ -163,12 +159,6 @@ def check(): assert error_rel < tolerance_rel - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - ) - def generate(): with open(inputname, "w") as f: diff --git a/Examples/Tests/radiation_reaction/analysis_default_regression.py b/Examples/Tests/radiation_reaction/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/radiation_reaction/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/reduced_diags/CMakeLists.txt b/Examples/Tests/reduced_diags/CMakeLists.txt index cd4f6392892..743afa79df5 100644 --- a/Examples/Tests/reduced_diags/CMakeLists.txt +++ b/Examples/Tests/reduced_diags/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_reduced_diags # inputs - analysis_reduced_diags.py # analysis - diags/diag1000200 # output + "analysis_reduced_diags.py diags/diag1000200" # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_reduced_diags_load_balance_costs_heuristic # inputs - analysis_reduced_diags_load_balance_costs.py # analysis - diags/diag1000003 # output + "analysis_reduced_diags_load_balance_costs.py diags/diag1000003" # analysis + "analysis_default_regression.py --path diags/diag1000003" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_reduced_diags_load_balance_costs_timers # inputs - analysis_reduced_diags_load_balance_costs.py # analysis - diags/diag1000003 # output + "analysis_reduced_diags_load_balance_costs.py diags/diag1000003" # analysis + "analysis_default_regression.py --path diags/diag1000003" # checksum OFF # dependency ) @@ -36,8 +36,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_reduced_diags_load_balance_costs_timers_picmi.py # inputs - analysis_reduced_diags_load_balance_costs.py # analysis - diags/diag1000003 # output + "analysis_reduced_diags_load_balance_costs.py diags/diag1000003" # analysis + "analysis_default_regression.py --path diags/diag1000003" # checksum OFF # dependency ) @@ -47,8 +47,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_reduced_diags_load_balance_costs_timers_psatd # inputs - analysis_reduced_diags_load_balance_costs.py # analysis - diags/diag1000003 # output + "analysis_reduced_diags_load_balance_costs.py diags/diag1000003" # analysis + "analysis_default_regression.py --path diags/diag1000003" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/reduced_diags/analysis_default_regression.py b/Examples/Tests/reduced_diags/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/reduced_diags/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py b/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py index 42916d34568..e0c1fe1d1b3 100755 --- a/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py +++ b/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py @@ -11,7 +11,6 @@ # Various particle and field quantities are written to file using the reduced diagnostics # and compared with the corresponding quantities computed from the data in the plotfiles. -import os import sys import numpy as np @@ -20,9 +19,6 @@ from scipy.constants import epsilon_0 as eps0 from scipy.constants import mu_0 as mu0 -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # gamma threshold to switch between the relativistic expression of # the kinetic energy and its Taylor expansion. gamma_relativistic_threshold = 1.005 @@ -375,10 +371,3 @@ def do_analysis(single_precision=False): tol = field_energy_tolerance if (k == "field energy") else tolerance assert error[k] < tol print() - - # compare checksums - evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - rtol=1e-9, - ) diff --git a/Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py b/Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py index 49a0018baa5..978b1fcd4ec 100755 --- a/Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py +++ b/Examples/Tests/reduced_diags/analysis_reduced_diags_load_balance_costs.py @@ -17,15 +17,10 @@ # Possible running time: ~ 1 s -import os -import re import sys import numpy as np -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Command line argument fn = sys.argv[1] @@ -76,11 +71,3 @@ def get_efficiency(i): # The load balanced case is expected to be more efficient # than non-load balanced case assert efficiency_before < efficiency_after - -# compare checksums -test_name = os.path.split(os.getcwd())[1] -test_name = re.sub("_picmi", "", test_name) # same checksums for PICMI test -evaluate_checksum( - test_name=test_name, - output_file=sys.argv[1], -) diff --git a/Examples/Tests/reduced_diags/analysis_reduced_diags_single.py b/Examples/Tests/reduced_diags/analysis_reduced_diags_single.py deleted file mode 100755 index d900ec673c1..00000000000 --- a/Examples/Tests/reduced_diags/analysis_reduced_diags_single.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright 2019-2021 Luca Fedeli, Yinjian Zhao -# -# This file is part of WarpX. -# -# License: BSD-3-Clause-LBNL - -# This script tests the reduced diagnostics. -# The setup is a uniform plasma with electrons, protons and photons. -# Various particle and field quantities are written to file using the reduced diagnostics -# and compared with the corresponding quantities computed from the data in the plotfiles. - -import analysis_reduced_diags_impl as an - -an.do_analysis(single_precision=True) diff --git a/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt b/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt index d89fb8b31b6..df73a264429 100644 --- a/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt +++ b/Examples/Tests/relativistic_space_charge_initialization/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_relativistic_space_charge_initialization # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001 --skip-particles" # checksum OFF # dependency ) diff --git a/Examples/Tests/relativistic_space_charge_initialization/analysis.py b/Examples/Tests/relativistic_space_charge_initialization/analysis.py index ef0a87dce92..beb2b889ed7 100755 --- a/Examples/Tests/relativistic_space_charge_initialization/analysis.py +++ b/Examples/Tests/relativistic_space_charge_initialization/analysis.py @@ -12,7 +12,6 @@ the expected theoretical field. """ -import os import sys import matplotlib @@ -24,8 +23,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Parameters from the Simulation Qtot = -1.0e-20 @@ -94,10 +91,3 @@ def check(E, E_th, label): check(Ex_array, Ex_th, "Ex") - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - do_particles=False, -) diff --git a/Examples/Tests/relativistic_space_charge_initialization/analysis_default_regression.py b/Examples/Tests/relativistic_space_charge_initialization/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/relativistic_space_charge_initialization/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/repelling_particles/CMakeLists.txt b/Examples/Tests/repelling_particles/CMakeLists.txt index 056f670a860..e5b64cb9166 100644 --- a/Examples/Tests/repelling_particles/CMakeLists.txt +++ b/Examples/Tests/repelling_particles/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_repelling_particles # inputs - analysis.py # analysis - diags/diag1000200 # output + "analysis.py diags/diag1000200" # analysis + "analysis_default_regression.py --path diags/diag1000200" # checksum OFF # dependency ) diff --git a/Examples/Tests/repelling_particles/analysis.py b/Examples/Tests/repelling_particles/analysis.py index 74bde7b68ca..5f052361fc7 100755 --- a/Examples/Tests/repelling_particles/analysis.py +++ b/Examples/Tests/repelling_particles/analysis.py @@ -24,7 +24,6 @@ """ import glob -import os import re import sys @@ -35,9 +34,6 @@ yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Check plotfile name specified in command line last_filename = sys.argv[1] filename_radical = re.findall(r"(.*?)\d+/*$", last_filename)[0] @@ -78,9 +74,3 @@ # Check that the results are close to the theory assert np.allclose(beta1[1:], beta_th[1:], atol=0.01) assert np.allclose(-beta2[1:], beta_th[1:], atol=0.01) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/repelling_particles/analysis_default_regression.py b/Examples/Tests/repelling_particles/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/repelling_particles/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/resampling/CMakeLists.txt b/Examples/Tests/resampling/CMakeLists.txt index 46e34858014..b6f8c5baecf 100644 --- a/Examples/Tests/resampling/CMakeLists.txt +++ b/Examples/Tests/resampling/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_resample_velocity_coincidence_thinning # inputs - analysis_default_regression.py # analysis - diags/diag1000004 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000004" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_resample_velocity_coincidence_thinning_cartesian # inputs - analysis_default_regression.py # analysis - diags/diag1000004 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000004" # checksum OFF # dependency ) @@ -26,7 +26,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_leveling_thinning # inputs - analysis.py # analysis - diags/diag1000008 # output + "analysis.py diags/diag1000008" # analysis + "analysis_default_regression.py --path diags/diag1000008" # checksum OFF # dependency ) diff --git a/Examples/Tests/resampling/analysis.py b/Examples/Tests/resampling/analysis.py index 40bad24d65e..8fff4a04a9c 100755 --- a/Examples/Tests/resampling/analysis.py +++ b/Examples/Tests/resampling/analysis.py @@ -9,16 +9,12 @@ ## In this test, we check that leveling thinning works as expected on two simple cases. Each case ## corresponds to a different particle species. -import os import sys import numpy as np import yt from scipy.special import erf -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - fn_final = sys.argv[1] fn0 = fn_final[:-4] + "0000" @@ -170,9 +166,3 @@ assert numparts_unaffected == numparts_unaffected_anticipated # Check that particles with weight higher than level weight are unaffected by resampling. assert np.all(w[-numparts_unaffected:] == w0[-numparts_unaffected:]) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/restart/CMakeLists.txt b/Examples/Tests/restart/CMakeLists.txt index df5b1239a01..1be7f2d5fa7 100644 --- a/Examples/Tests/restart/CMakeLists.txt +++ b/Examples/Tests/restart/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_id_cpu_read_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 1 # nprocs inputs_test_2d_runtime_components_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -27,8 +27,8 @@ add_warpx_test( 2 # dims 1 # nprocs "inputs_test_2d_runtime_components_picmi.py amr.restart='../test_2d_runtime_components_picmi/diags/chk000005'" # inputs - OFF #analysis_default_restart.py # analysis - OFF #diags/diag1000010 # output + OFF #"analysis_default_restart.py diags/diag1000010" # analysis + OFF #"analysis_default_regression.py --path diags/diag1000010" # checksum test_2d_runtime_components_picmi # dependency ) @@ -37,8 +37,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_acceleration # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) @@ -47,8 +47,8 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_acceleration_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000010 # output + "analysis_default_restart.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum test_3d_acceleration # dependency ) @@ -58,8 +58,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_acceleration_psatd # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) endif() @@ -70,8 +70,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_acceleration_psatd_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000010 # output + "analysis_default_restart.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum test_3d_acceleration_psatd # dependency ) endif() @@ -82,8 +82,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_acceleration_psatd_time_avg # inputs - analysis_default_regression.py # analysis - diags/diag1000010 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum OFF # dependency ) endif() @@ -94,8 +94,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_acceleration_psatd_time_avg_restart # inputs - analysis_default_restart.py # analysis - diags/diag1000010 # output + "analysis_default_restart.py diags/diag1000010" # analysis + "analysis_default_regression.py --path diags/diag1000010" # checksum test_3d_acceleration_psatd_time_avg # dependency ) endif() diff --git a/Examples/Tests/restart/analysis_restart.py b/Examples/Tests/restart/analysis_restart.py deleted file mode 100755 index 26a05da90f2..00000000000 --- a/Examples/Tests/restart/analysis_restart.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -filename = sys.argv[1] - -# Check restart data v. original data -sys.path.insert(0, "../../../../warpx/Examples/") -from analysis_default_restart import check_restart - -check_restart(filename) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/restart_eb/CMakeLists.txt b/Examples/Tests/restart_eb/CMakeLists.txt index 50f808c3e1f..0c685340c4c 100644 --- a/Examples/Tests/restart_eb/CMakeLists.txt +++ b/Examples/Tests/restart_eb/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) 3 # dims 1 # nprocs inputs_test_3d_eb_picmi.py # inputs - analysis_default_regression.py # analysis - diags/diag1000060 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000060" # checksum OFF # dependency ) endif() @@ -19,9 +19,9 @@ endif() # test_3d_eb_picmi_restart # name # 3 # dims # 1 # nprocs -## "inputs_test_3d_eb_picmi.py amr.restart='../test_3d_eb_picmi/diags/chk000030'" # inputs -# analysis_default_restart.py # analysis -# diags/diag1000060 # output +# "inputs_test_3d_eb_picmi.py amr.restart='../test_3d_eb_picmi/diags/chk000030'" # inputs +# "analysis_default_restart.py diags/diag1000060" # analysis +# "analysis_default_regression.py --path diags/diag1000060" # checksum # test_3d_eb_picmi # dependency # ) #endif() diff --git a/Examples/Tests/rigid_injection/CMakeLists.txt b/Examples/Tests/rigid_injection/CMakeLists.txt index 21004c3248c..ca0a84a87ef 100644 --- a/Examples/Tests/rigid_injection/CMakeLists.txt +++ b/Examples/Tests/rigid_injection/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_rigid_injection_btd # inputs - analysis_rigid_injection_btd.py # analysis - diags/diag1000001 # output + "analysis_rigid_injection_btd.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_rigid_injection_lab # inputs - analysis_rigid_injection_lab.py # analysis - diags/diag1000289 # output + "analysis_rigid_injection_lab.py diags/diag1000289" # analysis + "analysis_default_regression.py --path diags/diag1000289" # checksum OFF # dependency ) diff --git a/Examples/Tests/rigid_injection/analysis_default_regression.py b/Examples/Tests/rigid_injection/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/rigid_injection/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py b/Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py index 759c211b42d..d87a680a819 100755 --- a/Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py +++ b/Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py @@ -20,7 +20,6 @@ frame, i.e., on the back-transformed diagnostics. """ -import os import sys import numpy as np @@ -29,9 +28,6 @@ yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - filename = sys.argv[1] # Tolerances to check consistency between plotfile BTD and openPMD BTD @@ -80,9 +76,3 @@ print(f"error = {err}") print(f"tolerance = {tol}") assert err < tol - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py b/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py index 91e2bed1ed0..69fbe4cc537 100755 --- a/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py +++ b/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py @@ -23,15 +23,12 @@ with the gaussian_beam injection style. """ -import os import sys import numpy as np import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -101,9 +98,3 @@ def remove_rigid_lines(plotfile, nlines_if_rigid): center = ad_start["beam", "particle_center"] assert np.array_equal(z, orig_z) assert np.array_equal(1 * (np.abs(x) < 5.0e-7), center) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/scraping/CMakeLists.txt b/Examples/Tests/scraping/CMakeLists.txt index a0fd04b6b3f..71897e85b88 100644 --- a/Examples/Tests/scraping/CMakeLists.txt +++ b/Examples/Tests/scraping/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_scraping # inputs - analysis_rz.py # analysis - diags/diag1000037 # output + "analysis_rz.py diags/diag1000037" # analysis + "analysis_default_regression.py --path diags/diag1000037" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_EB) RZ # dims 2 # nprocs inputs_test_rz_scraping_filter # inputs - analysis_rz_filter.py # analysis - diags/diag1000037 # output + "analysis_rz_filter.py diags/diag1000037" # analysis + "analysis_default_regression.py --path diags/diag1000037" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/scraping/analysis_default_regression.py b/Examples/Tests/scraping/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/scraping/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/scraping/analysis_rz.py b/Examples/Tests/scraping/analysis_rz.py index aa0038dbcf5..c5b60350cb8 100755 --- a/Examples/Tests/scraping/analysis_rz.py +++ b/Examples/Tests/scraping/analysis_rz.py @@ -20,16 +20,12 @@ # tolerance: 0 # Possible running time: < 1 s -import os import sys import numpy as np import yt from openpmd_viewer import OpenPMDTimeSeries -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - tolerance = 0 fn = sys.argv[1] @@ -82,10 +78,3 @@ def n_scraped_particles(iteration): assert np.all( np.sort(id_initial) == np.sort(id_final) ) # Sort because particles may not be in the same order - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - do_particles=False, -) diff --git a/Examples/Tests/silver_mueller/CMakeLists.txt b/Examples/Tests/silver_mueller/CMakeLists.txt index 7866d23dc1f..6cdeeffac6f 100644 --- a/Examples/Tests/silver_mueller/CMakeLists.txt +++ b/Examples/Tests/silver_mueller/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 1 # dims 2 # nprocs inputs_test_1d_silver_mueller # inputs - analysis.py # analysis - diags/diag1000500 # output + "analysis.py diags/diag1000500" # analysis + "analysis_default_regression.py --path diags/diag1000500" # checksum OFF # dependency ) @@ -16,8 +16,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_silver_mueller_x # inputs - analysis.py # analysis - diags/diag1000500 # output + "analysis.py diags/diag1000500" # analysis + "analysis_default_regression.py --path diags/diag1000500" # checksum OFF # dependency ) @@ -26,8 +26,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_silver_mueller_z # inputs - analysis.py # analysis - diags/diag1000500 # output + "analysis.py diags/diag1000500" # analysis + "analysis_default_regression.py --path diags/diag1000500" # checksum OFF # dependency ) @@ -36,7 +36,7 @@ add_warpx_test( RZ # dims 2 # nprocs inputs_test_rz_silver_mueller_z # inputs - analysis.py # analysis - diags/diag1000500 # output + "analysis.py diags/diag1000500" # analysis + "analysis_default_regression.py --path diags/diag1000500" # checksum OFF # dependency ) diff --git a/Examples/Tests/silver_mueller/analysis.py b/Examples/Tests/silver_mueller/analysis.py index aee27131bc9..678c5e4186a 100755 --- a/Examples/Tests/silver_mueller/analysis.py +++ b/Examples/Tests/silver_mueller/analysis.py @@ -11,7 +11,6 @@ test check that the reflected field at the boundary is negligible. """ -import os import re import sys @@ -19,8 +18,6 @@ import yt yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum filename = sys.argv[1] @@ -50,9 +47,3 @@ assert np.all(abs(Ex) < max_reflection_amplitude) assert np.all(abs(Ey) < max_reflection_amplitude) assert np.all(abs(Ez) < max_reflection_amplitude) - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/silver_mueller/analysis_default_regression.py b/Examples/Tests/silver_mueller/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/silver_mueller/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/single_particle/CMakeLists.txt b/Examples/Tests/single_particle/CMakeLists.txt index bee870f0b17..fb823b39431 100644 --- a/Examples/Tests/single_particle/CMakeLists.txt +++ b/Examples/Tests/single_particle/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_bilinear_filter # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) diff --git a/Examples/Tests/single_particle/analysis.py b/Examples/Tests/single_particle/analysis.py index 4127663e14d..efd3f36cfdf 100755 --- a/Examples/Tests/single_particle/analysis.py +++ b/Examples/Tests/single_particle/analysis.py @@ -7,7 +7,6 @@ # License: BSD-3-Clause-LBNL -import os import sys import numpy as np @@ -15,8 +14,6 @@ from scipy import signal yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Build Jx without filter. This can be obtained by running this test without # a filter, e.g., execute @@ -65,9 +62,3 @@ print("tolerance_rel: " + str(tolerance_rel)) assert error_rel < tolerance_rel - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/single_particle/analysis_default_regression.py b/Examples/Tests/single_particle/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/single_particle/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/space_charge_initialization/CMakeLists.txt b/Examples/Tests/space_charge_initialization/CMakeLists.txt index 6ca1f4ad04c..00f9a5462fd 100644 --- a/Examples/Tests/space_charge_initialization/CMakeLists.txt +++ b/Examples/Tests/space_charge_initialization/CMakeLists.txt @@ -6,8 +6,8 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_space_charge_initialization # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001 --skip-particles" # checksum OFF # dependency ) @@ -16,7 +16,7 @@ add_warpx_test( 3 # dims 2 # nprocs inputs_test_3d_space_charge_initialization # inputs - analysis.py # analysis - diags/diag1000001 # output + "analysis.py diags/diag1000001" # analysis + "analysis_default_regression.py --path diags/diag1000001 --skip-particles" # checksum OFF # dependency ) diff --git a/Examples/Tests/space_charge_initialization/analysis.py b/Examples/Tests/space_charge_initialization/analysis.py index d63ba8f7334..b8e5e689a87 100755 --- a/Examples/Tests/space_charge_initialization/analysis.py +++ b/Examples/Tests/space_charge_initialization/analysis.py @@ -12,7 +12,6 @@ the expected theoretical field. """ -import os import sys import matplotlib @@ -25,8 +24,6 @@ from scipy.special import gammainc yt.funcs.mylog.setLevel(0) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum # Parameters from the Simulation Qtot = -1.0e-20 @@ -123,10 +120,3 @@ def check(E, E_th, label): check(Ey_array, Ey_th, "Ey") if ds.dimensionality == 3: check(Ez_array, Ez_th, "Ez") - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], - do_particles=False, -) diff --git a/Examples/Tests/space_charge_initialization/analysis_default_regression.py b/Examples/Tests/space_charge_initialization/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/space_charge_initialization/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/Tests/subcycling/CMakeLists.txt b/Examples/Tests/subcycling/CMakeLists.txt index 688f54ac01c..503c9f24f34 100644 --- a/Examples/Tests/subcycling/CMakeLists.txt +++ b/Examples/Tests/subcycling/CMakeLists.txt @@ -6,7 +6,7 @@ add_warpx_test( 2 # dims 2 # nprocs inputs_test_2d_subcycling_mr # inputs - analysis_default_regression.py # analysis - diags/diag1000250 # output + OFF # analysis + "analysis_default_regression.py --path diags/diag1000250" # checksum OFF # dependency ) diff --git a/Examples/Tests/vay_deposition/CMakeLists.txt b/Examples/Tests/vay_deposition/CMakeLists.txt index ce8d51d3c2a..86108530b1d 100644 --- a/Examples/Tests/vay_deposition/CMakeLists.txt +++ b/Examples/Tests/vay_deposition/CMakeLists.txt @@ -7,8 +7,8 @@ if(WarpX_FFT) 2 # dims 2 # nprocs inputs_test_2d_vay_deposition # inputs - analysis.py # analysis - diags/diag1000050 # output + "analysis.py diags/diag1000050" # analysis + "analysis_default_regression.py --path diags/diag1000050" # checksum OFF # dependency ) endif() @@ -19,8 +19,8 @@ if(WarpX_FFT) 3 # dims 2 # nprocs inputs_test_3d_vay_deposition # inputs - analysis.py # analysis - diags/diag1000025 # output + "analysis.py diags/diag1000025" # analysis + "analysis_default_regression.py --path diags/diag1000025" # checksum OFF # dependency ) endif() diff --git a/Examples/Tests/vay_deposition/analysis.py b/Examples/Tests/vay_deposition/analysis.py index ba428520660..def231538de 100755 --- a/Examples/Tests/vay_deposition/analysis.py +++ b/Examples/Tests/vay_deposition/analysis.py @@ -6,7 +6,6 @@ # # License: BSD-3-Clause-LBNL -import os import sys import numpy as np @@ -15,9 +14,6 @@ yt.funcs.mylog.setLevel(50) -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - # Plotfile data set fn = sys.argv[1] ds = yt.load(fn) @@ -34,9 +30,3 @@ print("error_rel = {}".format(error_rel)) print("tolerance = {}".format(tolerance)) assert error_rel < tolerance - -# compare checksums -evaluate_checksum( - test_name=os.path.split(os.getcwd())[1], - output_file=sys.argv[1], -) diff --git a/Examples/Tests/vay_deposition/analysis_default_regression.py b/Examples/Tests/vay_deposition/analysis_default_regression.py new file mode 120000 index 00000000000..d8ce3fca419 --- /dev/null +++ b/Examples/Tests/vay_deposition/analysis_default_regression.py @@ -0,0 +1 @@ +../../analysis_default_regression.py \ No newline at end of file diff --git a/Examples/analysis_default_openpmd_regression.py b/Examples/analysis_default_openpmd_regression.py deleted file mode 100755 index 6f38693f820..00000000000 --- a/Examples/analysis_default_openpmd_regression.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python3 - -import os -import re -import sys - -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - -test_name = os.path.split(os.getcwd())[1] -output_file = sys.argv[1] - -# Run checksum regression test -if re.search("single_precision", output_file): - evaluate_checksum( - test_name=test_name, - output_file=output_file, - output_format="openpmd", - rtol=2e-6, - ) -else: - evaluate_checksum( - test_name=test_name, - output_file=output_file, - output_format="openpmd", - ) diff --git a/Examples/analysis_default_regression.py b/Examples/analysis_default_regression.py index 7c02f6904b2..e143e396f0c 100755 --- a/Examples/analysis_default_regression.py +++ b/Examples/analysis_default_regression.py @@ -1,25 +1,88 @@ #!/usr/bin/env python3 +import argparse import os -import re import sys +import yt +from openpmd_viewer import OpenPMDTimeSeries + sys.path.insert(1, "../../../../warpx/Regression/Checksum/") from checksumAPI import evaluate_checksum -test_name = os.path.split(os.getcwd())[1] -output_file = sys.argv[1] -# Run checksum regression test -if re.search("single_precision", output_file): +def main(args): + # parse test name from test directory + test_name = os.path.split(os.getcwd())[1] + if "_restart" in test_name: + rtol_restart = 1e-12 + print( + f"Warning: Setting relative tolerance {rtol_restart} for restart checksum analysis" + ) + # use original test's checksums + test_name = test_name.replace("_restart", "") + # reset relative tolerance + args.rtol = rtol_restart + # TODO check environment and reset tolerance (portable, machine precision) + # compare checksums evaluate_checksum( test_name=test_name, - output_file=output_file, - rtol=2e-6, + output_file=args.path, + output_format=args.format, + rtol=args.rtol, + do_fields=args.do_fields, + do_particles=args.do_particles, ) -else: - # using default relative tolerance - evaluate_checksum( - test_name=test_name, - output_file=output_file, + + +if __name__ == "__main__": + # define parser + parser = argparse.ArgumentParser() + # add arguments: output path + parser.add_argument( + "--path", + help="path to output file(s)", + type=str, + ) + # add arguments: relative tolerance + parser.add_argument( + "--rtol", + help="relative tolerance to compare checksums", + type=float, + required=False, + default=1e-9, + ) + # add arguments: skip fields + parser.add_argument( + "--skip-fields", + help="skip fields when comparing checksums", + action="store_true", + dest="skip_fields", + ) + # add arguments: skip particles + parser.add_argument( + "--skip-particles", + help="skip particles when comparing checksums", + action="store_true", + dest="skip_particles", ) + # parse arguments + args = parser.parse_args() + # set args.format automatically + try: + yt.load(args.path) + except Exception: + try: + OpenPMDTimeSeries(args.path) + except Exception: + print("Could not open the file as a plotfile or an openPMD time series") + else: + args.format = "openpmd" + else: + args.format = "plotfile" + # set args.do_fields (not parsed, based on args.skip_fields) + args.do_fields = False if args.skip_fields else True + # set args.do_particles (not parsed, based on args.skip_particles) + args.do_particles = False if args.skip_particles else True + # execute main function + main(args) diff --git a/Examples/analysis_default_restart.py b/Examples/analysis_default_restart.py index c019a0b5945..ad6bc22e60e 100755 --- a/Examples/analysis_default_restart.py +++ b/Examples/analysis_default_restart.py @@ -6,9 +6,6 @@ import numpy as np import yt -sys.path.insert(1, "../../../../warpx/Regression/Checksum/") -from checksumAPI import evaluate_checksum - def check_restart(filename, tolerance=1e-12): """ @@ -67,17 +64,6 @@ def check_restart(filename, tolerance=1e-12): print() -# test name (for checksums, remove "_restart") and output file name -test_name = os.path.split(os.getcwd())[1] -test_name = test_name.replace("_restart", "") -output_file = sys.argv[1] - # compare restart results against original results +output_file = sys.argv[1] check_restart(output_file) - -# compare restart checksums against original checksums -evaluate_checksum( - test_name=test_name, - output_file=output_file, - rtol=1e-12, -) diff --git a/Regression/Checksum/benchmarks_json/test_2d_collision_xz_picmi.json b/Regression/Checksum/benchmarks_json/test_2d_collision_xz_picmi.json new file mode 100644 index 00000000000..5407fe62374 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_2d_collision_xz_picmi.json @@ -0,0 +1,29 @@ +{ + "lev=0": { + "Bx": 0.0, + "By": 0.0, + "Bz": 0.0, + "Ex": 0.0, + "Ey": 0.0, + "Ez": 0.0, + "jx": 0.0, + "jy": 0.0, + "jz": 0.0 + }, + "electron": { + "particle_momentum_x": 1.0340540111403247e-19, + "particle_momentum_y": 1.0154008257709287e-19, + "particle_momentum_z": 1.0325278275532687e-19, + "particle_position_x": 2667286.170170416, + "particle_position_y": 2647299.0368030528, + "particle_weight": 1.7256099431746894e+26 + }, + "ion": { + "particle_momentum_x": 2.489595454855792e-19, + "particle_momentum_y": 2.295864697447754e-19, + "particle_momentum_z": 2.2800373850644785e-19, + "particle_position_x": 2657799.867468604, + "particle_position_y": 2664764.1491634008, + "particle_weight": 1.7256099431746894e+26 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_2d_dirichlet_bc_picmi.json b/Regression/Checksum/benchmarks_json/test_2d_dirichlet_bc_picmi.json new file mode 100644 index 00000000000..41567dc3bf2 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_2d_dirichlet_bc_picmi.json @@ -0,0 +1,5 @@ +{ + "lev=0": { + "phi": 10817.97280547637 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_2d_dive_cleaning.json b/Regression/Checksum/benchmarks_json/test_2d_dive_cleaning.json index 71e147cb1f7..06216490281 100644 --- a/Regression/Checksum/benchmarks_json/test_2d_dive_cleaning.json +++ b/Regression/Checksum/benchmarks_json/test_2d_dive_cleaning.json @@ -1,27 +1,21 @@ { - "beam": { - "particle_Bx": 0.0, - "particle_By": 1.4229748768905527e-19, - "particle_Bz": 0.0, - "particle_Ex": 210305.84591470752, - "particle_Ey": 0.0, - "particle_Ez": 210741.1714121227, - "particle_momentum_x": 1.111019933689776e-26, - "particle_momentum_y": 0.0, - "particle_momentum_z": 1.113270980745195e-26, - "particle_position_x": 0.03183627816789909, - "particle_position_y": 0.03171922054171794, - "particle_weight": 31207.545372303823 - }, "lev=0": { "Bx": 0.0, - "By": 1.5468538800972258e-20, + "By": 1.2286794953440962e-20, "Bz": 0.0, - "Ex": 8533.638650013556, + "Ex": 8214.62652670017, "Ey": 0.0, - "Ez": 8534.98921988922, + "Ez": 8214.876065863818, "jx": 0.0, "jy": 0.0, "jz": 0.0 + }, + "beam": { + "particle_momentum_x": 1.580805184936455e-26, + "particle_momentum_y": 0.0, + "particle_momentum_z": 1.5759037267515492e-26, + "particle_position_x": 0.0319918174870481, + "particle_position_y": 0.03196785829873647, + "particle_weight": 31207.545372303823 } -} \ No newline at end of file +} diff --git a/Regression/Checksum/benchmarks_json/test_2d_maxwell_hybrid_qed_solver.json b/Regression/Checksum/benchmarks_json/test_2d_maxwell_hybrid_qed_solver.json index 9f7b7f64dcd..a5c1c1fd700 100644 --- a/Regression/Checksum/benchmarks_json/test_2d_maxwell_hybrid_qed_solver.json +++ b/Regression/Checksum/benchmarks_json/test_2d_maxwell_hybrid_qed_solver.json @@ -1,13 +1,13 @@ { "lev=0": { - "Bx": 3.543966469013954e-05, + "Bx": 3.5439667773344274e-05, "By": 0.0, - "Bz": 5.103535813972088e-12, + "Bz": 0.0, "Ex": 0.0, - "Ey": 6553600000.005218, + "Ey": 6553599999.996383, "Ez": 0.0, "jx": 0.0, "jy": 0.0, "jz": 0.0 } -} \ No newline at end of file +} diff --git a/Regression/Checksum/benchmarks_json/test_2d_particle_attr_access_picmi.json b/Regression/Checksum/benchmarks_json/test_2d_particle_attr_access_picmi.json new file mode 100644 index 00000000000..92a1ccbe638 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_2d_particle_attr_access_picmi.json @@ -0,0 +1,14 @@ +{ + "lev=0": { + "phi": 0.0023065875621041164 + }, + "electrons": { + "particle_momentum_x": 1.1623026977941542e-25, + "particle_momentum_y": 1.0012020618770149e-25, + "particle_momentum_z": 1.0768794697418634e-25, + "particle_newPid": 750.0, + "particle_position_x": 2.4984316660445582, + "particle_position_y": 2.498475649375752, + "particle_weight": 300.0 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_2d_particle_attr_access_unique_picmi.json b/Regression/Checksum/benchmarks_json/test_2d_particle_attr_access_unique_picmi.json new file mode 100644 index 00000000000..d1630437fe0 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_2d_particle_attr_access_unique_picmi.json @@ -0,0 +1,14 @@ +{ + "lev=0": { + "phi": 0.004613047318603685 + }, + "electrons": { + "particle_momentum_x": 2.285288009419423e-25, + "particle_momentum_y": 2.0816449298979767e-25, + "particle_momentum_z": 2.0646896248001752e-25, + "particle_newPid": 1500.0, + "particle_position_x": 4.499791671680002, + "particle_position_y": 4.499957554820931, + "particle_weight": 600.0 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_2d_qed_breit_wheeler_opmd.json b/Regression/Checksum/benchmarks_json/test_2d_qed_breit_wheeler_opmd.json new file mode 100644 index 00000000000..fdfddfcbf2d --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_2d_qed_breit_wheeler_opmd.json @@ -0,0 +1,134 @@ +{ + "lev=0": { + "Ex": 0.0 + }, + "dummy_phot": { + "particle_position_x": 0.0, + "particle_position_y": 0.0, + "particle_position_z": 0.0, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 0.0 + }, + "ele1": { + "particle_opticalDepthQSR": 94805.7653371546, + "particle_position_x": 0.02366929620831116, + "particle_position_y": 0.0, + "particle_position_z": 0.023729402832031253, + "particle_momentum_x": 2.6017428344962994e-14, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 904932.0220947266 + }, + "ele2": { + "particle_opticalDepthQSR": 11848.411715651348, + "particle_position_x": 0.00294089697265625, + "particle_position_y": 0.0, + "particle_position_z": 0.00291261572265625, + "particle_momentum_x": 0.0, + "particle_momentum_y": 8.023686137822937e-15, + "particle_momentum_z": 0.0, + "particle_weight": 112028.12194824219 + }, + "ele3": { + "particle_opticalDepthQSR": 126169.82836793675, + "particle_position_x": 0.03160814697265625, + "particle_position_y": 0.0, + "particle_position_z": 0.03157382483413338, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 1.7279204307644868e-13, + "particle_weight": 1203489.3035888672 + }, + "ele4": { + "particle_opticalDepthQSR": 49124.07007571301, + "particle_position_x": 0.012249532599865704, + "particle_position_y": 0.0, + "particle_position_z": 0.012296328078458279, + "particle_momentum_x": 3.86289566432756e-13, + "particle_momentum_y": 3.86289566432756e-13, + "particle_momentum_z": 3.86289566432756e-13, + "particle_weight": 467967.9870605469 + }, + "p1": { + "particle_opticalDepthBW": 871455.4785435478, + "particle_position_x": 0.2384708675227609, + "particle_position_y": 0.0, + "particle_position_z": 0.23841459716796876, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 9095067.977905273 + }, + "p2": { + "particle_opticalDepthBW": 1026305.8359152814, + "particle_position_x": 0.25920310302734373, + "particle_position_y": 0.0, + "particle_position_z": 0.25923138427734393, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 9887971.878051758 + }, + "p3": { + "particle_opticalDepthBW": 819556.3040882011, + "particle_position_x": 0.23053585302734383, + "particle_position_y": 0.0, + "particle_position_z": 0.230565112772128, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 8796510.696411133 + }, + "p4": { + "particle_opticalDepthBW": 953481.8671852223, + "particle_position_x": 0.24989221486908522, + "particle_position_y": 0.0, + "particle_position_z": 0.24984575334030557, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 9532032.012939453 + }, + "pos1": { + "particle_opticalDepthQSR": 95351.53381764909, + "particle_position_x": 0.02366929620831116, + "particle_position_y": 0.0, + "particle_position_z": 0.023729402832031253, + "particle_momentum_x": 2.580947118885758e-14, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 904932.0220947266 + }, + "pos2": { + "particle_opticalDepthQSR": 11715.614695181783, + "particle_position_x": 0.00294089697265625, + "particle_position_y": 0.0, + "particle_position_z": 0.00291261572265625, + "particle_momentum_x": 0.0, + "particle_momentum_y": 8.016397398195943e-15, + "particle_momentum_z": 0.0, + "particle_weight": 112028.12194824219 + }, + "pos3": { + "particle_opticalDepthQSR": 126049.551252123, + "particle_position_x": 0.03160814697265625, + "particle_position_y": 0.0, + "particle_position_z": 0.03157382483413338, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 1.718369575300312e-13, + "particle_weight": 1203489.3035888672 + }, + "pos4": { + "particle_opticalDepthQSR": 48953.578114257085, + "particle_position_x": 0.012249532599865704, + "particle_position_y": 0.0, + "particle_position_z": 0.012296328078458279, + "particle_momentum_x": 3.873971285219934e-13, + "particle_momentum_y": 3.873971285219934e-13, + "particle_momentum_z": 3.873971285219934e-13, + "particle_weight": 467967.9870605469 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_3d_dive_cleaning.json b/Regression/Checksum/benchmarks_json/test_3d_dive_cleaning.json index db23c26f9a7..b8206240500 100644 --- a/Regression/Checksum/benchmarks_json/test_3d_dive_cleaning.json +++ b/Regression/Checksum/benchmarks_json/test_3d_dive_cleaning.json @@ -1,28 +1,22 @@ { - "beam": { - "particle_Bx": 1.6547943661629038e-20, - "particle_By": 1.7166945226626064e-20, - "particle_Bz": 1.851357799836734e-20, - "particle_Ex": 39363.91309372786, - "particle_Ey": 39331.17437154593, - "particle_Ez": 39396.18209787599, - "particle_momentum_x": 1.700384472207379e-27, - "particle_momentum_y": 1.69889110346099e-27, - "particle_momentum_z": 1.7017928140329036e-27, - "particle_position_x": 0.031880969779242374, - "particle_position_y": 0.03175704658379704, - "particle_position_z": 0.03183674192208247, - "particle_weight": 0.06241509074460764 - }, "lev=0": { - "Bx": 2.2090009624207165e-20, - "By": 2.2307246822783936e-20, - "Bz": 2.1967888687392684e-20, - "Ex": 8888.956516621029, - "Ey": 8838.45337149105, - "Ez": 8837.421045658291, + "Bx": 1.9159134471952935e-20, + "By": 1.8827238279614072e-20, + "Bz": 1.8885687211875642e-20, + "Ex": 8648.536817097653, + "Ey": 8613.089981021956, + "Ez": 8626.889465408336, "jx": 0.0, "jy": 0.0, "jz": 0.0 + }, + "beam": { + "particle_momentum_x": 2.3895400750846334e-27, + "particle_momentum_y": 2.3729444184823814e-27, + "particle_momentum_z": 2.390801909783316e-27, + "particle_position_x": 0.031866021988156114, + "particle_position_y": 0.032281276107277185, + "particle_position_z": 0.03185444043880588, + "particle_weight": 0.06241509074460764 } -} \ No newline at end of file +} diff --git a/Regression/Checksum/benchmarks_json/test_3d_open_bc_poisson_solver_sliced.json b/Regression/Checksum/benchmarks_json/test_3d_open_bc_poisson_solver_sliced.json new file mode 100644 index 00000000000..fd4a9afbc29 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_3d_open_bc_poisson_solver_sliced.json @@ -0,0 +1,21 @@ +{ + "lev=0": { + "Bx": 100915933.44551668, + "By": 157610622.18551716, + "Bz": 2.598515299403035e-15, + "Ex": 4.725065270620093e+16, + "Ey": 3.0253948989229424e+16, + "Ez": 2787743.3330717986, + "rho": 10994013582437.193 + }, + "electron": { + "particle_momentum_x": 5.701277606056779e-19, + "particle_momentum_y": 3.650451663675671e-19, + "particle_momentum_z": 1.145432768297242e-10, + "particle_position_x": 17.314086912497864, + "particle_position_y": 0.25836912671877954, + "particle_position_z": 10066.329600000008, + "particle_weight": 19969036501.910976 + } +} + diff --git a/Regression/Checksum/benchmarks_json/test_3d_particle_scrape.json b/Regression/Checksum/benchmarks_json/test_3d_particle_scrape.json new file mode 100644 index 00000000000..b03a954397a --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_3d_particle_scrape.json @@ -0,0 +1,10 @@ +{ + "lev=0": { + "Bx": 148673.005859208, + "By": 148673.00585920803, + "Bz": 3371.758117878557, + "Ex": 55378581103426.695, + "Ey": 55378581103426.7, + "Ez": 68412803445328.25 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_3d_particle_scrape_picmi.json b/Regression/Checksum/benchmarks_json/test_3d_particle_scrape_picmi.json new file mode 100644 index 00000000000..b03a954397a --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_3d_particle_scrape_picmi.json @@ -0,0 +1,10 @@ +{ + "lev=0": { + "Bx": 148673.005859208, + "By": 148673.00585920803, + "Bz": 3371.758117878557, + "Ex": 55378581103426.695, + "Ey": 55378581103426.7, + "Ez": 68412803445328.25 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_3d_plasma_lens_picmi.json b/Regression/Checksum/benchmarks_json/test_3d_plasma_lens_picmi.json new file mode 100644 index 00000000000..205bf8204dd --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_3d_plasma_lens_picmi.json @@ -0,0 +1,21 @@ +{ + "lev=0": { + "Bx": 3.742282886653039e-14, + "By": 3.733653562337366e-14, + "Bz": 3.159003724979974e-16, + "Ex": 4.413173824952238e-06, + "Ey": 4.440807110847932e-06, + "Ez": 8.994610621212147e-06, + "jx": 2.294712258669695e-10, + "jy": 1.8314117733996873e-10, + "jz": 2.1990787829485306e-08 + }, + "electrons": { + "particle_momentum_x": 7.424668333878816e-24, + "particle_momentum_y": 5.9396389377972404e-24, + "particle_momentum_z": 2.730924530737562e-22, + "particle_position_x": 0.03608389438974155, + "particle_position_y": 0.028872102262786022, + "particle_position_z": 3.894799963324232 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_3d_qed_breit_wheeler_opmd.json b/Regression/Checksum/benchmarks_json/test_3d_qed_breit_wheeler_opmd.json new file mode 100644 index 00000000000..bf98f8bd963 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_3d_qed_breit_wheeler_opmd.json @@ -0,0 +1,134 @@ +{ + "lev=0": { + "Ex": 0.0 + }, + "dummy_phot": { + "particle_position_x": 0.0, + "particle_position_y": 0.0, + "particle_position_z": 0.0, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 0.0 + }, + "ele1": { + "particle_opticalDepthQSR": 150084.76186868473, + "particle_position_x": 0.037522814130005, + "particle_position_y": 0.0375364375, + "particle_position_z": 0.0375473125, + "particle_momentum_x": 4.111367826819435e-14, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 1.4303398132324217 + }, + "ele2": { + "particle_opticalDepthQSR": 19166.68554224755, + "particle_position_x": 0.0047233984375, + "particle_position_y": 0.004773031169456623, + "particle_position_z": 0.004769421875, + "particle_momentum_x": 0.0, + "particle_momentum_y": 1.3120815641048112e-14, + "particle_momentum_z": 0.0, + "particle_weight": 0.18199920654296872 + }, + "ele3": { + "particle_opticalDepthQSR": 197996.95086384623, + "particle_position_x": 0.049603601562499995, + "particle_position_y": 0.049503953125, + "particle_position_z": 0.049484700428793646, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 2.703275178685535e-13, + "particle_weight": 1.8893241882324217 + }, + "ele4": { + "particle_opticalDepthQSR": 79277.54339646622, + "particle_position_x": 0.019832326822916666, + "particle_position_y": 0.019875475260416667, + "particle_position_z": 0.019791898437499997, + "particle_momentum_x": 6.270940742446365e-13, + "particle_momentum_y": 6.270940742446365e-13, + "particle_momentum_z": 6.270940742446365e-13, + "particle_weight": 0.7561206817626952 + }, + "p1": { + "particle_opticalDepthBW": 779753.6899265796, + "particle_position_x": 0.22462570742050836, + "particle_position_y": 0.22460756249999997, + "particle_position_z": 0.22459668749999998, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 8.569660186767576 + }, + "p2": { + "particle_opticalDepthBW": 1011632.5072099702, + "particle_position_x": 0.2574206015625001, + "particle_position_y": 0.25736832040839486, + "particle_position_z": 0.2573745781250001, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 9.81800079345703 + }, + "p3": { + "particle_opticalDepthBW": 707943.7338077008, + "particle_position_x": 0.2125403984375, + "particle_position_y": 0.21264004687499996, + "particle_position_z": 0.21265919757150045, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 8.110675811767576 + }, + "p4": { + "particle_opticalDepthBW": 899116.8515237333, + "particle_position_x": 0.24232183723958334, + "particle_position_y": 0.24226657421875006, + "particle_position_z": 0.24235025781250008, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 9.243879318237303 + }, + "pos1": { + "particle_opticalDepthQSR": 150411.2911918669, + "particle_position_x": 0.037522814130005, + "particle_position_y": 0.0375364375, + "particle_position_z": 0.0375473125, + "particle_momentum_x": 4.0804162983963274e-14, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_weight": 1.4303398132324217 + }, + "pos2": { + "particle_opticalDepthQSR": 19071.695614845616, + "particle_position_x": 0.0047233984375, + "particle_position_y": 0.004773031169456623, + "particle_position_z": 0.004769421875, + "particle_momentum_x": 0.0, + "particle_momentum_y": 1.2937663481149343e-14, + "particle_momentum_z": 0.0, + "particle_weight": 0.18199920654296872 + }, + "pos3": { + "particle_opticalDepthQSR": 197682.0402897762, + "particle_position_x": 0.049603601562499995, + "particle_position_y": 0.049503953125, + "particle_position_z": 0.049484700428793646, + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 2.7069590910941717e-13, + "particle_weight": 1.8893241882324217 + }, + "pos4": { + "particle_opticalDepthQSR": 79817.78242989839, + "particle_position_x": 0.019832326822916666, + "particle_position_y": 0.019875475260416667, + "particle_position_z": 0.019791898437499997, + "particle_momentum_x": 6.229925285542024e-13, + "particle_momentum_y": 6.229925285542024e-13, + "particle_momentum_z": 6.229925285542024e-13, + "particle_weight": 0.7561206817626952 + } +} diff --git a/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers_picmi.json b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers_picmi.json new file mode 100644 index 00000000000..a77d93b9621 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_3d_reduced_diags_load_balance_costs_timers_picmi.json @@ -0,0 +1,22 @@ +{ + "electrons": { + "particle_momentum_x": 0.0, + "particle_momentum_y": 0.0, + "particle_momentum_z": 0.0, + "particle_position_x": 262144.0, + "particle_position_y": 262144.0, + "particle_position_z": 65536.0, + "particle_weight": 1600000000000000.0 + }, + "lev=0": { + "Bx": 0.0, + "By": 0.0, + "Bz": 0.0, + "Ex": 0.0, + "Ey": 0.0, + "Ez": 0.0, + "jx": 0.0, + "jy": 0.0, + "jz": 0.0 + } +} \ No newline at end of file diff --git a/Regression/Checksum/benchmarks_json/test_rz_scraping.json b/Regression/Checksum/benchmarks_json/test_rz_scraping.json index 8f85b956b26..3a97a2dc651 100644 --- a/Regression/Checksum/benchmarks_json/test_rz_scraping.json +++ b/Regression/Checksum/benchmarks_json/test_rz_scraping.json @@ -4,5 +4,14 @@ }, "lev=1": { "Er": 0.0 + }, + "electron": { + "particle_momentum_x": 8.802233511708275e-20, + "particle_momentum_y": 8.865573181381068e-20, + "particle_momentum_z": 0.0, + "particle_position_x": 52.1624916491251, + "particle_position_y": 128.0, + "particle_theta": 776.9665451756912, + "particle_weight": 4.841626861764053e+18 } } diff --git a/Regression/Checksum/benchmarks_json/test_rz_scraping_filter.json b/Regression/Checksum/benchmarks_json/test_rz_scraping_filter.json new file mode 100644 index 00000000000..3a97a2dc651 --- /dev/null +++ b/Regression/Checksum/benchmarks_json/test_rz_scraping_filter.json @@ -0,0 +1,17 @@ +{ + "lev=0": { + "Er": 0.0 + }, + "lev=1": { + "Er": 0.0 + }, + "electron": { + "particle_momentum_x": 8.802233511708275e-20, + "particle_momentum_y": 8.865573181381068e-20, + "particle_momentum_z": 0.0, + "particle_position_x": 52.1624916491251, + "particle_position_y": 128.0, + "particle_theta": 776.9665451756912, + "particle_weight": 4.841626861764053e+18 + } +} diff --git a/Source/Diagnostics/ReducedDiags/FieldEnergy.H b/Source/Diagnostics/ReducedDiags/FieldEnergy.H index 40de174526e..fe17f15f071 100644 --- a/Source/Diagnostics/ReducedDiags/FieldEnergy.H +++ b/Source/Diagnostics/ReducedDiags/FieldEnergy.H @@ -40,13 +40,14 @@ public: void ComputeDiags(int step) final; /** - * \brief Calculate the integral of the field squared in RZ + * \brief Calculate the integral of the field squared, taking into + * account the fraction of the cell volume within the domain. * * \param field The MultiFab to be integrated * \param lev The refinement level * \return The integral */ - amrex::Real ComputeNorm2RZ(const amrex::MultiFab& field, int lev); + amrex::Real ComputeNorm2(const amrex::MultiFab& field, int lev); }; diff --git a/Source/Diagnostics/ReducedDiags/FieldEnergy.cpp b/Source/Diagnostics/ReducedDiags/FieldEnergy.cpp index 1a984368b4e..d16319c37e8 100644 --- a/Source/Diagnostics/ReducedDiags/FieldEnergy.cpp +++ b/Source/Diagnostics/ReducedDiags/FieldEnergy.cpp @@ -30,7 +30,7 @@ #include #include -using namespace amrex; +using namespace amrex::literals; using warpx::fields::FieldType; // constructor @@ -40,7 +40,7 @@ FieldEnergy::FieldEnergy (const std::string& rd_name) // read number of levels int nLevel = 0; - const ParmParse pp_amr("amr"); + amrex::ParmParse const pp_amr("amr"); pp_amr.query("max_level", nLevel); nLevel += 1; @@ -48,7 +48,7 @@ FieldEnergy::FieldEnergy (const std::string& rd_name) // resize data array m_data.resize(noutputs*nLevel, 0.0_rt); - if (ParallelDescriptor::IOProcessor()) + if (amrex::ParallelDescriptor::IOProcessor()) { if ( m_write_header ) { @@ -84,10 +84,10 @@ void FieldEnergy::ComputeDiags (int step) if (!m_intervals.contains(step+1)) { return; } // get a reference to WarpX instance - auto & warpx = WarpX::GetInstance(); + auto const & warpx = WarpX::GetInstance(); // get number of level - const auto nLevel = warpx.finestLevel() + 1; + int const nLevel = warpx.finestLevel() + 1; using ablastr::fields::Direction; @@ -95,42 +95,29 @@ void FieldEnergy::ComputeDiags (int step) for (int lev = 0; lev < nLevel; ++lev) { // get MultiFab data at lev - const MultiFab & Ex = *warpx.m_fields.get(FieldType::Efield_aux, Direction{0}, lev); - const MultiFab & Ey = *warpx.m_fields.get(FieldType::Efield_aux, Direction{1}, lev); - const MultiFab & Ez = *warpx.m_fields.get(FieldType::Efield_aux, Direction{2}, lev); - const MultiFab & Bx = *warpx.m_fields.get(FieldType::Bfield_aux, Direction{0}, lev); - const MultiFab & By = *warpx.m_fields.get(FieldType::Bfield_aux, Direction{1}, lev); - const MultiFab & Bz = *warpx.m_fields.get(FieldType::Bfield_aux, Direction{2}, lev); + amrex::MultiFab const & Ex = *warpx.m_fields.get(FieldType::Efield_aux, Direction{0}, lev); + amrex::MultiFab const & Ey = *warpx.m_fields.get(FieldType::Efield_aux, Direction{1}, lev); + amrex::MultiFab const & Ez = *warpx.m_fields.get(FieldType::Efield_aux, Direction{2}, lev); + amrex::MultiFab const & Bx = *warpx.m_fields.get(FieldType::Bfield_aux, Direction{0}, lev); + amrex::MultiFab const & By = *warpx.m_fields.get(FieldType::Bfield_aux, Direction{1}, lev); + amrex::MultiFab const & Bz = *warpx.m_fields.get(FieldType::Bfield_aux, Direction{2}, lev); // get cell volume - const std::array &dx = WarpX::CellSize(lev); - const amrex::Real dV = dx[0]*dx[1]*dx[2]; - -#if defined(WARPX_DIM_RZ) - amrex::Real const tmpEx = ComputeNorm2RZ(Ex, lev); - amrex::Real const tmpEy = ComputeNorm2RZ(Ey, lev); - amrex::Real const tmpEz = ComputeNorm2RZ(Ez, lev); - amrex::Real const Es = tmpEx + tmpEy + tmpEz; - - amrex::Real const tmpBx = ComputeNorm2RZ(Bx, lev); - amrex::Real const tmpBy = ComputeNorm2RZ(By, lev); - amrex::Real const tmpBz = ComputeNorm2RZ(Bz, lev); - amrex::Real const Bs = tmpBx + tmpBy + tmpBz; -#else - Geometry const & geom = warpx.Geom(lev); + std::array const &dx = WarpX::CellSize(lev); + amrex::Real const dV = dx[0]*dx[1]*dx[2]; // compute E squared - Real const tmpEx = Ex.norm2(0,geom.periodicity()); - Real const tmpEy = Ey.norm2(0,geom.periodicity()); - Real const tmpEz = Ez.norm2(0,geom.periodicity()); - Real const Es = tmpEx*tmpEx + tmpEy*tmpEy + tmpEz*tmpEz; + amrex::Real const tmpEx = ComputeNorm2(Ex, lev); + amrex::Real const tmpEy = ComputeNorm2(Ey, lev); + amrex::Real const tmpEz = ComputeNorm2(Ez, lev); // compute B squared - Real const tmpBx = Bx.norm2(0,geom.periodicity()); - Real const tmpBy = By.norm2(0,geom.periodicity()); - Real const tmpBz = Bz.norm2(0,geom.periodicity()); - Real const Bs = tmpBx*tmpBx + tmpBy*tmpBy + tmpBz*tmpBz; -#endif + amrex::Real const tmpBx = ComputeNorm2(Bx, lev); + amrex::Real const tmpBy = ComputeNorm2(By, lev); + amrex::Real const tmpBz = ComputeNorm2(Bz, lev); + + amrex::Real const Es = tmpEx + tmpEy + tmpEz; + amrex::Real const Bs = tmpBx + tmpBy + tmpBz; constexpr int noutputs = 3; // total energy, E-field energy and B-field energy constexpr int index_total = 0; @@ -156,15 +143,13 @@ void FieldEnergy::ComputeDiags (int step) } // end void FieldEnergy::ComputeDiags -// Function that computes the sum of the field squared in RZ +// Function that computes the sum of the field squared. +// This takes into account the fraction of the cell volumes within the domain +// and the cell volumes in cylindrical coordinates. amrex::Real -FieldEnergy::ComputeNorm2RZ(const amrex::MultiFab& field, const int lev) +FieldEnergy::ComputeNorm2(amrex::MultiFab const& field, [[maybe_unused]]int lev) { - // get a reference to WarpX instance - auto & warpx = WarpX::GetInstance(); - - Geometry const & geom = warpx.Geom(lev); - const amrex::Real dr = geom.CellSize(0); + amrex::IntVect const is_nodal = field.ixType().toIntVect(); amrex::ReduceOps reduce_ops; amrex::ReduceData reduce_data(reduce_ops); @@ -178,45 +163,63 @@ FieldEnergy::ComputeNorm2RZ(const amrex::MultiFab& field, const int lev) amrex::Array4 const& field_arr = field.array(mfi); - const amrex::Box tilebox = mfi.tilebox(); - amrex::Box tb = convert(tilebox, field.ixType().toIntVect()); + amrex::Box const tilebox = mfi.tilebox(); + amrex::Box const tb = convert(tilebox, is_nodal); + amrex::IntVect const tb_lo = tb.smallEnd(); + amrex::IntVect const tb_hi = tb.bigEnd(); +#if defined(WARPX_DIM_RZ) // Lower corner of tile box physical domain - const amrex::XDim3 xyzmin = WarpX::LowerCorner(tilebox, lev, 0._rt); - const Dim3 lo = lbound(tilebox); - const Dim3 hi = ubound(tilebox); - const Real rmin = xyzmin.x + (tb.ixType().nodeCentered(0) ? 0._rt : 0.5_rt*dr); - const int irmin = lo.x; - const int irmax = hi.x; + auto const & warpx = WarpX::GetInstance(); + amrex::Geometry const & geom = warpx.Geom(lev); + amrex::Real const dr = geom.CellSize(0); + amrex::XDim3 const xyzmin = WarpX::LowerCorner(tilebox, lev, 0._rt); + amrex::Real const rmin = xyzmin.x + (is_nodal[0] ? 0._rt : 0.5_rt*dr); +#endif - int const ncomp = field.nComp(); + // On the boundaries, if the grid is nodal, use half of the volume. + // This applies to all boundary conditions, and to the overlap of + // boxes within the domain. + // Previously, the code used MultiFab::norm2, but that does not do + // the half-volume scaling for the domain boundaries when not periodic. + + auto volume_factor = [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { + amrex::ignore_unused(i,j,k,n); +#if defined WARPX_DIM_RZ + amrex::Real const r = rmin + (i - tb_lo[0])*dr; + amrex::Real v_factor = 2._rt*r; + if (i == tb_lo[0] && is_nodal[0]) { v_factor = r + dr/4._rt; } + if (i == tb_hi[0] && is_nodal[0]) { v_factor = r - dr/4._rt; } + if (j == tb_lo[1] && is_nodal[1]) { v_factor *= 0.5_rt; } + if (j == tb_hi[1] && is_nodal[1]) { v_factor *= 0.5_rt; } + amrex::Real const theta_integral = (n == 0 ? 1._rt : 0.5_rt); + return MathConst::pi*v_factor*theta_integral; +#else + amrex::Real v_factor = 1._rt; + AMREX_D_TERM( + if (i == tb_lo[0] && is_nodal[0]) { v_factor *= 0.5_rt; }, + if (j == tb_lo[1] && is_nodal[1]) { v_factor *= 0.5_rt; }, + if (k == tb_lo[2] && is_nodal[2]) { v_factor *= 0.5_rt; }) + AMREX_D_TERM( + if (i == tb_hi[0] && is_nodal[0]) { v_factor *= 0.5_rt; }, + if (j == tb_hi[1] && is_nodal[1]) { v_factor *= 0.5_rt; }, + if (k == tb_hi[2] && is_nodal[2]) { v_factor *= 0.5_rt; }) + return v_factor; +#endif + }; - for (int idir=0 ; idir < AMREX_SPACEDIM ; idir++) { - if (WarpX::field_boundary_hi[idir] == FieldBoundaryType::Periodic) { - // For periodic boundaries, do not include the data in the nodes - // on the upper edge of the domain - tb.enclosedCells(idir); - } - } + int const ncomp = field.nComp(); reduce_ops.eval(tb, ncomp, reduce_data, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) -> ReduceTuple { - const amrex::Real r = rmin + (i - irmin)*dr; - amrex::Real volume_factor = r; - if (r == 0._rt) { - volume_factor = dr/8._rt; - } else if (rmin == 0._rt && i == irmax) { - volume_factor = r/2._rt - dr/8._rt; - } - const amrex::Real theta_integral = (n == 0 ? 2._rt : 1._rt); - return theta_integral*field_arr(i,j,k,n)*field_arr(i,j,k,n)*volume_factor; + return field_arr(i,j,k,n)*field_arr(i,j,k,n)*volume_factor(i,j,k,n); }); } - const amrex::Real field_sum = amrex::get<0>(reduce_data.value()); - const amrex::Real result = MathConst::pi*field_sum; + amrex::Real result = amrex::get<0>(reduce_data.value()); + amrex::ParallelDescriptor::ReduceRealSum(result); + return result; } -// end Real FieldEnergy::ComputeNorm2RZ diff --git a/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.H b/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.H old mode 100644 new mode 100755 index e58af394a7a..f57cfff6080 --- a/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.H +++ b/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.H @@ -92,7 +92,8 @@ public: amrex::Real required_precision, amrex::Real absolute_tolerance, int max_iters, - int verbosity + int verbosity, + bool is_igf_2d_slices ) const; /** @@ -153,6 +154,10 @@ public: * 2 : convergence progress at every MLMG iteration */ int self_fields_verbosity = 2; + + /** Parameters for FFT Poisson solver aka IGF */ + // 0: full 3D, 1: many 2D z-slices (quasi-3D) + bool is_igf_2d_slices = false; }; #endif // WARPX_ELECTROSTATICSOLVER_H_ diff --git a/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.cpp b/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.cpp old mode 100644 new mode 100755 index 0b1dca675be..429e007b4d0 --- a/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.cpp +++ b/Source/FieldSolver/ElectrostaticSolvers/ElectrostaticSolver.cpp @@ -38,7 +38,12 @@ void ElectrostaticSolver::ReadParameters () { pp_warpx, "self_fields_absolute_tolerance", self_fields_absolute_tolerance); utils::parser::queryWithParser( pp_warpx, "self_fields_max_iters", self_fields_max_iters); - pp_warpx.query("self_fields_verbosity", self_fields_verbosity); + utils::parser::queryWithParser( + pp_warpx, "self_fields_verbosity", self_fields_verbosity); + + // FFT solver flags + utils::parser::queryWithParser( + pp_warpx, "use_2d_slices_fft_solver", is_igf_2d_slices); } void @@ -121,7 +126,9 @@ ElectrostaticSolver::computePhi ( Real const required_precision, Real absolute_tolerance, int const max_iters, - int const verbosity) const + int const verbosity, + bool const is_igf_2d +) const { using ablastr::fields::Direction; @@ -202,6 +209,7 @@ ElectrostaticSolver::computePhi ( warpx.boxArray(), WarpX::grid_type, is_solver_igf_on_lev0, + is_igf_2d, EB::enabled(), WarpX::do_single_precision_comms, warpx.refRatio(), diff --git a/Source/FieldSolver/ElectrostaticSolvers/LabFrameExplicitES.H b/Source/FieldSolver/ElectrostaticSolvers/LabFrameExplicitES.H old mode 100644 new mode 100755 diff --git a/Source/FieldSolver/ElectrostaticSolvers/LabFrameExplicitES.cpp b/Source/FieldSolver/ElectrostaticSolvers/LabFrameExplicitES.cpp old mode 100644 new mode 100755 index e973ae66975..643efefb2f3 --- a/Source/FieldSolver/ElectrostaticSolvers/LabFrameExplicitES.cpp +++ b/Source/FieldSolver/ElectrostaticSolvers/LabFrameExplicitES.cpp @@ -75,7 +75,7 @@ void LabFrameExplicitES::ComputeSpaceChargeField ( // Use the AMREX MLMG or the FFT (IGF) solver otherwise computePhi(rho_fp, phi_fp, beta, self_fields_required_precision, self_fields_absolute_tolerance, self_fields_max_iters, - self_fields_verbosity); + self_fields_verbosity, is_igf_2d_slices); #endif } diff --git a/Source/FieldSolver/ElectrostaticSolvers/RelativisticExplicitES.H b/Source/FieldSolver/ElectrostaticSolvers/RelativisticExplicitES.H old mode 100644 new mode 100755 diff --git a/Source/FieldSolver/ElectrostaticSolvers/RelativisticExplicitES.cpp b/Source/FieldSolver/ElectrostaticSolvers/RelativisticExplicitES.cpp old mode 100644 new mode 100755 index 69647da1702..0b1bcecd1e5 --- a/Source/FieldSolver/ElectrostaticSolvers/RelativisticExplicitES.cpp +++ b/Source/FieldSolver/ElectrostaticSolvers/RelativisticExplicitES.cpp @@ -130,7 +130,7 @@ void RelativisticExplicitES::AddSpaceChargeField ( computePhi( amrex::GetVecOfPtrs(rho), amrex::GetVecOfPtrs(phi), beta, pc.self_fields_required_precision, pc.self_fields_absolute_tolerance, pc.self_fields_max_iters, - pc.self_fields_verbosity ); + pc.self_fields_verbosity, is_igf_2d_slices); // Compute the corresponding electric and magnetic field, from the potential phi computeE( Efield_fp, amrex::GetVecOfPtrs(phi), beta ); @@ -168,7 +168,7 @@ void RelativisticExplicitES::AddBoundaryField (ablastr::fields::MultiLevelVector computePhi( amrex::GetVecOfPtrs(rho), amrex::GetVecOfPtrs(phi), beta, self_fields_required_precision, self_fields_absolute_tolerance, self_fields_max_iters, - self_fields_verbosity ); + self_fields_verbosity, is_igf_2d_slices); // Compute the corresponding electric field, from the potential phi. computeE( Efield_fp, amrex::GetVecOfPtrs(phi), beta ); diff --git a/Source/Particles/Collision/BinaryCollision/DSMC/CollisionFilterFunc.H b/Source/Particles/Collision/BinaryCollision/DSMC/CollisionFilterFunc.H index 46b228b049e..c5bd2e1cec6 100644 --- a/Source/Particles/Collision/BinaryCollision/DSMC/CollisionFilterFunc.H +++ b/Source/Particles/Collision/BinaryCollision/DSMC/CollisionFilterFunc.H @@ -34,7 +34,7 @@ * @param[in] scattering processes an array of scattering processes included for consideration. * @param[in] engine the random engine. */ -template +template AMREX_GPU_HOST_DEVICE AMREX_INLINE void CollisionPairFilter (const amrex::ParticleReal u1x, const amrex::ParticleReal u1y, const amrex::ParticleReal u1z, const amrex::ParticleReal u2x, @@ -65,11 +65,11 @@ void CollisionPairFilter (const amrex::ParticleReal u1x, const amrex::ParticleRe // Evaluate the cross-section for each scattering process to determine // the total collision probability. - AMREX_ASSERT_WITH_MESSAGE( - (process_count < 4), "Too many scattering processes in DSMC routine." - ); - int coll_type[4] = {0, 0, 0, 0}; - amrex::ParticleReal sigma_sums[4] = {0._prt, 0._prt, 0._prt, 0._prt}; + + // The size of the arrays below is a compile-time constant (template parameter) + // for performance reasons: it avoids dynamic memory allocation on the GPU. + int coll_type[max_process_count] = {0}; + amrex::ParticleReal sigma_sums[max_process_count] = {0._prt}; for (int ii = 0; ii < process_count; ii++) { auto const& scattering_process = scattering_processes[ii]; coll_type[ii] = int(scattering_process.m_type); diff --git a/Source/Particles/Collision/BinaryCollision/DSMC/DSMCFunc.H b/Source/Particles/Collision/BinaryCollision/DSMC/DSMCFunc.H index a692d2cbb9e..5a3c925e9bd 100644 --- a/Source/Particles/Collision/BinaryCollision/DSMC/DSMCFunc.H +++ b/Source/Particles/Collision/BinaryCollision/DSMC/DSMCFunc.H @@ -163,7 +163,11 @@ public: u1y[I1[i1]] = u1xbuf*std::sin(theta) + u1y[I1[i1]]*std::cos(theta); #endif - CollisionPairFilter( + const int max_process_count = 4; // Pre-defined value, for performance reasons + AMREX_ALWAYS_ASSERT_WITH_MESSAGE( + (m_process_count < max_process_count), "Too many scattering processes in DSMC routine (hardcoded to only allow 4). Update the max_process_count value in source code to allow more scattering processes." + ); + CollisionPairFilter( u1x[ I1[i1] ], u1y[ I1[i1] ], u1z[ I1[i1] ], u2x[ I2[i2] ], u2y[ I2[i2] ], u2z[ I2[i2] ], m1, m2, w1[ I1[i1] ], w2[ I2[i2] ], diff --git a/Source/ablastr/fields/IntegratedGreenFunctionSolver.H b/Source/ablastr/fields/IntegratedGreenFunctionSolver.H old mode 100644 new mode 100755 index 28885e167a3..9492cff885e --- a/Source/ablastr/fields/IntegratedGreenFunctionSolver.H +++ b/Source/ablastr/fields/IntegratedGreenFunctionSolver.H @@ -15,13 +15,14 @@ #include #include - #include #include namespace ablastr::fields { + using namespace amrex::literals; + /** @brief Implements equation 2 in https://doi.org/10.1103/PhysRevSTAB.10.129901 * with some modification to symmetrize the function. @@ -30,54 +31,92 @@ namespace ablastr::fields * @param[in] y y-coordinate of given location * @param[in] z z-coordinate of given location * - * @return the integrated Green function G + * @return the integrated Green function G in 3D */ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real - IntegratedPotential (amrex::Real x, amrex::Real y, amrex::Real z) + IntegratedPotential3D (amrex::Real x, amrex::Real y, amrex::Real z) { - using namespace amrex::literals; - amrex::Real const r = std::sqrt( x*x + y*y + z*z ); - amrex::Real const G = - - 0.5_rt * z*z * std::atan( x*y/(z*r) ) - - 0.5_rt * y*y * std::atan( x*z/(y*r) ) - - 0.5_rt * x*x * std::atan( y*z/(x*r) ) - + y*z*std::asinh( x/std::sqrt(y*y + z*z) ) - + x*z*std::asinh( y/std::sqrt(x*x + z*z) ) - + x*y*std::asinh( z/std::sqrt(x*x + y*y) ); + amrex::Real const G = - 0.5_rt * z*z * std::atan( x*y/(z*r) ) + - 0.5_rt * y*y * std::atan( x*z/(y*r) ) + - 0.5_rt * x*x * std::atan( y*z/(x*r) ) + + y*z*std::asinh( x/std::sqrt(y*y + z*z) ) + + x*z*std::asinh( y/std::sqrt(x*x + z*z) ) + + x*y*std::asinh( z/std::sqrt(x*x + y*y) ); + return G; + } + + + /** @brief Implements equation 58 in https://doi.org/10.1016/j.jcp.2004.01.008 + * + * @param[in] x x-coordinate of given location + * @param[in] y y-coordinate of given location + * + * @return the integrated Green function G in 2D + */ + AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE + amrex::Real + IntegratedPotential2D (amrex::Real x, amrex::Real y) + { + amrex::Real const G = 3_rt*x*y + - x*x * std::atan(y/x) + - y*y * std::atan(x/y) + - x*y * std::log(x*x + y*y); return G; } + /** @brief add * * @param[in] x x-coordinate of given location * @param[in] y y-coordinate of given location * @param[in] z z-coordinate of given location + * @param[in] dx cell size along x + * @param[in] dy cell size along y + * @param[in] dz cell size along z * - * @return the sum of integrated Green function G + * @return the sum of integrated Green function G in 3D */ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real - SumOfIntegratedPotential (amrex::Real x, amrex::Real y, amrex::Real z, amrex::Real dx, amrex::Real dy, amrex::Real dz) + SumOfIntegratedPotential3D (amrex::Real x, amrex::Real y, amrex::Real z, amrex::Real dx, amrex::Real dy, amrex::Real dz) { - using namespace amrex::literals; - + return 1._rt/(4._rt*ablastr::constant::math::pi*ablastr::constant::SI::ep0) * ( + IntegratedPotential3D( x+0.5_rt*dx, y+0.5_rt*dy, z+0.5_rt*dz ) + - IntegratedPotential3D( x-0.5_rt*dx, y+0.5_rt*dy, z+0.5_rt*dz ) + - IntegratedPotential3D( x+0.5_rt*dx, y-0.5_rt*dy, z+0.5_rt*dz ) + + IntegratedPotential3D( x-0.5_rt*dx, y-0.5_rt*dy, z+0.5_rt*dz ) + - IntegratedPotential3D( x+0.5_rt*dx, y+0.5_rt*dy, z-0.5_rt*dz ) + + IntegratedPotential3D( x-0.5_rt*dx, y+0.5_rt*dy, z-0.5_rt*dz ) + + IntegratedPotential3D( x+0.5_rt*dx, y-0.5_rt*dy, z-0.5_rt*dz ) + - IntegratedPotential3D( x-0.5_rt*dx, y-0.5_rt*dy, z-0.5_rt*dz ) + ); + } - amrex::Real const G_value = 1._rt/(4._rt*ablastr::constant::math::pi*ablastr::constant::SI::ep0) * ( - IntegratedPotential( x+0.5_rt*dx, y+0.5_rt*dy, z+0.5_rt*dz ) - - IntegratedPotential( x-0.5_rt*dx, y+0.5_rt*dy, z+0.5_rt*dz ) - - IntegratedPotential( x+0.5_rt*dx, y-0.5_rt*dy, z+0.5_rt*dz ) - + IntegratedPotential( x-0.5_rt*dx, y-0.5_rt*dy, z+0.5_rt*dz ) - - IntegratedPotential( x+0.5_rt*dx, y+0.5_rt*dy, z-0.5_rt*dz ) - + IntegratedPotential( x-0.5_rt*dx, y+0.5_rt*dy, z-0.5_rt*dz ) - + IntegratedPotential( x+0.5_rt*dx, y-0.5_rt*dy, z-0.5_rt*dz ) - - IntegratedPotential( x-0.5_rt*dx, y-0.5_rt*dy, z-0.5_rt*dz ) - ); - return G_value; + /** @brief add + * + * @param[in] x x-coordinate of given location + * @param[in] y y-coordinate of given location + * @param[in] dx cell size along x + * @param[in] dy cell size along y + * + * @return the sum of integrated Green function G in 2D + */ + AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE + amrex::Real + SumOfIntegratedPotential2D (amrex::Real x, amrex::Real y, amrex::Real dx, amrex::Real dy) + { + return 1._rt/(4._rt*ablastr::constant::math::pi*ablastr::constant::SI::ep0) * ( + IntegratedPotential2D( x+0.5_rt*dx, y+0.5_rt*dy ) + - IntegratedPotential2D( x+0.5_rt*dx, y-0.5_rt*dy ) + - IntegratedPotential2D( x-0.5_rt*dx, y+0.5_rt*dy ) + + IntegratedPotential2D( x-0.5_rt*dx, y-0.5_rt*dy ) + ); } + /** @brief Compute the electrostatic potential using the Integrated Green Function method * as in http://dx.doi.org/10.1103/PhysRevSTAB.9.044204 * @@ -90,7 +129,8 @@ namespace ablastr::fields computePhiIGF (amrex::MultiFab const & rho, amrex::MultiFab & phi, std::array const & cell_size, - amrex::BoxArray const & ba); + amrex::BoxArray const & ba, + bool is_igf_2d_slices); } // namespace ablastr::fields diff --git a/Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp b/Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp old mode 100644 new mode 100755 index b142978c8be..74f9b308acd --- a/Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp +++ b/Source/ablastr/fields/IntegratedGreenFunctionSolver.cpp @@ -34,7 +34,8 @@ void computePhiIGF ( amrex::MultiFab const & rho, amrex::MultiFab & phi, std::array const & cell_size, - amrex::BoxArray const & ba) + amrex::BoxArray const & ba, + bool const is_igf_2d_slices) { using namespace amrex::literals; @@ -45,9 +46,6 @@ computePhiIGF ( amrex::MultiFab const & rho, domain.surroundingNodes(); // get nodal points, since `phi` and `rho` are nodal domain.grow( phi.nGrowVect() ); // include guard cells - // Do we grow the domain in the z-direction in the 2D mode? - bool const do_2d_fft = false; - int nprocs = amrex::ParallelDescriptor::NProcs(); { amrex::ParmParse pp("ablastr"); @@ -61,7 +59,7 @@ computePhiIGF ( amrex::MultiFab const & rho, } if (!obc_solver || obc_solver->Domain() != domain) { amrex::FFT::Info info{}; - if (do_2d_fft) { info.setBatchMode(true); } + if (is_igf_2d_slices) { info.setBatchMode(true); } // do 2D FFTs info.setNumProcs(nprocs); obc_solver = std::make_unique>(domain, info); } @@ -71,7 +69,9 @@ computePhiIGF ( amrex::MultiFab const & rho, amrex::Real const dy = cell_size[1]; amrex::Real const dz = cell_size[2]; - obc_solver->setGreensFunction( + if (!is_igf_2d_slices){ + // fully 3D solver + obc_solver->setGreensFunction( [=] AMREX_GPU_DEVICE (int i, int j, int k) -> amrex::Real { int const i0 = i - lo[0]; @@ -80,9 +80,26 @@ computePhiIGF ( amrex::MultiFab const & rho, amrex::Real const x = i0*dx; amrex::Real const y = j0*dy; amrex::Real const z = k0*dz; - return SumOfIntegratedPotential(x, y, z, dx, dy, dz); + + return SumOfIntegratedPotential3D(x, y, z, dx, dy, dz); + }); + }else{ + // 2D sliced solver + obc_solver->setGreensFunction( + [=] AMREX_GPU_DEVICE (int i, int j, int k) -> amrex::Real + { + int const i0 = i - lo[0]; + int const j0 = j - lo[1]; + amrex::Real const x = i0*dx; + amrex::Real const y = j0*dy; + amrex::ignore_unused(k); + + return SumOfIntegratedPotential2D(x, y, dx, dy); }); + } + obc_solver->solve(phi, rho); -} +} // computePhiIGF + } // namespace ablastr::fields diff --git a/Source/ablastr/fields/PoissonSolver.H b/Source/ablastr/fields/PoissonSolver.H old mode 100644 new mode 100755 index 4b07d8be92f..ec7e30791e6 --- a/Source/ablastr/fields/PoissonSolver.H +++ b/Source/ablastr/fields/PoissonSolver.H @@ -207,6 +207,7 @@ computePhi ( amrex::Vector const& grids, utils::enums::GridType grid_type, bool is_solver_igf_on_lev0, + [[maybe_unused]] bool const is_igf_2d, bool eb_enabled = false, bool do_single_precision_comms = false, std::optional > rel_ref_ratio = std::nullopt, @@ -234,13 +235,13 @@ computePhi ( #endif #if !defined(ABLASTR_USE_FFT) - ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE( !is_solver_igf_on_lev0, - "Must compile with FFT support to use the IGF solver!"); + ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE( !is_solver_igf_on_lev0, + "Must compile with FFT support to use the IGF solver!"); #endif #if !defined(WARPX_DIM_3D) - ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE( !is_solver_igf_on_lev0, - "The FFT Poisson solver is currently only implemented for 3D!"); + ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE( !is_solver_igf_on_lev0, + "The FFT Poisson solver is currently only implemented for 3D!"); #endif // Set the value of beta @@ -296,7 +297,7 @@ computePhi ( if ( max_norm_b == 0 ) { phi[lev]->setVal(0); } else { - computePhiIGF( *rho[lev], *phi[lev], dx_scaled, grids[lev] ); + computePhiIGF( *rho[lev], *phi[lev], dx_scaled, grids[lev], is_igf_2d); } continue; } diff --git a/Tools/machines/dane-llnl/dane_warpx.profile.example b/Tools/machines/dane-llnl/dane_warpx.profile.example index 1d272979bd1..dcb895509cc 100644 --- a/Tools/machines/dane-llnl/dane_warpx.profile.example +++ b/Tools/machines/dane-llnl/dane_warpx.profile.example @@ -16,15 +16,15 @@ module load boost/1.80.0 module load hdf5-parallel/1.14.0 SW_DIR="/usr/workspace/${USER}/dane" -export CMAKE_PREFIX_PATH=${SW_DIR}/c-blosc-1.21.6:$CMAKE_PREFIX_PATH -export CMAKE_PREFIX_PATH=${SW_DIR}/adios2-2.8.3:$CMAKE_PREFIX_PATH -export PATH=${SW_DIR}/adios2-2.8.3/bin:${PATH} +export CMAKE_PREFIX_PATH=${SW_DIR}/install/c-blosc-1.21.6:$CMAKE_PREFIX_PATH +export CMAKE_PREFIX_PATH=${SW_DIR}/install/adios2-2.8.3:$CMAKE_PREFIX_PATH +export PATH=${SW_DIR}/install/adios2-2.8.3/bin:${PATH} # optional: for PSATD in RZ geometry support -export CMAKE_PREFIX_PATH=${SW_DIR}/blaspp-2024.10.26:$CMAKE_PREFIX_PATH -export CMAKE_PREFIX_PATH=${SW_DIR}/lapackpp-2024.10.26:$CMAKE_PREFIX_PATH -export LD_LIBRARY_PATH=${SW_DIR}/blaspp-2024.10.26/lib64:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH=${SW_DIR}/lapackpp-2024.10.26/lib64:$LD_LIBRARY_PATH +export CMAKE_PREFIX_PATH=${SW_DIR}/install/blaspp-2024.10.26:$CMAKE_PREFIX_PATH +export CMAKE_PREFIX_PATH=${SW_DIR}/install/lapackpp-2024.10.26:$CMAKE_PREFIX_PATH +export LD_LIBRARY_PATH=${SW_DIR}/install/blaspp-2024.10.26/lib64:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=${SW_DIR}/install/lapackpp-2024.10.26/lib64:$LD_LIBRARY_PATH # optional: for Python bindings module load python/3.12.2 diff --git a/Tools/machines/dane-llnl/install_dependencies.sh b/Tools/machines/dane-llnl/install_dependencies.sh index 0415d7fa8cc..06bee0cead8 100755 --- a/Tools/machines/dane-llnl/install_dependencies.sh +++ b/Tools/machines/dane-llnl/install_dependencies.sh @@ -18,11 +18,11 @@ set -eu -o pipefail if [ -z ${proj-} ]; then echo "WARNING: The 'proj' variable is not yet set in your dane_warpx.profile file! Please edit its line 2 to continue!"; exit 1; fi -# Remove old dependencies ##################################################### +# The src directory should have already been created when cloning WarpX ####### # SW_DIR="/usr/workspace/${USER}/dane" -rm -rf ${SW_DIR} -mkdir -p ${SW_DIR} +rm -rf ${SW_DIR}/install +mkdir -p ${SW_DIR}/install # remove common user mistakes in python, located in .local instead of a venv python3 -m pip uninstall -qq -y pywarpx @@ -37,55 +37,55 @@ python3 -m pip uninstall -qqq -y mpi4py 2>/dev/null || true build_dir=$(mktemp -d) # c-blosc (I/O compression) -if [ -d ${HOME}/src/c-blosc ] +if [ -d ${SW_DIR}/src/c-blosc ] then - cd ${HOME}/src/c-blosc + cd ${SW_DIR}/src/c-blosc git fetch --prune git checkout v1.21.6 cd - else - git clone -b v1.21.6 https://github.com/Blosc/c-blosc.git ${HOME}/src/c-blosc + git clone -b v1.21.6 https://github.com/Blosc/c-blosc.git ${SW_DIR}/src/c-blosc fi -cmake -S ${HOME}/src/c-blosc -B ${build_dir}/c-blosc-dane-build -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DDEACTIVATE_AVX2=OFF -DCMAKE_INSTALL_PREFIX=${SW_DIR}/c-blosc-1.21.6 +cmake -S ${SW_DIR}/src/c-blosc -B ${build_dir}/c-blosc-dane-build -DBUILD_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DDEACTIVATE_AVX2=OFF -DCMAKE_INSTALL_PREFIX=${SW_DIR}/install/c-blosc-1.21.6 cmake --build ${build_dir}/c-blosc-dane-build --target install --parallel 6 # ADIOS2 -if [ -d ${HOME}/src/adios2 ] +if [ -d ${SW_DIR}/src/adios2 ] then - cd ${HOME}/src/adios2 + cd ${SW_DIR}/src/adios2 git fetch --prune git checkout v2.8.3 cd - else - git clone -b v2.8.3 https://github.com/ornladios/ADIOS2.git ${HOME}/src/adios2 + git clone -b v2.8.3 https://github.com/ornladios/ADIOS2.git ${SW_DIR}/src/adios2 fi -cmake -S ${HOME}/src/adios2 -B ${build_dir}/adios2-dane-build -DBUILD_TESTING=OFF -DADIOS2_BUILD_EXAMPLES=OFF -DADIOS2_USE_Blosc=ON -DADIOS2_USE_Fortran=OFF -DADIOS2_USE_Python=OFF -DADIOS2_USE_SST=OFF -DADIOS2_USE_ZeroMQ=OFF -DCMAKE_INSTALL_PREFIX=${SW_DIR}/adios2-2.8.3 +cmake -S ${SW_DIR}/src/adios2 -B ${build_dir}/adios2-dane-build -DBUILD_TESTING=OFF -DADIOS2_BUILD_EXAMPLES=OFF -DADIOS2_USE_Blosc=ON -DADIOS2_USE_Fortran=OFF -DADIOS2_USE_Python=OFF -DADIOS2_USE_SST=OFF -DADIOS2_USE_ZeroMQ=OFF -DCMAKE_INSTALL_PREFIX=${SW_DIR}/install/adios2-2.8.3 cmake --build ${build_dir}/adios2-dane-build --target install -j 6 # BLAS++ (for PSATD+RZ) -if [ -d ${HOME}/src/blaspp ] +if [ -d ${SW_DIR}/src/blaspp ] then - cd ${HOME}/src/blaspp + cd ${SW_DIR}/src/blaspp git fetch --prune git checkout v2024.10.26 cd - else - git clone -b v2024.10.26 https://github.com/icl-utk-edu/blaspp.git ${HOME}/src/blaspp + git clone -b v2024.10.26 https://github.com/icl-utk-edu/blaspp.git ${SW_DIR}/src/blaspp fi -cmake -S ${HOME}/src/blaspp -B ${build_dir}/blaspp-dane-build -Duse_openmp=ON -Duse_cmake_find_blas=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=${SW_DIR}/blaspp-2024.10.26 +cmake -S ${SW_DIR}/src/blaspp -B ${build_dir}/blaspp-dane-build -Duse_openmp=ON -Duse_cmake_find_blas=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=${SW_DIR}/install/blaspp-2024.10.26 cmake --build ${build_dir}/blaspp-dane-build --target install --parallel 6 # LAPACK++ (for PSATD+RZ) -if [ -d ${HOME}/src/lapackpp ] +if [ -d ${SW_DIR}/src/lapackpp ] then - cd ${HOME}/src/lapackpp + cd ${SW_DIR}/src/lapackpp git fetch --prune git checkout v2024.10.26 cd - else - git clone -b v2024.10.26 https://github.com/icl-utk-edu/lapackpp.git ${HOME}/src/lapackpp + git clone -b v2024.10.26 https://github.com/icl-utk-edu/lapackpp.git ${SW_DIR}/src/lapackpp fi -CXXFLAGS="-DLAPACK_FORTRAN_ADD_" cmake -S ${HOME}/src/lapackpp -B ${build_dir}/lapackpp-dane-build -Duse_cmake_find_lapack=ON -DCMAKE_CXX_STANDARD=17 -Dbuild_tests=OFF -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_PREFIX=${SW_DIR}/lapackpp-2024.10.26 +CXXFLAGS="-DLAPACK_FORTRAN_ADD_" cmake -S ${SW_DIR}/src/lapackpp -B ${build_dir}/lapackpp-dane-build -Duse_cmake_find_lapack=ON -DCMAKE_CXX_STANDARD=17 -Dbuild_tests=OFF -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -DCMAKE_INSTALL_PREFIX=${SW_DIR}/install/lapackpp-2024.10.26 cmake --build ${build_dir}/lapackpp-dane-build --target install --parallel 6 @@ -111,7 +111,7 @@ python3 -m pip install --upgrade matplotlib python3 -m pip install --upgrade yt # install or update WarpX dependencies such as picmistandard -python3 -m pip install --upgrade -r ${HOME}/src/warpx/requirements.txt +python3 -m pip install --upgrade -r ${SW_DIR}/src/warpx/requirements.txt # ML dependencies python3 -m pip install --upgrade torch diff --git a/cmake/dependencies/AMReX.cmake b/cmake/dependencies/AMReX.cmake index 3733b729004..0066a3103cd 100644 --- a/cmake/dependencies/AMReX.cmake +++ b/cmake/dependencies/AMReX.cmake @@ -294,7 +294,7 @@ set(WarpX_amrex_src "" set(WarpX_amrex_repo "https://github.com/AMReX-Codes/amrex.git" CACHE STRING "Repository URI to pull and build AMReX from if(WarpX_amrex_internal)") -set(WarpX_amrex_branch "96db0a665ff1e6bbe638490fd02d3aafb9188f6b" +set(WarpX_amrex_branch "b3f67385e62f387b548389222840486c0fffca57" CACHE STRING "Repository branch for WarpX_amrex_repo if(WarpX_amrex_internal)") diff --git a/cmake/dependencies/pyAMReX.cmake b/cmake/dependencies/pyAMReX.cmake index 6f0e07bf79e..93c4cc63e5a 100644 --- a/cmake/dependencies/pyAMReX.cmake +++ b/cmake/dependencies/pyAMReX.cmake @@ -74,7 +74,7 @@ option(WarpX_pyamrex_internal "Download & build pyAMReX" ON) set(WarpX_pyamrex_repo "https://github.com/AMReX-Codes/pyamrex.git" CACHE STRING "Repository URI to pull and build pyamrex from if(WarpX_pyamrex_internal)") -set(WarpX_pyamrex_branch "24.12" +set(WarpX_pyamrex_branch "cba1ca5098fd4edc83b2ae630c0391140fac55f4" CACHE STRING "Repository branch for WarpX_pyamrex_repo if(WarpX_pyamrex_internal)")