File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from pythonlsf import lsf
2+ import sys
3+
4+
5+ def modify_job (job_id ):
6+ """
7+ Modify a job...
8+ """
9+ submitreq = lsf .submit ()
10+ submitreq .command = str (job_id );
11+ submitreq .options = 0
12+ submitreq .resReq = "rusage[mem=3500]"
13+ submitreq .options |= lsf .SUB_MODIFY
14+ submitreq .options |= lsf .SUB_RES_REQ
15+ submitreq .options2 = 0
16+ submitreq .options3 = 0
17+ submitreq .options4 = 0
18+
19+ limits = []
20+ for _ in range (0 , lsf .LSF_RLIM_NLIMITS ):
21+ limits .append (lsf .DEFAULT_RLIMIT )
22+ submitreq .rLimits = limits
23+
24+ submitreply = lsf .submitReply ()
25+
26+ if lsf .lsb_init ("test" ) > 0 :
27+ exit (1 )
28+
29+
30+ job_id = lsf .lsb_modify (submitreq , submitreply , - 1 )
31+ return job_id
32+
33+
34+ if __name__ == '__main__' :
35+ print ("LSF Clustername is :" , lsf .ls_getclustername ())
36+ job_id = int (sys .argv [1 ])
37+ print ("job_id = " , str (job_id ))
38+ print (modify_job (job_id ))
You can’t perform that action at this time.
0 commit comments