diff --git a/src/ert/scheduler/slurm_driver.py b/src/ert/scheduler/slurm_driver.py index 1e0c06d4791..f260a1606c8 100644 --- a/src/ert/scheduler/slurm_driver.py +++ b/src/ert/scheduler/slurm_driver.py @@ -368,9 +368,13 @@ async def _poll_once_by_scontrol( return self._scontrol_cache[missing_job_id] process = await asyncio.create_subprocess_exec( - self._scontrol, - "show", - "job", + "sacct", + "-X", + "-n", + " -o", + "State,ExitCode", + "-P", + "-j", str(missing_job_id), stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, @@ -441,9 +445,8 @@ def _seconds_to_slurm_time_format(seconds: float) -> str: def _parse_scontrol_output(output: str) -> ScontrolInfo: - values = dict(w.split("=", 1) for w in output.split()) - exit_code_str = values.get("ExitCode") + state_str, exit_code_str = output.split("|") exit_code = None if exit_code_str: - exit_code = int(exit_code_str.split(":")[0]) - return ScontrolInfo(JobStatus[values["JobState"]], exit_code) + exit_code = int(output.split(":")[0]) + return ScontrolInfo(JobStatus[state_str], exit_code)