Skip to content

Commit

Permalink
Copy something from cpp driver
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Jan 21, 2024
1 parent 6c1e053 commit d7c0632
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/ert/scheduler/lsf_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,27 @@ class _JobState(str, Enum):
PEND = "PEND"
RUN = "RUN"

# Less frequent:
ZOMBI = "ZOMBI"
PDONE = "PDONE"
SSUSP = "SSUSP"
PSUSP = "PSUSP"
USUSP = "USUSP"
UNKWN = "UNKWN"


_STATE_TO_EVENT: Mapping[_JobState, Optional[JobEvent]] = {
_JobState.PEND: None,
_JobState.EXIT: JobEvent.FAILED,
_JobState.RUN: JobEvent.STARTED,
_JobState.EXIT: JobEvent.FAILED,
_JobState.DONE: JobEvent.COMPLETED,
# Less frequent, we should see if these should be ignored
_JobState.SSUSP: JobEvent.STARTED,
_JobState.USUSP: JobEvent.STARTED,
_JobState.PSUSP: JobEvent.STARTED,
_JobState.UNKWN: None,
_JobState.PDONE: JobEvent.COMPLETED,
}

LSF_JSON = "lsf_info.json"
Expand Down Expand Up @@ -158,6 +172,12 @@ async def poll(self) -> None:
del self._jobs[job_id]
del self._iens2jobid[iens]

missing_in_bjobs_output = set(self._jobs) - set(stat.jobs.keys())
if missing_in_bjobs_output:
logger.warning(
f"bjobs did not give status for job_ids {missing_in_bjobs_output}"
)
# Involve bhist now...
await asyncio.sleep(1.0)

async def finish(self) -> None:
Expand Down

0 comments on commit d7c0632

Please sign in to comment.