Repository navigation
fix(cli): read job ids given without a dependency type as afterany - #43
Conversation
…s given From the third job on, --repeat without --dependency passed --dependency <id1>:<id2> to sbatch, which rejects it. sbatch reads a bare job id as afterany, so make that type explicit.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
|
The issue is also present with the It might be enough to add a note in the CLI option's |
--dependency 5 --repeat 3 built 5:6, then 5:6:7, which sbatch rejects. sbatch reads a bare job id as afterany, so give every dependency spec that starts with a job id that type explicitly, before --repeat extends it.
|
Thanks @Yannick-Dayer, good catch: |
Yannick-Dayer
left a comment
There was a problem hiding this comment.
Thank you for fixing the earlier condition and adding the tests.
I have only a minor tweak suggestion to the README.
Co-authored-by: Yannick Dayer <60428834+Yannick-Dayer@users.noreply.github.com>
|
I applied the suggested changes! Thanks. |
Problem
sbatch reads a bare job id in
--dependencyasafterany, but it rejects a bare list of ids (5:6:5is not a dependency type).gridtk submit --repeat Nextends the dependency of each new job by appending the previous local id, so it built such lists:--repeat 3<id1><id1>:<id2>(rejected)--dependency 5 --repeat 3(reported by @Yannick-Dayer)5:<id1>(rejected)5:<id1>:<id2>(rejected)Plain
--dependency 5:6was also passed through as is, and sbatch rejected it with an unclear error.Fix
add_default_dep_type()intools.pyruns once, before submission. Every dependency spec that starts with a job id getsafterany:in front:5becomesafterany:5, and5:6becomesafterany:5:6. It keeps the,and?separators, and leaves typed specs (afterok:5,singleton) unchanged.--repeattherefore always extends a spec that has a type. Without--dependency, the chain starts withafterany:, so a checkpoint-resuming chain keeps going when a job reaches its time limit.The help text of
--dependencyand--repeat, the README and the CHANGELOG now describe the default.Tests
add_default_dep_type(): bare, list,+time, typed,,,?andsingletonspecs.test_submit_repeat_after_dependency:--dependency 1 --repeat 3passesafterany:<g1>, thenafterany:<g1>:<g2>, thenafterany:<g1>:<g2>:<g3>. Withafterok:1, the type is kept. The bare-id case fails onmain.test_submit_with_dependenciesnow expect the explicit type.Relation to #42
The code merges cleanly with #42, and the test suite passes with both applied. Both PRs add a
### Bug Fixessection toCHANGELOG.md, so whichever merges second needs a one-line conflict fix there.