From fd7add7619ac9c45ccf4cef05ec2ebccf1f74be7 Mon Sep 17 00:00:00 2001 From: Stijn Verhaegen Date: Wed, 8 Mar 2017 16:27:47 +0100 Subject: [PATCH] fixes calls to drmaa_wcoredump and drmaa_wtermsig when the job exited normally to fix error when used with condor libdrmaa lib drmaa specifies these calls are only to be made when the job exited abnormally or signaled. --- drmaa/session.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drmaa/session.py b/drmaa/session.py index 8222ae6..cceab55 100644 --- a/drmaa/session.py +++ b/drmaa/session.py @@ -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)