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

Stop copying moment_kinetics_input.jl? #294

Open
mrhardman opened this issue Nov 15, 2024 · 3 comments
Open

Stop copying moment_kinetics_input.jl? #294

mrhardman opened this issue Nov 15, 2024 · 3 comments

Comments

@mrhardman
Copy link
Collaborator

Now that the inputs are all (?) passed through checked namelists using set_defaults_and_check_section!(), would it be possible to stop copying the moment_kinetics_input.jl file to the run directory? moment_kinetics_input.jl should now be as static as any other part of the source.

@johnomotani
Copy link
Collaborator

I agree there's no need to copy moment_kinetics_input.jl now. Would be more useful to copy the TOML input file (although its contents should be captured in the .h5 output files).

@mrhardman
Copy link
Collaborator Author

It looks like we can just turn off the existing copy by modifying the appropriate places save_inputs_to_txt=true to save_inputs_to_txt=false. The copying of the .toml is a little more challenging because we don't propagate the file path into the function where the inputs are read. @johnomotani Do you have a preferred solution for this? This is the kind of problem where arbitrary choices get made.

@johnomotani
Copy link
Collaborator

save_inputs_to_txt is also the flag that is used to write the moment_kinetics.input file. I'm not sure how useful that one is either - it could probably do with being cleaned up a bit and made more logical - but I wouldn't suggest modifying it at the moment.
Why not just delete

# copy the input file to the output directory to be saved
if save_inputs_to_txt && global_rank[] == 0
cp(joinpath(@__DIR__, "moment_kinetics_input.jl"), joinpath(output_dir, "moment_kinetics_input.jl"), force=true)
end

and remove the save_inputs_to_txt argument from check_input()?

Agreed I don't see a nice way of copying the TOML. I'd probably add the path to the TOML file to the input_dict, and then pop it out once the file is copied.

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