Skip to content

Commit 6f03237

Browse files
stverhaedan-blanchard
authored andcommitted
fixes calls to drmaa_wcoredump and drmaa_wtermsig when the job exited 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.
1 parent 200740a commit 6f03237

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drmaa/session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,13 @@ def wait(jobId, timeout=-1):
477477
signaled = c_int()
478478
c(drmaa_wifsignaled, byref(signaled), stat)
479479
coredumped = c_int()
480-
c(drmaa_wcoredump, byref(coredumped), stat)
480+
if exited.value == 0:
481+
c(drmaa_wcoredump, byref(coredumped), stat)
481482
exit_status = c_int()
482483
c(drmaa_wexitstatus, byref(exit_status), stat)
483484
term_signal = create_string_buffer(SIGNAL_BUFFER)
484-
c(drmaa_wtermsig, term_signal, sizeof(term_signal), stat)
485+
if signaled.value == 1:
486+
c(drmaa_wtermsig, term_signal, sizeof(term_signal), stat)
485487
return JobInfo(jid_out.value.decode(), bool(exited), bool(signaled),
486488
term_signal.value.decode(), bool(coredumped),
487489
bool(aborted), int(exit_status.value), res_usage)

0 commit comments

Comments
 (0)