-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CTest: split checksum analysis from test analysis, expose arguments (#…
…5456) Prototype of implementation to see if this can achieve goals such as: 1. run test and analysis locally (possibly without CTest) without worrying about checksums 2. avoid duplicate code for default regression analysis with custom parameters (e.g., tolerance, output format) 3. minimize work needed to implement checksum regression analysis for new tests This PR replaces #5447, see #5447 (comment). ## Old usage 1. Add this to the test analysis script: ```python 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], ) ``` 2. Add this to the CMakeLists.txt file: ```cmake add_warpx_test( test_1d_laser_acceleration_fluid_boosted # name 1 # dims 2 # nprocs inputs_test_1d_laser_acceleration_fluid_boosted # inputs analysis_1d_fluid_boosted.py # analysis diags/diag1000001 # output OFF # dependency ) ``` ## New usage 1. Create a soft link to the default regression analysis script from the test directory (we already do this when there isn't a custom analysis script, see comment in the follow-up section below): ```console ln -s ../../analysis_default_regression.py analysis_default_regression.py ``` 2. Add this to the CMakeLists.txt file: ```cmake add_warpx_test( test_1d_laser_acceleration_fluid_boosted # name 1 # dims 2 # nprocs inputs_test_1d_laser_acceleration_fluid_boosted # inputs "analysis_1d_fluid_boosted.py diags/diag1000001" # analysis "analysis_default_regression.py --path diags/diag1000001" # checksum OFF # dependency ) ``` ## Notes - The updated default regression analysis script has the following usage: ```console 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 ``` - The checksum files that changed (as opposed to the ones that were added from scratch) changed because the corresponding analysis scripts were not performing any checksum analysis. The files had been added but they were not used by the test analysis, hence they were outdated. ## To-do - [x] Add missing checksum files or update existing checksum files that were not used - [x] Update documentation ## Follow-up - Improve documentation even more: - do we need all user-facing features of `checksumAPI` or are some obsolete? - can we merge documentation for testing and checksums into one section? - Check/fix custom tolerances (`git grep "# checksum" Examples/ | grep "rtol"`) - Add logic to reset tolerances based on environment variables (e.g., to run all tests in single-precision) - Update custom test analysis scripts so that they do not need to take the output path as argument (would be difficult to maintain as a convention, though, as these scripts are up to each PR author) - Try (again) to make it work with direct path rather than soft link (did not work when we tried in the past)
- Loading branch information
Showing
290 changed files
with
1,259 additions
and
1,983 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Examples/Physics_applications/beam_beam_collision/analysis_default_openpmd_regression.py
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
Examples/Physics_applications/beam_beam_collision/analysis_default_regression.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../analysis_default_regression.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
Examples/Physics_applications/capacitive_discharge/analysis_2d.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Examples/Physics_applications/free_electron_laser/analysis_default_regression.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../analysis_default_regression.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.