Skip to content

Commit

Permalink
Merge pull request #4461 from jedwards4b/fix_remove_project_if_not_re…
Browse files Browse the repository at this point in the history
…quired

replace PROJECT arg with nothing if PROJECT not required
  • Loading branch information
jedwards4b authored Jul 18, 2023
2 parents baf8701 + 3fe2e88 commit 79f555a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CIME/XML/env_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ def _process_args(self, case, submit_arg_nodes, job, resolve=True):
flag, name = self._get_argument(case, arg)
except ValueError:
continue

if self._batchtype == "cobalt" and job == "case.st_archive":
if flag == "-n":
name = "task_count"
Expand Down Expand Up @@ -964,7 +963,17 @@ def _submit_single_job(

return

submitargs = case.get_value("BATCH_COMMAND_FLAGS", subgroup=job)
submitargs = case.get_value("BATCH_COMMAND_FLAGS", subgroup=job, resolved=False)

project = case.get_value("PROJECT", subgroup=job)

if not project:
# If there is no project then we need to remove the project flag
# slurm defines --account only on machines that require it, so this strip isn't required
if batch_system == "pbs" or batch_system == "cobalt":
submitargs = submitargs.replace("-A", "")
elif batch_system == "lsf":
submitargs = submitargs.replace("-P", "")

if dep_jobs is not None and len(dep_jobs) > 0:
logger.debug("dependencies: {}".format(dep_jobs))
Expand Down

0 comments on commit 79f555a

Please sign in to comment.