Skip to content

Commit

Permalink
Fixed fd for gpaw and PG check for task mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sneaky0potato committed May 20, 2024
1 parent 53fb4ea commit c315875
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion litesoph/engines/gpaw/gpaw_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
28 changes: 15 additions & 13 deletions litesoph/gui/workflow_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit c315875

Please sign in to comment.