Repository navigation
Skip job_queue on machines without a batch system #309
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,7 +117,8 @@ def __init__( | |
| ntasks_ocn : int, optional | ||
| Number of tasks for the ocean model. If None, defaults to VisualCaseGen Grid Calculation. | ||
| job_queue: str, optional | ||
| The queue to submit the CESM case to. If None, defaults to the CESM defaults (usually main) | ||
| The queue to submit the CESM case to. If None, defaults to the CESM defaults (usually main). | ||
| Ignored, with a warning, on a machine with no batch system (e.g. ubuntu-latest). | ||
| job_wallclock_time: str, optional | ||
| Must be in the form hh:mm:ss. If None, defaults to the CESM defaults | ||
| """ | ||
|
|
@@ -1105,7 +1106,15 @@ def _apply_final_xmlchanges( | |
| xmlchange("NTASKS_OCN", ntasks_ocn, is_non_local=self.cc._is_non_local()) | ||
| # This will trigger for both the run and the archiver. | ||
| if job_queue is not None: | ||
| xmlchange("JOB_QUEUE", job_queue, is_non_local=self.cc._is_non_local()) | ||
| # A machine with no batch system (e.g. ubuntu-latest) has no queues, | ||
| # and xmlchange rejects any JOB_QUEUE there. | ||
| if self._cime_case.get_value("BATCH_SYSTEM") == "none": | ||
|
alperaltuntas marked this conversation as resolved.
Resolved
|
||
| print( | ||
| f"WARNING: ignoring job_queue={job_queue!r}: machine " | ||
| f"{self.machine} has no batch system." | ||
| ) | ||
| else: | ||
| xmlchange("JOB_QUEUE", job_queue, is_non_local=self.cc._is_non_local()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not introduced by this PR, but related: when this xmlchange fails, all the user sees is Error running ./xmlchange JOB_QUEUE=mian. because visualCaseGen's xmlchange captures stderr and doesn't include it in the RuntimeError. So the CIME message is lost, and the case is deleted. Checking the queue name up front (see above) would avoid this for JOB_QUEUE. Including runout.stderr in that error message in visualCaseGen would help for the other variables too.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like ESMCI/visualCaseGen#51 allows errors passing to the user
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also not introduced here: job_queue goes unquoted into a shell=True command (cmd = f"./xmlchange {var}={val}" in visualCaseGen case_tools.py), and init_args_check only checks that it is a str. A value with a space, ;, or $ would break the command or run something else in caseroot. Same for job_wallclock_time. Probably best fixed in visualCaseGen with shlex.quote. (These can be a separate PR).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like ESMCI/visualCaseGen#51 solves this
alperaltuntas marked this conversation as resolved.
Resolved
|
||
| if job_wallclock_time is not None: | ||
| xmlchange( | ||
| "JOB_WALLCLOCK_TIME", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.