Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file_min_digits: 5->6 #2385

Merged
merged 14 commits into from
Mar 3, 2022
Merged

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Oct 7, 2021

100k+ step runs are quite common in WarpX. To simplify post-processing scripts, increase the default to pad to 6 digits.

This might break some hand-written scripts that use ????? wild-cards over * wildcards in regex and thus need to be updated. But it at the same time simplifies regexes for analysis of data series and listing of such file series.

Notes:

@ax3l ax3l added the component: diagnostics all types of outputs label Oct 7, 2021
@ax3l ax3l added this to To Do in Reorganize Diagnostics via automation Oct 7, 2021
@ax3l
Copy link
Member Author

ax3l commented Oct 7, 2021

Found a couple of scripts that need updates:

Regression/Checksum/checksumAPI.py
83:    plotfile_list = glob.glob(path_to_all_plotfiles + '*_plt?????',

Docs/source/developers/checksum.rst
26:This can also be included in an existing analysis script. Note that the plotfile must be ``<test name>_plt?????``, as is generated by the CI framework.

Docs/source/dataanalysis/plot_parallel.rst
27:will loop through plotfiles named ``plt?????`` (e.g., ``plt00000``, ``plt00100`` etc.)

Examples/Tests/collision/analysis_collision_3d.py
55:fn_list = glob(last_fn[:-5] + "?????")

Examples/Tests/collision/analysis_collision_2d.py
55:fn_list = glob(last_fn[:-5] + "?????")

Tools/DevUtils/compare_wx_w_3d.ipynb
57:    "file_list_warpx = glob.glob(path_warpx + 'plt?????')\n",
71:    "file_list_warp = glob.glob(path_warp + 'diags/hdf5/data????????.h5')\n",

Tools/PostProcessing/video_yt.py
36:file_list = glob.glob('./diags/plotfiles/plt?????')

Tools/PostProcessing/plot_parallel.py
47:                    help='path to plotfiles, defaults to diags/plotfiles. Plotfiles names must be plt?????')
236:file_list = glob.glob(os.path.join(path, 'plt?????'))

Tools/PostProcessing/yt3d_mpi.py
39:file_list = glob.glob('plotfiles/plt?????')

Tools/PostProcessing/plot_nci_growth_rate.ipynb
58:    "file_list_warpx = glob.glob(path_wx + 'diag1?????')\n",

Tools/PostProcessing/plot_particle_path.py
131:    fn_list = glob.glob("plt?????")

Tools/LibEnsemble/read_sim_output.py
87:    file_list = glob.glob('diags/plotfiles/plt?????')

@ax3l ax3l added the help wanted Extra attention is needed label Oct 7, 2021
@ax3l
Copy link
Member Author

ax3l commented Oct 7, 2021

The replacement for glob can potentially be as easy as this:

glob('./diags/plotfiles/plt[0-9]+')

Simple regex that is matching trailing digits if we introduce _ in plotfiles: .*_(\d+)$

@EZoni
Copy link
Member

EZoni commented Oct 7, 2021

To fix the tests uniform_plasma_restart, restart, restart_psatd and restart_psatd_time_avg, we will need to change 5 to 6 in the following line of the Python file regtest.py within the regression_testing repository (https://github.com/ECP-WarpX/regression_testing/blob/9aab727cd00dc4527ff2cc6fdd5772c9ebb9ffab/regtest.py#L736-L737):

--- a/regtest.py
+++ b/regtest.py
@@ -734,7 +734,7 @@ def test_suite(argv):
                 shutil.move(test.diffDir, orig_diff_dir)
 
             # get the file number to restart from
-            restart_file = "%s_chk%5.5d" % (test.name, test.restartFileNum)
+            restart_file = "%s_chk%6.6d" % (test.name, test.restartFileNum)

@ax3l
Copy link
Member Author

ax3l commented Oct 15, 2021

regression_testing

I for now just overwrote the 4 checkpoint-restart tests we have to use 5 digits.

Copy link
Member

@dpgrote dpgrote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Reorganize Diagnostics automation moved this from To Do to In Progress Oct 15, 2021
@ax3l ax3l force-pushed the topic-fileMinPrefix6 branch 2 times, most recently from 3bc0ae5 to 4146970 Compare October 22, 2021 00:00
@ax3l ax3l changed the title file_min_digits: 5->6 [WIP] file_min_digits: 5->6 Nov 9, 2021
This was referenced Nov 19, 2021
@ax3l ax3l force-pushed the topic-fileMinPrefix6 branch 3 times, most recently from 6fd31af to f33647f Compare March 2, 2022 21:56
@ax3l ax3l mentioned this pull request Mar 3, 2022
@ax3l ax3l changed the title [WIP] file_min_digits: 5->6 file_min_digits: 5->6 Mar 3, 2022
ax3l and others added 13 commits March 3, 2022 08:54
100k+ step runs are quite common in WarpX. To simplify
post-processing scripts, increase the default to pad to 6 digits.

This might break some hand-written scripts that use `?????`
wild-cards over `*` wildcards in regex and thus need to be updated.
But it at the same time simplifies regexes for analysis of data
series and listing of such file series.
`regtest.py` in `regression_testing` hard-codes 5 digits:
```diff
--- a/regtest.py
+++ b/regtest.py
@@ -734,7 +734,7 @@ def test_suite(argv):
                 shutil.move(test.diffDir, orig_diff_dir)

             # get the file number to restart from
-            restart_file = "%s_chk%5.5d" % (test.name, test.restartFileNum)
+            restart_file = "%s_chk%6.6d" % (test.name, test.restartFileNum)
```
@ax3l ax3l force-pushed the topic-fileMinPrefix6 branch 5 times, most recently from 8479f0e to abe3c45 Compare March 3, 2022 17:27
Same as other CI restart tests: hard-coded value in regression
suite makes this necessary.

X-ref: AMReX-Codes/regression_testing#119
Copy link
Member

@EZoni EZoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, looks great to me!

@RemiLehe RemiLehe merged commit 795c872 into ECP-WarpX:development Mar 3, 2022
Reorganize Diagnostics automation moved this from In Progress to Done Mar 3, 2022
@ax3l ax3l deleted the topic-fileMinPrefix6 branch March 3, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagnostics all types of outputs help wanted Extra attention is needed
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants