Skip to content

Commit

Permalink
Merge pull request #27 from doyle-lab-ucla/dev2
Browse files Browse the repository at this point in the history
fix retrieving jobid from Hoffman queue
  • Loading branch information
beef-broccoli authored Nov 16, 2023
2 parents 801aba2 + a4cde24 commit a8b4af2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoqchem/sge_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def retrieve_jobs(self) -> None:

# retrieve job ids that are running and waiting on the server
ret = self.connection.run(f"qstat -u {self.user}", hide=True)
user_running_ids = [re.search(".* (\d{7}) .*", l).group(1) for l in ret.stdout.splitlines()[2:]] # looking for exactly 7 digit number
user_running_ids = [l.split()[0] for l in ret.stdout.splitlines()[2:]]
#user_running_ids = [re.search(".* (\d{7}) .*", l).group(1) for l in ret.stdout.splitlines()[2:]] # looking for exactly 7 digit number (problematic)
running_ids = [id for id in user_running_ids if id in ids_to_check]
finished_ids = [id for id in ids_to_check if id not in running_ids]

Expand Down Expand Up @@ -528,8 +529,9 @@ def qstat(self, summary=True) -> pd.DataFrame:
self.connect()
if summary:
ret = self.connection.run(f"qstat -u {self.user}", hide=True)
user_running_ids = [l.split()[0] for l in ret.stdout.splitlines()[2:]]
#user_running_ids = [l.split()[0] for l in ret.stdout.readlines()[2:]]
user_running_ids = [re.search(".* (\d{7}) .*", l).group(1) for l in ret.stdout.splitlines()[2:]] # looking for exactly 7 digit number
#user_running_ids = [re.search(".* (\d{7}) .*", l).group(1) for l in ret.stdout.splitlines()[2:]] # looking for exactly 7 digit number; problematic if queue changes
running, queued = 0, 0
for jobid in user_running_ids:
try:
Expand Down

0 comments on commit a8b4af2

Please sign in to comment.