From b0c93839b210ca06215bfdd4e111485b300b14d7 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Mon, 24 Jul 2023 13:36:51 -0600 Subject: [PATCH 1/2] improve the account remove and add support for slurm --- CIME/XML/env_batch.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CIME/XML/env_batch.py b/CIME/XML/env_batch.py index 93545a146a0..780166e4898 100644 --- a/CIME/XML/env_batch.py +++ b/CIME/XML/env_batch.py @@ -969,11 +969,16 @@ def _submit_single_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": + if ( + batch_system == "pbs" + or batch_system == "cobalt" + and " -A " in submitargs + ): submitargs = submitargs.replace("-A", "") - elif batch_system == "lsf": + elif batch_system == "lsf" and " -P " in submitargs: submitargs = submitargs.replace("-P", "") + elif batch_system == "slurm" and " --account " in submitargs: + submitargs = submitargs.replace("--account", "") if dep_jobs is not None and len(dep_jobs) > 0: logger.debug("dependencies: {}".format(dep_jobs)) From fcdf8dfc5a94522639285539dfdbf29fa85eaa9e Mon Sep 17 00:00:00 2001 From: James Edwards Date: Mon, 24 Jul 2023 13:45:41 -0600 Subject: [PATCH 2/2] improve the account remove and add support for slurm --- CIME/XML/env_batch.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CIME/XML/env_batch.py b/CIME/XML/env_batch.py index 780166e4898..9cf4136b539 100644 --- a/CIME/XML/env_batch.py +++ b/CIME/XML/env_batch.py @@ -970,10 +970,8 @@ def _submit_single_job( if not project: # If there is no project then we need to remove the project flag if ( - batch_system == "pbs" - or batch_system == "cobalt" - and " -A " in submitargs - ): + batch_system == "pbs" or batch_system == "cobalt" + ) and " -A " in submitargs: submitargs = submitargs.replace("-A", "") elif batch_system == "lsf" and " -P " in submitargs: submitargs = submitargs.replace("-P", "")