From 79e81c40ad66c6181fc1fcfe7246f70c09619e46 Mon Sep 17 00:00:00 2001 From: Xiaolin Qiang <61980447+xlqiang-learn@users.noreply.github.com> Date: Mon, 29 Jan 2024 21:37:52 +0800 Subject: [PATCH 1/3] Update get_job_pendreason.py Correct the field from req.user to req.userName at line 46. --- examples/get_job_pendreason.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/get_job_pendreason.py b/examples/get_job_pendreason.py index ac6b3b9..a1319e9 100644 --- a/examples/get_job_pendreason.py +++ b/examples/get_job_pendreason.py @@ -43,7 +43,7 @@ def get_job_info(list) : req = lsf.jobInfoReq() req.reasonLevel = reasonLevel req.sourceClusterName = clusterName - req.user = "all" + req.userName = "all" req.options = lsf.ALL_JOB if len(list) > 1 : req.jobId = 0 From e4d424a80d0621a7a3737a1d9addf11210a88713 Mon Sep 17 00:00:00 2001 From: Xiaolin Qiang <61980447+xlqiang-learn@users.noreply.github.com> Date: Thu, 7 Mar 2024 07:44:20 +0800 Subject: [PATCH 2/3] Aadd an example for bsub -pack --- examples/pack_submit.py | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 examples/pack_submit.py diff --git a/examples/pack_submit.py b/examples/pack_submit.py new file mode 100644 index 0000000..e05956c --- /dev/null +++ b/examples/pack_submit.py @@ -0,0 +1,51 @@ +from pythonlsf import lsf + +def sub_pack_job(): + + + limits1 = [] + for i in range(0, lsf.LSF_RLIM_NLIMITS): + limits1.append(lsf.DEFAULT_RLIMIT) + + submitreq1 = lsf.submit() + submitreq1.command = "sleep 10" + submitreq1.options = 0 + submitreq1.options2 = 0 + submitreq1.rLimits = limits1 + + limits2 = [] + for i in range(0, lsf.LSF_RLIM_NLIMITS): + limits2.append(lsf.DEFAULT_RLIMIT) + + submitreq2 = lsf.submit() + submitreq2.command = "sleep 20" + submitreq2.options = 0 + submitreq2.options2 = 0 + submitreq2.rLimits = limits2 + + + pack_submitreq = lsf.packSubmit() + pack_submitreq.num = 2 + submits = lsf.new_submitArray(2) + lsf.submitArray_setitem(submits, 0, submitreq1) + lsf.submitArray_setitem(submits, 1, submitreq2) + pack_submitreq.reqs = submits + + pack_submitreply = lsf.packSubmitReply() + intp_acceptedNum = lsf.copy_intp(0) + intp_rejectedNum = lsf.copy_intp(0) + + + if lsf.lsb_init("test") > 0: + exit(1) + + result = lsf.lsb_submitPack(pack_submitreq, pack_submitreply, intp_acceptedNum, intp_rejectedNum) + print(result) + print(lsf.intp_value(intp_acceptedNum)) + print(lsf.intp_value(intp_rejectedNum)) + + return result + +if __name__ == '__main__': + print("LSF Clustername is :", lsf.ls_getclustername()) + sub_pack_job() From e92ec03bae5b455059de9fb1f3d2b511e65c5b2c Mon Sep 17 00:00:00 2001 From: Xiaolin Qiang <61980447+xlqiang-learn@users.noreply.github.com> Date: Thu, 7 Mar 2024 07:47:53 +0800 Subject: [PATCH 3/3] Add an array funciton of submit * --- pythonlsf/lsf.i | 1 + 1 file changed, 1 insertion(+) diff --git a/pythonlsf/lsf.i b/pythonlsf/lsf.i index 3c36f2c..d380025 100644 --- a/pythonlsf/lsf.i +++ b/pythonlsf/lsf.i @@ -54,6 +54,7 @@ int fclose(FILE *f); %array_functions(struct hostRsvInfoEnt, hostRsvInfoEntArray) %array_functions(struct hRusage, hRusageArray) %array_functions(struct hostInfo, hostInfoArray) +%array_functions(struct submit*, submitArray) //helper function for transforming char** to python list %inline %{