From b18486d82f15fea91cf25e237805bb3ef44078f5 Mon Sep 17 00:00:00 2001 From: ranjan Date: Mon, 20 May 2024 16:02:05 +0530 Subject: [PATCH 1/4] Fixed Mo_workflow --- litesoph/common/workflows_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litesoph/common/workflows_data.py b/litesoph/common/workflows_data.py index 09053b63..12324990 100644 --- a/litesoph/common/workflows_data.py +++ b/litesoph/common/workflows_data.py @@ -154,8 +154,8 @@ class step: 'properties':['mo_population'], }, {'laser': True}), - step(2 ,2 ,tt.COMPUTE_SPECTRUM), - step(3 ,3 ,tt.MO_POPULATION)], + step(2 ,2 ,tt.MO_POPULATION), + ], "dependency_map": {'0' : None, '1' : '0', From 53fb4eaf3dd223e0caf7dfd31c7005e6e3ebdbc9 Mon Sep 17 00:00:00 2001 From: Ranjan Date: Tue, 21 May 2024 01:18:25 +0530 Subject: [PATCH 2/4] Fixed octopus tasks not working in queue submission mode --- litesoph/common/task.py | 9 ++++++++- litesoph/engines/octopus/octopus_task.py | 2 -- litesoph/gui/workflow_controller.py | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/litesoph/common/task.py b/litesoph/common/task.py index 04652cbd..e9c7a36e 100644 --- a/litesoph/common/task.py +++ b/litesoph/common/task.py @@ -191,7 +191,14 @@ def run_job_local(self,cmd): def connect_to_network(self, *args, **kwargs): self.submit_network = SubmitNetwork(self, *args, **kwargs) - def run_job_network(): + def run_job_network(self,): + pass + + def post_run(self,): + """ + Called at the end of the task when proceed button is pressed. + Usually to copy engine files to task directory, write the code here. + """ pass def read_log(self, file): diff --git a/litesoph/engines/octopus/octopus_task.py b/litesoph/engines/octopus/octopus_task.py index 1aa8d900..97ba59a4 100644 --- a/litesoph/engines/octopus/octopus_task.py +++ b/litesoph/engines/octopus/octopus_task.py @@ -507,8 +507,6 @@ def run_job_local(self,cmd): return cmd = cmd + ' ' + self.BASH_filename self.submit_local.run_job(cmd) - if self.check_run_status()[0]: - self.post_run() def get_ksd_popln(self): td_info = self.dependent_tasks[1] diff --git a/litesoph/gui/workflow_controller.py b/litesoph/gui/workflow_controller.py index 64b1f832..2cf7db15 100644 --- a/litesoph/gui/workflow_controller.py +++ b/litesoph/gui/workflow_controller.py @@ -48,6 +48,14 @@ def start(self, workflow_manager: WorkflowManager): def show_workmanager_page(self, *_): + try: + self.task_controller.task.post_run() + except: + messagebox.showwarning( + title = "Warning", + message = "There was some error running post run tasks for current task."+ + "Possiblity that some output files couldn't be copyied to task folder." + ) self.workmanager_page._var['select_wf_option'].set(value=2) self.workmanager_page.tkraise() self.app.proceed_button.config(command= self.start_task, state = 'normal') @@ -279,6 +287,14 @@ def next_task(self): if self.check_pg(): return self.app.proceed_button.config(state = 'disabled') + try: + self.task_controller.task.post_run() + except: + messagebox.showwarning( + title = "Warning", + message = "There was some error running post run tasks for current task."+ + "Possiblity that some output files couldn't be copyied to task folder." + ) try: self.workflow_manager.next() except TaskSetupError as e: From c315875ef9160f5c4c6c910edce851e8a5b6939e Mon Sep 17 00:00:00 2001 From: Ranjan Date: Tue, 21 May 2024 02:57:52 +0530 Subject: [PATCH 3/4] Fixed fd for gpaw and PG check for task mode --- litesoph/engines/gpaw/gpaw_input.py | 3 ++- litesoph/gui/workflow_controller.py | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/litesoph/engines/gpaw/gpaw_input.py b/litesoph/engines/gpaw/gpaw_input.py index 2754cc0c..39b82243 100644 --- a/litesoph/engines/gpaw/gpaw_input.py +++ b/litesoph/engines/gpaw/gpaw_input.py @@ -59,7 +59,8 @@ "atoms.center(vacuum={vacuum})\n", """ -initial_calc = GPAW(mode='{mode}', xc='{xc}', txt='no_of_electrons.out') +#This initial_calc is just to compute the no. of electrons. The gs and td will take the params inputted by the user. +initial_calc = GPAW(mode='lcao', xc='PBE', txt='no_of_electrons.out') atoms.set_calculator(initial_calc) atoms.get_potential_energy() diff --git a/litesoph/gui/workflow_controller.py b/litesoph/gui/workflow_controller.py index 2cf7db15..17631c27 100644 --- a/litesoph/gui/workflow_controller.py +++ b/litesoph/gui/workflow_controller.py @@ -45,9 +45,23 @@ def start(self, workflow_manager: WorkflowManager): self.task_mode_workflow = self.workflow_manager.task_mode self.workmanager_page = self.project_controller.workmanager_page self.start_task() - + + def check_pg(self): + # Make it False so that you can queue multiple jobs. + # Chnage to True under parental guidance only + PG_PROCEED = False + if hasattr(self.task_controller.task, 'submit_network') and self.task_controller.task.submit_network is not None: + is_remote_job_done = PG_PROCEED or (self.task_controller.task.submit_network.check_job_status()) + if not is_remote_job_done: + messagebox.showwarning(title='Warning', message="The task has not yet completed. Please wait for the task to complete on the remote machine.") + # TODO: Check if the task output is valid or not? + # messagebox.showerror(title= 'Error', message = "Task output is not valid.") + return True + return False def show_workmanager_page(self, *_): + if hasattr(self, 'task_controller') and self.check_pg(): + return try: self.task_controller.task.post_run() except: @@ -270,18 +284,6 @@ def start_task(self, *_): self.workflow_navigation_view.start(block_id) self.task_controller.set_task(self.workflow_manager, task_view) - def check_pg(self): - # Make it False so that you can queue multiple jobs. - PG_PROCEED = False - if hasattr(self.task_controller.task, 'submit_network') and self.task_controller.task.submit_network is not None: - is_remote_job_done = PG_PROCEED or (self.task_controller.task.submit_network.check_job_status()) - if not is_remote_job_done: - messagebox.showwarning(title='Warning', message="The task has not yet completed. Please wait for the task to complete on the remote machine.") - # TODO: Check if the task output is valid or not? - # messagebox.showerror(title= 'Error', message = "Task output is not valid.") - return True - return False - def next_task(self): # Make it False so that you can queue multiple jobs. if self.check_pg(): From 50b61bc2b4a4ce82e0f13cacd9425bb6f1e64f89 Mon Sep 17 00:00:00 2001 From: Ranjan Date: Tue, 21 May 2024 02:58:41 +0530 Subject: [PATCH 4/4] *change --- litesoph/gui/workflow_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litesoph/gui/workflow_controller.py b/litesoph/gui/workflow_controller.py index 17631c27..68270185 100644 --- a/litesoph/gui/workflow_controller.py +++ b/litesoph/gui/workflow_controller.py @@ -48,7 +48,7 @@ def start(self, workflow_manager: WorkflowManager): def check_pg(self): # Make it False so that you can queue multiple jobs. - # Chnage to True under parental guidance only + # Change to True under parental guidance only PG_PROCEED = False if hasattr(self.task_controller.task, 'submit_network') and self.task_controller.task.submit_network is not None: is_remote_job_done = PG_PROCEED or (self.task_controller.task.submit_network.check_job_status())