From 8a034c0201364899912c19f5dbf422a966db21ab Mon Sep 17 00:00:00 2001 From: Miki Bonacci Date: Sun, 15 Dec 2024 22:45:59 +0000 Subject: [PATCH 1/3] Adding warning message This is for small deployment (max cpus localhost < 3), and when precise protocol is chosen. This should be indeed triggered for small deployment like the Demo Server. --- src/aiidalab_qe/app/submission/global_settings/model.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/aiidalab_qe/app/submission/global_settings/model.py b/src/aiidalab_qe/app/submission/global_settings/model.py index 8b2710aa8..00bf088ef 100644 --- a/src/aiidalab_qe/app/submission/global_settings/model.py +++ b/src/aiidalab_qe/app/submission/global_settings/model.py @@ -114,6 +114,8 @@ def check_resources(self): return pw_code_model = self.get_model("quantumespresso.pw") + parameters = self._get_properties() + protocol = self.input_parameters.get("workchain", {}).get("protocol", "fast") if not self.input_structure or not pw_code_model.selected: return # No code selected or no structure, so nothing to do @@ -149,6 +151,13 @@ def check_resources(self): } alert_message = "" + if on_localhost and protocol == "precise" and localhost_cpus < 4: # This means that we are in a small deployment. + alert_message += ( + f"Warning: The selected protocol is {protocol}, which is computationally demanding to run on localhost. " + f"Consider the following: " + ) if large_system and estimated_CPUs > num_cpus: # This part is in common between Warnings 1 (2): # (not) on localhost, big system and few cpus From 8497fde38c46767b0f345b47f0be4554700404c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:49:19 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/aiidalab_qe/app/submission/global_settings/model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aiidalab_qe/app/submission/global_settings/model.py b/src/aiidalab_qe/app/submission/global_settings/model.py index 00bf088ef..60255d87f 100644 --- a/src/aiidalab_qe/app/submission/global_settings/model.py +++ b/src/aiidalab_qe/app/submission/global_settings/model.py @@ -151,7 +151,9 @@ def check_resources(self): } alert_message = "" - if on_localhost and protocol == "precise" and localhost_cpus < 4: # This means that we are in a small deployment. + if ( + on_localhost and protocol == "precise" and localhost_cpus < 4 + ): # This means that we are in a small deployment. alert_message += ( f"Warning: The selected protocol is {protocol}, which is computationally demanding to run on localhost. " f"Consider the following: