-
Notifications
You must be signed in to change notification settings - Fork 23
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
Uw 44 generate generic scheduler tool #19
Conversation
@ope-adejumo Thanks for addressing some of the concerns we'd discussed in person here! It's really shaping up. Just because our future selves may thank us for being more present in the PR conversation, I am going to attempt to summarize a few offline conversations. Thanks for bearing with us as we figure it all out.
|
if 'stderr' in specs: | ||
strings.append(f"{self._DIRECTIVE} --error {specs.stderr}") | ||
return "\n".join(strings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this section could be abstracted quite a bit to reduce duplicate information. Just spit balling, but I imaging something like (with the mod that I'm suggestion for map_flags above):
for flag, setting in self.map_flags.items():
strings.append(f"{self._DIRECTIVE} --{flag}={setting}")
This takes advantage of the class already having these values set and the caller wouldn't need to pass them in again.
|
||
def map_flags(): | ||
mappings = {'account': '-A', 'partition': '-p', 'wallclock': '-t', 'job_name': '-J', 'nodes': '-N', 'ntasks_per_node': '-n', 'output': '-o', 'error': '-e'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, I think it could be useful to map in the other direction, so then you could map the value of the flag directly to the flag itself.
You might also consider making it an object attribute in the init method (instead of its own method here) so that you don't have to repeat the list of info, and all the values are stored in a convenient dict for retrieval elsewhere if needed.
These additions were ad hoc for discussion purposes. More changes will be needed!
I just pushed a small batch of changes after @ope-adejumo and I talked through some of the fuzzy concepts of what should/shouldn't be in the base class and sub class. We also discussed some of the implementation details of providing native flags, joining stderr/stdout among diff schedulers, and what it means to write a job card. |
We should probably close this PR. |
Description
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist