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

Add option to clean up each test dir #146

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

EZoni
Copy link
Contributor

@EZoni EZoni commented Aug 8, 2024

Cc: @ax3l @RemiLehe

Add option to clean up each test directory right after the test ran and passed (not at the end of the whole test suite).

As is, the option rm_testdir (probably to be renamed, see to-do list below) currently removes all subdirectories within a given test directory, which should catch all output data regardless of the format and/or naming convention, but leaves individual files untouched (code currently commented out).

We implemented this quickly to test a bug fix in WarpX (ECP-WarpX/WarpX#5120) and it might be that a combination of existing options (e.g., purge_output, do_temp_run, etc.) might accomplish the same result, if properly used.

Need to sync with other contributors for further development.

Also note that, on the WarpX end, this will become irrelevant once we transition to CTest (ECP-WarpX/WarpX#5068).

To-do:

  • Discuss whether this should be merged into main at all
  • Replace option name rm_testdir with more accurate name
  • Double check that this does not break other exisiting workflows

@EZoni EZoni force-pushed the EZoni_rm_testdir branch from f43f1c8 to 5bd6a57 Compare August 8, 2024 20:42
@zingale
Copy link
Member

zingale commented Aug 12, 2024

is this still WIP?

@EZoni
Copy link
Contributor Author

EZoni commented Aug 12, 2024

Thanks @zingale. On my end, I was just thinking that we might want to change the name of the user-facing option. Right now it's rm_testdir, which suggests that the test directory is removed (which was the original intention). However, the latest implementation simply removes the subdirectories within the test directory, leaving individual files untouched as well as the directory tree itself. Thus maybe we should pick a better name for the option. For example, what do you think about clean_testdir, which is a bit less specific? If you agree with this new name, I can push a change and update WarpX on our end.

@zingale
Copy link
Member

zingale commented Aug 12, 2024

I like clean_testdir

@EZoni
Copy link
Contributor Author

EZoni commented Aug 12, 2024

I pushed the change, ready to go on my end.

@EZoni EZoni changed the title [WIP] Add option to clean up each test dir Add option to clean up each test dir Aug 12, 2024
@zingale zingale merged commit 4789924 into AMReX-Codes:main Aug 12, 2024
1 check failed
@EZoni EZoni deleted the EZoni_rm_testdir branch August 12, 2024 21:03
@EZoni EZoni restored the EZoni_rm_testdir branch August 12, 2024 21:13
@BenWibking
Copy link
Contributor

Ok, this doesn't clean up plotfiles since the regression testing framework compresses them before the cleanup code runs. It also doesn't clean up executables (which can be hundreds of MBs):

bwibking@avatargpu:~/regression-tests/quokka-tests/2024-12-14/RadhydroShell-GPU> ls -lt
total 410736
-rw-r--r--. 1 bwibking stromlo 150332339 Dec 14 07:21 RadhydroShell-GPU_plt03440.tgz
-rw-r--r--. 1 bwibking stromlo      3347 Dec 14 07:21 RadhydroShell-GPU_plt03440.gasDensity.XY.png
-rw-r--r--. 1 bwibking stromlo     49167 Dec 14 07:21 RadhydroShell-GPU_plt03440.gasDensity.XY.ppm
-rw-r--r--. 1 bwibking stromlo     49167 Dec 14 07:21 RadhydroShell-GPU_plt03440.gasDensity.XZ.ppm
-rw-r--r--. 1 bwibking stromlo     49167 Dec 14 07:21 RadhydroShell-GPU_plt03440.gasDensity.YZ.ppm
-rw-r--r--. 1 bwibking stromlo      1877 Dec 14 07:21 RadhydroShell-GPU.compare.out
-rw-r--r--. 1 bwibking stromlo       653 Dec 14 07:21 RadhydroShell-GPU.err.out
-rw-r--r--. 1 bwibking stromlo   1046754 Dec 14 07:21 RadhydroShell-GPU.run.out
lrwxrwxrwx. 1 bwibking stromlo        79 Dec 14 07:10 initial_conditions.txt -> /home/bwibking/regression-tests/quokka/extern/dust_shell/initial_conditions.txt
-rw-r--r--. 1 bwibking stromlo      1207 Dec 14 07:10 radhydro_shell_regression.in
-rw-r--r--. 1 bwibking stromlo     36746 Dec 14 07:10 RadhydroShell-GPU.make.out
-rwxr-xr-x. 1 bwibking stromlo 268996288 Dec 14 07:10 RadhydroShell-GPU.ex

I also have purge_output = 1 in my *.ini file, but that doesn't seem to do anything.

@zingale Do you have a recommendation on how to get it to delete the compressed plotfiles? Is there an option to delete the executable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants