Skip to content

Commit

Permalink
Use QSTAT PARSING global setting instead of WAIT PERIOD BETWEEN CHECKS
Browse files Browse the repository at this point in the history
  • Loading branch information
Icemole committed Jul 17, 2024
1 parent 518609e commit f4e2f1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
4 changes: 2 additions & 2 deletions sisyphus/load_sharing_facility_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def submit_helper(self, call, logpath, rqmt, name, task_name, rangestring):
out, err, retval = self.system_call(bsub_call, command)
if retval != 0:
logging.warning(self._system_call_error_warn_msg(bsub_call))
time.sleep(gs.WAIT_PERIOD_BETWEEN_CHECKS)
time.sleep(gs.WAIT_PERIOD_QSTAT_PARSING)
continue
except subprocess.TimeoutExpired:
logging.warning(self._system_call_timeout_warn_msg(bsub_call))
Expand Down Expand Up @@ -260,7 +260,7 @@ def queue_state(self):
out, err, retval = self.system_call(system_command)
if retval != 0:
logging.warning(self._system_call_error_warn_msg(system_command))
time.sleep(gs.WAIT_PERIOD_BETWEEN_CHECKS)
time.sleep(gs.WAIT_PERIOD_QSTAT_PARSING)
continue
except subprocess.TimeoutExpired:
logging.warning(self._system_call_timeout_warn_msg(system_command))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def submit_helper(self, call, logpath, rqmt, name, task_name, start_id, end_id,
out, err, retval = self.system_call(sbatch_call)
if retval != 0:
logging.warning(self._system_call_error_warn_msg(sbatch_call))
time.sleep(gs.WAIT_PERIOD_BETWEEN_CHECKS)
time.sleep(gs.WAIT_PERIOD_QSTAT_PARSING)
continue
except subprocess.TimeoutExpired:
logging.warning(self._system_call_timeout_warn_msg(sbatch_call))
Expand Down Expand Up @@ -318,7 +318,7 @@ def queue_state(self):
out, err, retval = self.system_call(system_command)
if retval != 0:
logging.warning(self._system_call_error_warn_msg(system_command))
time.sleep(gs.WAIT_PERIOD_BETWEEN_CHECKS)
time.sleep(gs.WAIT_PERIOD_QSTAT_PARSING)
continue
except subprocess.TimeoutExpired:
logging.warning(self._system_call_timeout_warn_msg(system_command))
Expand Down
15 changes: 2 additions & 13 deletions sisyphus/son_of_grid_engine.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Author: Jan-Thorsten Peter <[email protected]>

from typing import Any
import os
import subprocess

Expand Down Expand Up @@ -74,16 +73,6 @@ def __init__(self, default_rqmt, gateway=None, auto_clean_eqw=True, ignore_jobs=
self.ignore_jobs = ignore_jobs
self.pe_name = pe_name

def _system_call_timeout_warn_msg(self, command: Any) -> str:
if self.gateway:
return f"SSH command timeout: {command!s}"
return f"Command timeout: {command!s}"

def _system_call_error_warn_msg(self, command: Any) -> str:
if self.gateway:
return f"SSH command error: {command!s}"
return f"Command error: {command!s}"

def system_call(self, command, send_to_stdin=None):
"""
:param list[str] command: qsub command
Expand Down Expand Up @@ -258,7 +247,7 @@ def submit_helper(self, call, logpath, rqmt, name, task_name, start_id, end_id,
out, err, retval = self.system_call(qsub_call, command)
if retval != 0:
logging.warning(self._system_call_error_warn_msg(qsub_call))
time.sleep(gs.WAIT_PERIOD_BETWEEN_CHECKS)
time.sleep(gs.WAIT_PERIOD_QSTAT_PARSING)
continue
except subprocess.TimeoutExpired:
logging.warning(self._system_call_timeout_warn_msg(qsub_call))
Expand Down Expand Up @@ -329,7 +318,7 @@ def queue_state(self):
out, err, retval = self.system_call(system_command)
if retval != 0:
logging.warning(self._system_call_error_warn_msg(system_command))
time.sleep(gs.WAIT_PERIOD_BETWEEN_CHECKS)
time.sleep(gs.WAIT_PERIOD_QSTAT_PARSING)
continue
except subprocess.TimeoutExpired:
logging.warning(self._system_call_timeout_warn_msg(system_command))
Expand Down

0 comments on commit f4e2f1a

Please sign in to comment.