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

Allow changing regrid directory in Utilities.setup_output_dirs() #1113

Open
valentinaschueller opened this issue Dec 6, 2024 · 1 comment

Comments

@valentinaschueller
Copy link

Even though the in-code documentation suggests 1 that one is able to change the regrid_dir path created by Utilities.setup_output_dirs(), this is automatically set to a new temporary directory regrid_tmp_<random string> and one cannot provide an alternative path. 2

The directory is not removed at the end of the simulation, which in my case leads to a new empty directory being created every time I run a simulation.

I propose to add another optional argument regrid_dir = nothing to allow users to set a custom path.

Footnotes

  1. https://github.com/CliMA/ClimaCoupler.jl/blob/f66d5df7ad2b8acd67280390708f4dbcf4dfaeaa/src/Utilities.jl#L104

  2. https://github.com/CliMA/ClimaCoupler.jl/blob/f66d5df7ad2b8acd67280390708f4dbcf4dfaeaa/src/Utilities.jl#L111

@juliasloan25
Copy link
Member

Even though the in-code documentation suggests 1 that one is able to change the regrid_dir path created by Utilities.setup_output_dirs(), this is automatically set to a new temporary directory regrid_tmp_<random string> and one cannot provide an alternative path. 2

The directory is not removed at the end of the simulation, which in my case leads to a new empty directory being created every time I run a simulation.

I propose to add another optional argument regrid_dir = nothing to allow users to set a custom path.

Footnotes

  1. - `regrid_dir::String`: The directory where the regridded files will be stored. Default is `output_dir/regrid_tmp/`.
  2. function setup_output_dirs(; output_dir = nothing, artifacts_dir = nothing, comms_ctx)

Hi Valentina! Thanks for pointing this out. We recently changed this function and missed the docstring update. If you would find it to be helpful, we can expose regrid_dir again as something the user can set.

As far as the directory not being removed, regrid_dir is currently created using mktempdir. From the docs for this function, "the temporary directory is automatically deleted when the process exits." So if you're running in the REPL, the directory will be deleted when you exit the REPL, not necessarily when the simulation finishes. If you run by directly calling julia --project=experiments/ClimaEarth experiments/ClimaEarth/run_amip.jl, the regrid dir should be deleted when the file is finished executing.

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

No branches or pull requests

2 participants