POD's access to the multirun cases- How? #315
Replies: 7 comments 16 replies
-
Gathering ideas.. Quoting @wrongkindofdoctor from #313 #313 is a good reference, since it make sense to make the case list available to the POD to parse from jsonc file (could be a separate flle, or part of POD's settings.jsonc file). The framework launches PODs as a subprocess, and specifies the environment variables using the env=env_vars option. Subprocess does allow passing arguments to programs that it calls, but it does not seem like it can handle the nested dictionary structure we're working with. The only way to pass the case_list dictionary from the framework to the POD would be with multiprocessing. This method is more complex, and carries the risk of overloading system resources and race conditions. Whether the case_list comes from the framework or directly from a jsonc file (or yaml), the POD would need a method to receive case_list. Users could obtain the case_list from a file using the read_json routine in src/util/filesystem.py: from src.util import read_json Using multiprocessing: Framework routine following the example in the multprocessing link POD case_list intake routine |
Beta Was this translation helpful? Give feedback.
-
I thought reading the object out of the json file looked simpler if there are potential issues with multiprocessing..... |
Beta Was this translation helpful? Give feedback.
-
If there is a python-driver available for NCL, json is probably still readily usable there. (If not, we could consider csv because NCL seems to have read methods for csv.) If we do have an R application in the future, json still works. (so no to pickle perhaps) case_settings.json (further below) for @jkrasting example POD seems to kinda fit in. In the POD (something like the following, or fancier)
case_settings.json (dummy name for now)
@wrongkindofdoctor and everyone- Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Regarding the NCL pods: I think we should be able to call a json reader from the python interface scripts I don't believe that the NCL pods currently read the settings.json files. The framework reads them (at the preprocessing stage?) and the only part that I have used within the pod code is the env var list. I'm not sure where this comes from but it seems the framework has to be parsing it into env vars that are then available in NCL. |
Beta Was this translation helpful? Give feedback.
-
Regarding the meeting conversation about changing output directory structure: |
Beta Was this translation helpful? Give feedback.
-
To summarize meeting notes related to this topic:
New example POD will probably reflect better usage of this. Dummy example call in POD:
(@wrongkindofdoctor @bitterbark @jkrasting Please edit this directly to capture meeting outcome accurately. Thanks ) P.S- This is being updated based on discussion thread. |
Beta Was this translation helpful? Give feedback.
-
Yes, just for multi case for NCL pods.
… On Feb 3, 2022, at 8:06 AM, Aparna Radhakrishnan ***@***.***> wrote:
thanks! Yeah, my mind was thinking google doc when I typed it, edit is not possible by others, right.
Just to clarify, "converting the dictionary to environment variables" dict to env variables is for NCL POD compatibility for multi-case? or something else?
(The env variable approach for a single case should still be available from MDTF for backward compatibility, per design discussion )
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
This discussion stems from the multirun implementation issue #309 and a related PR with an example POD #313, where we begin to discuss how the dictionary hand off to the POD may happen. This discussion is to welcome all ideas and assess the cost benefit in terms of implementation, backward compatibility and value to POD developers, etc. Since the discussion is tied to the initial prototype, more than one way could be explored possibly to arrive at a stable approach, considering the big picture.
Beta Was this translation helpful? Give feedback.
All reactions