-
Notifications
You must be signed in to change notification settings - Fork 192
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
Use sanitised variable name in SGE scheduler job title #4994
Conversation
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.
Thanks @mjclarke94 . That indeed seems unintended, however, I also wonder whether this entire cleaning block is even needed? The block seems to have been copied verbatim from the PbsBaseClass
scheduler implementation for PBS based schedulers (as indicated by the reference to qsub
in the comment). Is this cleaning even required for SGE? Does it have the same limitations on the job title as PBS has?
Yeah, seems to be the same restrictions which explains the code reuse.
Edit: Just reread your comment. To clarify, |
Thanks for the update @mjclarke94 . Then it seems all good to merge. It would just be good to add a test. I quickly wrote one that you can add at the end of the file def test_job_name_cleaning(self):
"""Test that invalid characters are cleaned from job name."""
from aiida.schedulers.datastructures import JobTemplate
scheduler = SgeScheduler()
job_tmpl = JobTemplate()
job_tmpl.job_resource = scheduler.create_job_resource(parallel_env='mpi8', tot_num_mpiprocs=16)
job_tmpl.job_name = 'Some/job:name@with*invalid-characters.'
header = scheduler._get_submit_script_header(job_tmpl)
self.assertTrue('#$ -N Somejobnamewithinvalid-characters.' in header, header) Feel free to modify it of course if you think you can improve it. If you add this, we can run the tests and merge |
Looks good to me! Test added 🙂 |
Codecov Report
@@ Coverage Diff @@
## develop #4994 +/- ##
========================================
Coverage 80.13% 80.13%
========================================
Files 515 515
Lines 36692 36692
========================================
Hits 29398 29398
Misses 7294 7294
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…core into fix/sge-job-name
Oop. Caught by the pre-commit. Struggling to get it to install locally for some reason but I think that change should sort it. |
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.
Thanks @mjclarke94
The job title was actually sanitized, removing characters that are not supported by the SGE scheduler, but the original string was used accidentally, which was not caught due to missing tests. Cherry-pick: f2367e9
The SGE scheduler creates a sanitised
job_title
variable, but doesn't actually use it.