From 258291c774b1b3b9bbde56794e384ee0f1e232c0 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Mon, 7 Nov 2022 15:57:10 -0600 Subject: [PATCH 01/10] modified polaris app_run --- balsam/platform/app_run/app_run.py | 1 + balsam/platform/app_run/polaris.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index 9764a7eb..22e7e3b3 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -158,6 +158,7 @@ def start(self) -> None: self._set_envs() cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") + logger.info(f"{self.__class__.__name__} envs: {self._envs}") self._outfile = self._open_outfile() self._pre_popen() diff --git a/balsam/platform/app_run/polaris.py b/balsam/platform/app_run/polaris.py index 994c2e45..ddb1ac17 100644 --- a/balsam/platform/app_run/polaris.py +++ b/balsam/platform/app_run/polaris.py @@ -8,7 +8,7 @@ class PolarisRun(SubprocessAppRun): def _build_cmdline(self) -> str: node_ids = [h for h in self._node_spec.hostnames] - # env_args = ",".join(self._envs.keys()) + cpu_bind = self._launch_params.get("cpu_bind", "none") nid_str = ",".join(map(str, node_ids)) args = [ "mpiexec", @@ -19,10 +19,10 @@ def _build_cmdline(self) -> str: "--hosts", nid_str, "--cpu-bind", - "none", - # "--map-by", - # f"ppr:{self._ranks_per_node}:node", - # "-envlist", env_args, + cpu_bind, + "-d", + self._threads_per_rank, self._cmdline, ] return " ".join(str(arg) for arg in args) + From b72c14305bf7ab8cf50920de27a560fc3dfdc427 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Mon, 7 Nov 2022 16:18:48 -0600 Subject: [PATCH 02/10] bug fix --- balsam/platform/app_run/polaris.py | 1 - 1 file changed, 1 deletion(-) diff --git a/balsam/platform/app_run/polaris.py b/balsam/platform/app_run/polaris.py index ddb1ac17..72834f39 100644 --- a/balsam/platform/app_run/polaris.py +++ b/balsam/platform/app_run/polaris.py @@ -25,4 +25,3 @@ def _build_cmdline(self) -> str: self._cmdline, ] return " ".join(str(arg) for arg in args) - From 6958e4abfd69467963a5d4a2221f6032e5474be8 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 09:13:39 -0600 Subject: [PATCH 03/10] fixed envs logger --- balsam/platform/app_run/app_run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index 22e7e3b3..17af9a0b 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -158,7 +158,9 @@ def start(self) -> None: self._set_envs() cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") - logger.info(f"{self.__class__.__name__} envs: {self._envs}") + log_envs=["OMP_NUM_THREADS","OMP_PLACES"] + [logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") + for k in log_envs if k in self._envs.keys()] self._outfile = self._open_outfile() self._pre_popen() From 896ea43bd3cc89947612b568ae1e440297980156 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 09:21:50 -0600 Subject: [PATCH 04/10] removed white space --- balsam/platform/app_run/app_run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index 17af9a0b..5267928f 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -159,8 +159,8 @@ def start(self) -> None: cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") log_envs=["OMP_NUM_THREADS","OMP_PLACES"] - [logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") - for k in log_envs if k in self._envs.keys()] + [logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") + for k in log_envs if k in self._envs.keys()] self._outfile = self._open_outfile() self._pre_popen() From 584728ad16e0a7b7f083fdc3b276f65f3dd98ec9 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 09:24:43 -0600 Subject: [PATCH 05/10] added white space --- balsam/platform/app_run/app_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index 5267928f..dc739b96 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -158,7 +158,7 @@ def start(self) -> None: self._set_envs() cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") - log_envs=["OMP_NUM_THREADS","OMP_PLACES"] + log_envs = ["OMP_NUM_THREADS","OMP_PLACES"] [logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") for k in log_envs if k in self._envs.keys()] self._outfile = self._open_outfile() From debc1c62339b889d6363b3221b6607ff0478dee6 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 09:27:34 -0600 Subject: [PATCH 06/10] formatting --- balsam/platform/app_run/app_run.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index dc739b96..9caa0207 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -159,8 +159,10 @@ def start(self) -> None: cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") log_envs = ["OMP_NUM_THREADS","OMP_PLACES"] - [logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") - for k in log_envs if k in self._envs.keys()] + [ + logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") + for k in log_envs if k in self._envs.keys() + ] self._outfile = self._open_outfile() self._pre_popen() From df8a0a49afcae48b2e3708cf335c6ae6e56038f0 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 09:41:59 -0600 Subject: [PATCH 07/10] formatting --- balsam/platform/app_run/app_run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index 9caa0207..308c568e 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -158,10 +158,11 @@ def start(self) -> None: self._set_envs() cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") - log_envs = ["OMP_NUM_THREADS","OMP_PLACES"] + log_envs = ["OMP_NUM_THREADS", "OMP_PLACES"] [ logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") - for k in log_envs if k in self._envs.keys() + for k in log_envs + if k in self._envs.keys() ] self._outfile = self._open_outfile() self._pre_popen() From d6c7184d04492b8b4836bf93b7ca5d4de97dfdd2 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 10:12:34 -0600 Subject: [PATCH 08/10] formatting --- balsam/platform/app_run/app_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index 308c568e..b02dd565 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -161,7 +161,7 @@ def start(self) -> None: log_envs = ["OMP_NUM_THREADS", "OMP_PLACES"] [ logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") - for k in log_envs + for k in log_envs if k in self._envs.keys() ] self._outfile = self._open_outfile() From 4a9e2ae1fe3df61b8eaabf15cbe2457edbe9dde1 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 12:21:30 -0600 Subject: [PATCH 09/10] reformat loop --- balsam/platform/app_run/app_run.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index b02dd565..d68fc4b4 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -159,11 +159,9 @@ def start(self) -> None: cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") log_envs = ["OMP_NUM_THREADS", "OMP_PLACES"] - [ - logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") - for k in log_envs - if k in self._envs.keys() - ] + if k in self._envs.keys(): + for k in log_envs: + logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") self._outfile = self._open_outfile() self._pre_popen() From 50942d32760a357b5a82c0098b2dec7dd76bfe80 Mon Sep 17 00:00:00 2001 From: Christine Simpson Date: Tue, 8 Nov 2022 12:26:01 -0600 Subject: [PATCH 10/10] reformat loop --- balsam/platform/app_run/app_run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/balsam/platform/app_run/app_run.py b/balsam/platform/app_run/app_run.py index d68fc4b4..3367eb2a 100644 --- a/balsam/platform/app_run/app_run.py +++ b/balsam/platform/app_run/app_run.py @@ -159,8 +159,8 @@ def start(self) -> None: cmdline = self._build_preamble() + self._build_cmdline() logger.info(f"{self.__class__.__name__} Popen: {cmdline}") log_envs = ["OMP_NUM_THREADS", "OMP_PLACES"] - if k in self._envs.keys(): - for k in log_envs: + for k in log_envs: + if k in self._envs.keys(): logger.info(f"{self.__class__.__name__} envs: {k}={self._envs[k]}") self._outfile = self._open_outfile() self._pre_popen()