Skip to content

Update get_job_pendreason.py #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/get_job_pendreason.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 51 additions & 0 deletions examples/pack_submit.py
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions pythonlsf/lsf.i
Original file line number Diff line number Diff line change
Expand Up @@ -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 %{
Expand Down