forked from IBMSpectrumComputing/lsf-python-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisp_limit.py
More file actions
31 lines (23 loc) · 795 Bytes
/
disp_limit.py
File metadata and controls
31 lines (23 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from pythonlsf import lsf
def printLimit():
if lsf.lsb_init("test") > 0:
return -1;
req = lsf.limitInfoReq()
req.name = " ";
pp_ents = lsf.calloc_limitInfoEntPtrPtr()
intp_size = lsf.copy_intp(0)
lsinfo = lsf.lsInfo()
rc = lsf.lsb_limitInfo(req, pp_ents, intp_size, lsinfo)
if rc == -1 :
print('call lsf failed')
return -1;
ents = lsf.limitInfoEntPtrPtr_value(pp_ents)
size = lsf.intp_value(intp_size)
print("{} limits in the cluster.".format(size))
for i in range(size) :
ent = lsf.limitInfoEntArray_getitem(ents, i)
print('No.{} limit name : {}'.format(i, ent.name))
return 0
if __name__ == '__main__':
print("LSF Clustername is : {}".format(lsf.ls_getclustername()))
printLimit()