From 051718208654fdc54edee66ddaac1c27f7a7f394 Mon Sep 17 00:00:00 2001 From: jpkenny Date: Thu, 9 May 2024 09:38:19 -0700 Subject: [PATCH 1/2] minor fixes to merlin,mercury,mask-mpi --- .../tests/testsuite_default_mask_mpi.py | 13 +++--------- .../mercury/tests/testsuite_default_hg.py | 20 +++---------------- src/sst/elements/merlin/pymerlin-base.py | 2 +- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py b/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py index 263178050e..bc1df0d043 100644 --- a/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py +++ b/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py @@ -21,20 +21,13 @@ def tearDown(self): ##### def test_testme(self): - lib_dir = subprocess.run(["sst-config", "SST_ELEMENT_LIBRARY", "SST_ELEMENT_LIBRARY_LIBDIR"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - lib_dir = lib_dir.stdout.rstrip().decode() - tests_dir = subprocess.run(["sst-config", "SST_ELEMENT_TESTS", "mercury"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - tests_dir = tests_dir.stdout.rstrip().decode() - sst_lib_path = lib_dir + ":" + tests_dir + testdir = self.get_testsuite_dir() paths = os.environ.get("SST_LIB_PATH") if paths is None: - os.environ["SST_LIB_PATH"] = sst_lib_path + os.environ["SST_LIB_PATH"] = testdir else: - os.environ["SST_LIB_PATH"] = paths + ":" + sst_lib_path + os.environ["SST_LIB_PATH"] = paths + ":" + testdir self.mask_mpi_template("test_sendrecv") diff --git a/src/sst/elements/mercury/tests/testsuite_default_hg.py b/src/sst/elements/mercury/tests/testsuite_default_hg.py index 0b6bf61ab6..241ee86a49 100644 --- a/src/sst/elements/mercury/tests/testsuite_default_hg.py +++ b/src/sst/elements/mercury/tests/testsuite_default_hg.py @@ -9,13 +9,6 @@ class testcase_hg(SSTTestCase): -# @classmethod -# def setUpClass(cls): -# hg_dir = subprocess.run(["sst-config", "SST_ELEMENT_TESTS", "mercury"], -# stdout=subprocess.PIPE, stderr=subprocess.PIPE) -# build_sh = hg_dir.stdout.rstrip().decode() + "/build.sh" -# subprocess.run(build_sh) - def setUp(self): super(testcase_hg, self).setUp() # Put test based setup code here. it is called once before every test @@ -27,20 +20,13 @@ def tearDown(self): ##### def test_testme(self): - lib_dir = subprocess.run(["sst-config", "SST_ELEMENT_LIBRARY", "SST_ELEMENT_LIBRARY_LIBDIR"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - lib_dir = lib_dir.stdout.rstrip().decode() - tests_dir = subprocess.run(["sst-config", "SST_ELEMENT_TESTS", "mercury"], - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - tests_dir = tests_dir.stdout.rstrip().decode() - sst_lib_path = lib_dir + ":" + tests_dir + testdir = self.get_testsuite_dir() paths = os.environ.get("SST_LIB_PATH") if paths is None: - os.environ["SST_LIB_PATH"] = sst_lib_path + os.environ["SST_LIB_PATH"] = testdir else: - os.environ["SST_LIB_PATH"] = paths + ":" + sst_lib_path + os.environ["SST_LIB_PATH"] = paths + ":" + testdir self.simple_components_template("ostest") diff --git a/src/sst/elements/merlin/pymerlin-base.py b/src/sst/elements/merlin/pymerlin-base.py index f990114878..463140ab44 100644 --- a/src/sst/elements/merlin/pymerlin-base.py +++ b/src/sst/elements/merlin/pymerlin-base.py @@ -171,7 +171,7 @@ def _addVariable(self,var,dictionary=None,prefix=None): def _addFormattedVariable(self,var,dictionary=None,prefix=None,callback=None): if "%d" in var: # Switch out the %d with \d+ (the regex version) - var = var.replace("%d","\d+") + var = var.replace("%d",r"\d+") if not var in self._format_vars: self._format_vars[var] = _member_formatted_info() From 6a5e7a1f06ef9d29b0f431feac788a6607b8fdff Mon Sep 17 00:00:00 2001 From: jpkenny Date: Thu, 9 May 2024 20:30:36 -0700 Subject: [PATCH 2/2] fix mercury/mask-mpi test library paths --- .../mask-mpi/tests/testsuite_default_mask_mpi.py | 13 ++++++------- .../elements/mercury/tests/testsuite_default_hg.py | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py b/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py index bc1df0d043..9610b707c1 100644 --- a/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py +++ b/src/sst/elements/mask-mpi/tests/testsuite_default_mask_mpi.py @@ -20,15 +20,14 @@ def tearDown(self): ##### - def test_testme(self): + def test_sendrecv(self): testdir = self.get_testsuite_dir() - - paths = os.environ.get("SST_LIB_PATH") - if paths is None: - os.environ["SST_LIB_PATH"] = testdir + libdir = sstsimulator_conf_get_value_str("SST_ELEMENT_LIBRARY","SST_ELEMENT_LIBRARY_LIBDIR") + path = os.environ.get("SST_LIB_PATH") + if path is None or path == "": + os.environ["SST_LIB_PATH"] = libdir else: - os.environ["SST_LIB_PATH"] = paths + ":" + testdir - + os.environ["SST_LIB_PATH"] = path + ":" + libdir self.mask_mpi_template("test_sendrecv") ##### diff --git a/src/sst/elements/mercury/tests/testsuite_default_hg.py b/src/sst/elements/mercury/tests/testsuite_default_hg.py index 241ee86a49..b4a3dd7293 100644 --- a/src/sst/elements/mercury/tests/testsuite_default_hg.py +++ b/src/sst/elements/mercury/tests/testsuite_default_hg.py @@ -21,13 +21,12 @@ def tearDown(self): def test_testme(self): testdir = self.get_testsuite_dir() - - paths = os.environ.get("SST_LIB_PATH") - if paths is None: - os.environ["SST_LIB_PATH"] = testdir + libdir = sstsimulator_conf_get_value_str("SST_ELEMENT_LIBRARY","SST_ELEMENT_LIBRARY_LIBDIR") + path = os.environ.get("SST_LIB_PATH") + if path is None or path == "": + os.environ["SST_LIB_PATH"] = libdir else: - os.environ["SST_LIB_PATH"] = paths + ":" + testdir - + os.environ["SST_LIB_PATH"] = path + ":" + libdir self.simple_components_template("ostest") #####