From e89176e92a0f8e981968c772ffc74a13520288c6 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 2 Aug 2024 10:58:33 -0500 Subject: [PATCH] port to vista tacc system --- config/cesm/machines/config_batch.xml | 8 +++++--- config/cesm/machines/config_compilers.xml | 4 ++-- config/cesm/machines/config_machines.xml | 6 +++--- scripts/lib/CIME/XML/env_batch.py | 9 +++++---- scripts/lib/CIME/provenance.py | 2 +- scripts/tests/scripts_regression_tests.py | 10 +++++----- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/config/cesm/machines/config_batch.xml b/config/cesm/machines/config_batch.xml index 8e0f0a00447..65df5f412e2 100644 --- a/config/cesm/machines/config_batch.xml +++ b/config/cesm/machines/config_batch.xml @@ -707,17 +707,19 @@ - ssh vista.tacc.utexas.edu cd $CASEROOT ; sbatch + ssh login1.vista.tacc.utexas.edu sbatch + Submitted batch job (\d+)$ - gh-dev - gh-dev-64k + gg + gg-4k + -env diff --git a/config/cesm/machines/config_compilers.xml b/config/cesm/machines/config_compilers.xml index f07e649db18..04032adf147 100644 --- a/config/cesm/machines/config_compilers.xml +++ b/config/cesm/machines/config_compilers.xml @@ -629,8 +629,8 @@ using a fortran linker. TRUE - -L$ENV{NETCDF_PATH}/lib -lnetcdff -lnetcdf - -L$ENV{PNETCDF_PATH}/lib -lpnetcdf + -Wl,-rpath,$(NETCDF_PATH)/lib -L$ENV{NETCDF_PATH}/lib -lnetcdff -lnetcdf + -Wl,-rpath,$(PNETCDF_PATH)/lib -L$ENV{PNETCDF_PATH}/lib -lpnetcdf diff --git a/config/cesm/machines/config_machines.xml b/config/cesm/machines/config_machines.xml index 5d4b07fbd42..389faa22495 100644 --- a/config/cesm/machines/config_machines.xml +++ b/config/cesm/machines/config_machines.xml @@ -2905,12 +2905,12 @@ This allows using a different mpirun command to launch unit tests 4 slurm - 72 - 72 + 144 + 144 mpirun - -np $TOTALPES + -np {{ total_tasks }} diff --git a/scripts/lib/CIME/XML/env_batch.py b/scripts/lib/CIME/XML/env_batch.py index 687973415f5..f652eb5fe4e 100644 --- a/scripts/lib/CIME/XML/env_batch.py +++ b/scripts/lib/CIME/XML/env_batch.py @@ -603,7 +603,7 @@ def _submit_single_job(self, case, job, dep_jobs=None, allow_fail=False, if batch_system is None or batch_system == "none" or no_batch: logger.info("Starting job script {}".format(job)) function_name = job.replace(".", "_") - job_name = "."+job + job_name = os.path.join(self._caseroot,job) if not dry_run: args = self._build_run_args(job, True, skip_pnl=skip_pnl, set_continue_run=resubmit_immediate, submit_resubmits=not resubmit_immediate) @@ -688,16 +688,17 @@ def _submit_single_job(self, case, job, dep_jobs=None, allow_fail=False, if batch_system == 'lsf' and batch_env_flag == 'none': sequence = (run_args, batchsubmit, submitargs, batchredirect, get_batch_script_for_job(job)) elif batch_env_flag: - sequence = (batchsubmit, submitargs, run_args, batchredirect, get_batch_script_for_job(job)) + sequence = (batchsubmit, submitargs, run_args, batchredirect, os.path.join(self._caseroot,get_batch_script_for_job(job))) else: - sequence = (batchsubmit, submitargs, batchredirect, get_batch_script_for_job(job), run_args) + sequence = (batchsubmit, submitargs, batchredirect, os.path.join(self._caseroot,get_batch_script_for_job(job)), run_args) submitcmd = " ".join(s.strip() for s in sequence if s is not None) if dry_run: return submitcmd else: logger.info("Submitting job script {}".format(submitcmd)) - output = run_cmd_no_fail(submitcmd, combine_output=True) +# output = run_cmd_no_fail(submitcmd, combine_output=True) + s, output, e = run_cmd(submitcmd, combine_output=True) jobid = self.get_job_id(output) logger.info("Submitted job id is {}".format(jobid)) return jobid diff --git a/scripts/lib/CIME/provenance.py b/scripts/lib/CIME/provenance.py index 9e67043285e..69f926c06b0 100644 --- a/scripts/lib/CIME/provenance.py +++ b/scripts/lib/CIME/provenance.py @@ -83,7 +83,7 @@ def _save_build_provenance_cesm(case, lid): # pylint: disable=unused-argument manic = os.path.join("manage_externals","checkout_externals") manic_full_path = os.path.join(srcroot, manic) out = None - if os.path.exists(manic_full_path): + if shutil.which('svn') and os.path.exists(manic_full_path): args = " --status --verbose --no-logging" stat, out, err = run_cmd(manic_full_path + args, from_dir=srcroot) errmsg = """Error gathering provenance information from manage_externals. diff --git a/scripts/tests/scripts_regression_tests.py b/scripts/tests/scripts_regression_tests.py index 9a539a902b2..1a921ac7177 100755 --- a/scripts/tests/scripts_regression_tests.py +++ b/scripts/tests/scripts_regression_tests.py @@ -303,21 +303,21 @@ def test_a_createnewcase(self): self.assertTrue(os.path.exists(os.path.join(testdir, "case.setup"))) run_cmd_assert_result(self, "./case.setup", from_dir=testdir) - run_cmd_assert_result(self, "./case.build --skip-provenance-check", from_dir=testdir) + run_cmd_assert_result(self, "./case.build", from_dir=testdir) with Case(testdir, read_only=False) as case: ntasks = case.get_value("NTASKS_ATM") case.set_value("NTASKS_ATM", ntasks+1) # this should fail with a locked file issue - run_cmd_assert_result(self, "./case.build --skip-provenance-check", + run_cmd_assert_result(self, "./case.build", from_dir=testdir, expected_stat=1) run_cmd_assert_result(self, "./case.setup --reset", from_dir=testdir) - run_cmd_assert_result(self, "./case.build --skip-provenance-check", from_dir=testdir) + run_cmd_assert_result(self, "./case.build", from_dir=testdir) with Case(testdir, read_only=False) as case: case.set_value("CHARGE_ACCOUNT", "fred") # this should not fail with a locked file issue - run_cmd_assert_result(self, "./case.build --skip-provenance-check",from_dir=testdir, expected_stat=0) + run_cmd_assert_result(self, "./case.build",from_dir=testdir, expected_stat=0) run_cmd_assert_result(self, "./case.st_archive --test-all", from_dir=testdir) @@ -488,7 +488,7 @@ def test_f_createnewcase_with_user_compset(self): run_cmd_assert_result(self, "%s/create_newcase %s"%(SCRIPT_DIR, args), from_dir=SCRIPT_DIR) run_cmd_assert_result(self, "./case.setup", from_dir=testdir) - run_cmd_assert_result(self, "./case.build --skip-provenance-check", from_dir=testdir) + run_cmd_assert_result(self, "./case.build", from_dir=testdir) cls._do_teardown.append(testdir)