Skip to content

Commit

Permalink
fixes calls to drmaa_wcoredump and drmaa_wtermsig when the job exited…
Browse files Browse the repository at this point in the history
… normally to fix error when used with condor libdrmaa lib (#47)

drmaa specifies these calls are only to be made when the job exited abnormally or signaled.
  • Loading branch information
stverhae authored and dan-blanchard committed Mar 8, 2017
1 parent 200740a commit 6f03237
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drmaa/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,13 @@ def wait(jobId, timeout=-1):
signaled = c_int()
c(drmaa_wifsignaled, byref(signaled), stat)
coredumped = c_int()
c(drmaa_wcoredump, byref(coredumped), stat)
if exited.value == 0:
c(drmaa_wcoredump, byref(coredumped), stat)
exit_status = c_int()
c(drmaa_wexitstatus, byref(exit_status), stat)
term_signal = create_string_buffer(SIGNAL_BUFFER)
c(drmaa_wtermsig, term_signal, sizeof(term_signal), stat)
if signaled.value == 1:
c(drmaa_wtermsig, term_signal, sizeof(term_signal), stat)
return JobInfo(jid_out.value.decode(), bool(exited), bool(signaled),
term_signal.value.decode(), bool(coredumped),
bool(aborted), int(exit_status.value), res_usage)
Expand Down

0 comments on commit 6f03237

Please sign in to comment.