Skip to content

Commit

Permalink
DirectScheduler: Add ? as JobState.UNDETERMINED (#6040)
Browse files Browse the repository at this point in the history
When running a process via `engine.run` on a MacOS `localhost` using the
`core.direct` scheduler, warnings are often raised regarding an
"unrecognised job state `?`'. This is related to the fact that on MacOS the `ps`
command is sometimes not able to determine the process state temporarily, and
prints a `?` in the `STAT` column, see:

https://apple.stackexchange.com/q/460394/497071

Here we simply add the `?` as one of the possible outputs of the `ps` commmand
in the `_MAP_STATUS_PS` dictionary, mapping it to `JobState.UNDETERMINED`.
  • Loading branch information
mbercx committed May 29, 2023
1 parent 062a582 commit ffc869d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aiida/schedulers/plugins/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
'W': JobState.RUNNING,
'X': JobState.DONE,
'Z': JobState.DONE,
'?': JobState.UNDETERMINED,
# `ps` can sometimes return `?` for the state of a process on macOS. This corresponds to an "unknown" state, see:
#
# https://apple.stackexchange.com/q/460394/497071
#
# Not sure about these three, I comment them out (they used to be in
# here, but they don't appear neither on ubuntu nor on Mac)
# 'F': JobState.DONE,
Expand Down

0 comments on commit ffc869d

Please sign in to comment.