source: trunk/src/pbs.py @ 169

Last change on this file since 169 was 161, checked in by bas, 16 years ago

src/PBSQuery.py:

  • _free function not needed any more. Destructors are now in SWIG code

new generated swig code:

  • src/pbs_ifl.h
  • src/pbs.py
  • src/pbs_python.h
  • src/pbs_wrap.c
  • Property svn:keywords set to Id
File size: 21.2 KB
Line 
1# This file was created automatically by SWIG 1.3.29.
2# Don't modify this file, modify the SWIG interface instead.
3# This file is compatible with both classic and new-style classes.
4
5import _pbs
6import new
7new_instancemethod = new.instancemethod
8def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
9    if (name == "thisown"): return self.this.own(value)
10    if (name == "this"):
11        if type(value).__name__ == 'PySwigObject':
12            self.__dict__[name] = value
13            return
14    method = class_type.__swig_setmethods__.get(name,None)
15    if method: return method(self,value)
16    if (not static) or hasattr(self,name):
17        self.__dict__[name] = value
18    else:
19        raise AttributeError("You cannot add attributes to %s" % self)
20
21def _swig_setattr(self,class_type,name,value):
22    return _swig_setattr_nondynamic(self,class_type,name,value,0)
23
24def _swig_getattr(self,class_type,name):
25    if (name == "thisown"): return self.this.own()
26    method = class_type.__swig_getmethods__.get(name,None)
27    if method: return method(self)
28    raise AttributeError,name
29
30def _swig_repr(self):
31    try: strthis = "proxy of " + self.this.__repr__()
32    except: strthis = ""
33    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
34
35import types
36try:
37    _object = types.ObjectType
38    _newclass = 1
39except AttributeError:
40    class _object : pass
41    _newclass = 0
42del types
43
44
45new_attrl = _pbs.new_attrl
46new_attropl = _pbs.new_attropl
47new_batch_status = _pbs.new_batch_status
48get_error = _pbs.get_error
49ATTR_a = _pbs.ATTR_a
50ATTR_c = _pbs.ATTR_c
51ATTR_e = _pbs.ATTR_e
52ATTR_g = _pbs.ATTR_g
53ATTR_h = _pbs.ATTR_h
54ATTR_j = _pbs.ATTR_j
55ATTR_k = _pbs.ATTR_k
56ATTR_l = _pbs.ATTR_l
57ATTR_m = _pbs.ATTR_m
58ATTR_o = _pbs.ATTR_o
59ATTR_p = _pbs.ATTR_p
60ATTR_q = _pbs.ATTR_q
61ATTR_r = _pbs.ATTR_r
62ATTR_u = _pbs.ATTR_u
63ATTR_v = _pbs.ATTR_v
64ATTR_A = _pbs.ATTR_A
65ATTR_M = _pbs.ATTR_M
66ATTR_N = _pbs.ATTR_N
67ATTR_S = _pbs.ATTR_S
68ATTR_depend = _pbs.ATTR_depend
69ATTR_inter = _pbs.ATTR_inter
70ATTR_stagein = _pbs.ATTR_stagein
71ATTR_stageout = _pbs.ATTR_stageout
72ATTR_ctime = _pbs.ATTR_ctime
73ATTR_exechost = _pbs.ATTR_exechost
74ATTR_mtime = _pbs.ATTR_mtime
75ATTR_qtime = _pbs.ATTR_qtime
76ATTR_session = _pbs.ATTR_session
77ATTR_euser = _pbs.ATTR_euser
78ATTR_egroup = _pbs.ATTR_egroup
79ATTR_hashname = _pbs.ATTR_hashname
80ATTR_hopcount = _pbs.ATTR_hopcount
81ATTR_security = _pbs.ATTR_security
82ATTR_sched_hint = _pbs.ATTR_sched_hint
83ATTR_substate = _pbs.ATTR_substate
84ATTR_name = _pbs.ATTR_name
85ATTR_owner = _pbs.ATTR_owner
86ATTR_used = _pbs.ATTR_used
87ATTR_state = _pbs.ATTR_state
88ATTR_queue = _pbs.ATTR_queue
89ATTR_server = _pbs.ATTR_server
90ATTR_maxrun = _pbs.ATTR_maxrun
91ATTR_total = _pbs.ATTR_total
92ATTR_comment = _pbs.ATTR_comment
93ATTR_cookie = _pbs.ATTR_cookie
94ATTR_qrank = _pbs.ATTR_qrank
95ATTR_altid = _pbs.ATTR_altid
96ATTR_etime = _pbs.ATTR_etime
97ATTR_exitstat = _pbs.ATTR_exitstat
98ATTR_forwardx11 = _pbs.ATTR_forwardx11
99ATTR_submit_args = _pbs.ATTR_submit_args
100ATTR_umask = _pbs.ATTR_umask
101ATTR_aclgren = _pbs.ATTR_aclgren
102ATTR_aclgroup = _pbs.ATTR_aclgroup
103ATTR_aclhten = _pbs.ATTR_aclhten
104ATTR_aclhost = _pbs.ATTR_aclhost
105ATTR_acluren = _pbs.ATTR_acluren
106ATTR_acluser = _pbs.ATTR_acluser
107ATTR_altrouter = _pbs.ATTR_altrouter
108ATTR_chkptmin = _pbs.ATTR_chkptmin
109ATTR_enable = _pbs.ATTR_enable
110ATTR_fromroute = _pbs.ATTR_fromroute
111ATTR_killdelay = _pbs.ATTR_killdelay
112ATTR_maxgrprun = _pbs.ATTR_maxgrprun
113ATTR_maxque = _pbs.ATTR_maxque
114ATTR_maxuserrun = _pbs.ATTR_maxuserrun
115ATTR_qtype = _pbs.ATTR_qtype
116ATTR_rescassn = _pbs.ATTR_rescassn
117ATTR_rescdflt = _pbs.ATTR_rescdflt
118ATTR_rescmax = _pbs.ATTR_rescmax
119ATTR_rescmin = _pbs.ATTR_rescmin
120ATTR_rndzretry = _pbs.ATTR_rndzretry
121ATTR_routedest = _pbs.ATTR_routedest
122ATTR_routeheld = _pbs.ATTR_routeheld
123ATTR_routewait = _pbs.ATTR_routewait
124ATTR_routeretry = _pbs.ATTR_routeretry
125ATTR_routelife = _pbs.ATTR_routelife
126ATTR_rsvexpdt = _pbs.ATTR_rsvexpdt
127ATTR_rsvsync = _pbs.ATTR_rsvsync
128ATTR_start = _pbs.ATTR_start
129ATTR_count = _pbs.ATTR_count
130ATTR_number = _pbs.ATTR_number
131ATTR_acllogic = _pbs.ATTR_acllogic
132ATTR_aclgrpslpy = _pbs.ATTR_aclgrpslpy
133ATTR_keepcompleted = _pbs.ATTR_keepcompleted
134ATTR_disallowedtypes = _pbs.ATTR_disallowedtypes
135ATTR_aclroot = _pbs.ATTR_aclroot
136ATTR_managers = _pbs.ATTR_managers
137ATTR_dfltque = _pbs.ATTR_dfltque
138ATTR_defnode = _pbs.ATTR_defnode
139ATTR_locsvrs = _pbs.ATTR_locsvrs
140ATTR_logevents = _pbs.ATTR_logevents
141ATTR_logfile = _pbs.ATTR_logfile
142ATTR_loglevel = _pbs.ATTR_loglevel
143ATTR_mailfrom = _pbs.ATTR_mailfrom
144ATTR_nodepack = _pbs.ATTR_nodepack
145ATTR_operators = _pbs.ATTR_operators
146ATTR_queryother = _pbs.ATTR_queryother
147ATTR_resccost = _pbs.ATTR_resccost
148ATTR_rescavail = _pbs.ATTR_rescavail
149ATTR_schedit = _pbs.ATTR_schedit
150ATTR_scheduling = _pbs.ATTR_scheduling
151ATTR_status = _pbs.ATTR_status
152ATTR_syscost = _pbs.ATTR_syscost
153ATTR_pingrate = _pbs.ATTR_pingrate
154ATTR_ndchkrate = _pbs.ATTR_ndchkrate
155ATTR_tcptimeout = _pbs.ATTR_tcptimeout
156ATTR_jobstatrate = _pbs.ATTR_jobstatrate
157ATTR_polljobs = _pbs.ATTR_polljobs
158ATTR_downonerror = _pbs.ATTR_downonerror
159ATTR_jobnanny = _pbs.ATTR_jobnanny
160ATTR_ownerpurge = _pbs.ATTR_ownerpurge
161ATTR_qcqlimits = _pbs.ATTR_qcqlimits
162ATTR_momjobsync = _pbs.ATTR_momjobsync
163ATTR_maildomain = _pbs.ATTR_maildomain
164ATTR_pbsversion = _pbs.ATTR_pbsversion
165ATTR_submithosts = _pbs.ATTR_submithosts
166ATTR_allownodesubmit = _pbs.ATTR_allownodesubmit
167ATTR_autonodenp = _pbs.ATTR_autonodenp
168ATTR_servername = _pbs.ATTR_servername
169ATTR_logfilemaxsize = _pbs.ATTR_logfilemaxsize
170ATTR_logfilerolldepth = _pbs.ATTR_logfilerolldepth
171ATTR_nextjobnum = _pbs.ATTR_nextjobnum
172ATTR_NODE_state = _pbs.ATTR_NODE_state
173ATTR_NODE_np = _pbs.ATTR_NODE_np
174ATTR_NODE_properties = _pbs.ATTR_NODE_properties
175ATTR_NODE_ntype = _pbs.ATTR_NODE_ntype
176ATTR_NODE_jobs = _pbs.ATTR_NODE_jobs
177ATTR_NODE_status = _pbs.ATTR_NODE_status
178ATTR_NODE_note = _pbs.ATTR_NODE_note
179CHECKPOINT_UNSPECIFIED = _pbs.CHECKPOINT_UNSPECIFIED
180NO_HOLD = _pbs.NO_HOLD
181NO_JOIN = _pbs.NO_JOIN
182NO_KEEP = _pbs.NO_KEEP
183MAIL_AT_ABORT = _pbs.MAIL_AT_ABORT
184DELDELAY = _pbs.DELDELAY
185DELPURGE = _pbs.DELPURGE
186EXECQUEONLY = _pbs.EXECQUEONLY
187USER_HOLD = _pbs.USER_HOLD
188OTHER_HOLD = _pbs.OTHER_HOLD
189SYSTEM_HOLD = _pbs.SYSTEM_HOLD
190ND_free = _pbs.ND_free
191ND_offline = _pbs.ND_offline
192ND_down = _pbs.ND_down
193ND_reserve = _pbs.ND_reserve
194ND_job_exclusive = _pbs.ND_job_exclusive
195ND_job_sharing = _pbs.ND_job_sharing
196ND_busy = _pbs.ND_busy
197ND_state_unknown = _pbs.ND_state_unknown
198ND_timeshared = _pbs.ND_timeshared
199ND_cluster = _pbs.ND_cluster
200Q_DT_batch = _pbs.Q_DT_batch
201Q_DT_interactive = _pbs.Q_DT_interactive
202Q_DT_rerunable = _pbs.Q_DT_rerunable
203Q_DT_nonrerunable = _pbs.Q_DT_nonrerunable
204MAX_ENCODE_BFR = _pbs.MAX_ENCODE_BFR
205MGR_CMD_CREATE = _pbs.MGR_CMD_CREATE
206MGR_CMD_DELETE = _pbs.MGR_CMD_DELETE
207MGR_CMD_SET = _pbs.MGR_CMD_SET
208MGR_CMD_UNSET = _pbs.MGR_CMD_UNSET
209MGR_CMD_LIST = _pbs.MGR_CMD_LIST
210MGR_CMD_PRINT = _pbs.MGR_CMD_PRINT
211MGR_CMD_ACTIVE = _pbs.MGR_CMD_ACTIVE
212MGR_OBJ_NONE = _pbs.MGR_OBJ_NONE
213MGR_OBJ_SERVER = _pbs.MGR_OBJ_SERVER
214MGR_OBJ_QUEUE = _pbs.MGR_OBJ_QUEUE
215MGR_OBJ_JOB = _pbs.MGR_OBJ_JOB
216MGR_OBJ_NODE = _pbs.MGR_OBJ_NODE
217MSG_OUT = _pbs.MSG_OUT
218MSG_ERR = _pbs.MSG_ERR
219SHUT_SIG = _pbs.SHUT_SIG
220SHUT_IMMEDIATE = _pbs.SHUT_IMMEDIATE
221SHUT_DELAY = _pbs.SHUT_DELAY
222SHUT_QUICK = _pbs.SHUT_QUICK
223SIG_RESUME = _pbs.SIG_RESUME
224SIG_SUSPEND = _pbs.SIG_SUSPEND
225PBS_MAXHOSTNAME = _pbs.PBS_MAXHOSTNAME
226MAXPATHLEN = _pbs.MAXPATHLEN
227MAXNAMLEN = _pbs.MAXNAMLEN
228MAX_NOTE = _pbs.MAX_NOTE
229MAX_NOTE_STR = _pbs.MAX_NOTE_STR
230PBS_MAXUSER = _pbs.PBS_MAXUSER
231PBS_MAXGRPN = _pbs.PBS_MAXGRPN
232PBS_MAXQUEUENAME = _pbs.PBS_MAXQUEUENAME
233PBS_MAXSERVERNAME = _pbs.PBS_MAXSERVERNAME
234PBS_MAXSEQNUM = _pbs.PBS_MAXSEQNUM
235PBS_MAXPORTNUM = _pbs.PBS_MAXPORTNUM
236PBS_MAXSVRJOBID = _pbs.PBS_MAXSVRJOBID
237PBS_MAXCLTJOBID = _pbs.PBS_MAXCLTJOBID
238PBS_MAXDEST = _pbs.PBS_MAXDEST
239PBS_MAXROUTEDEST = _pbs.PBS_MAXROUTEDEST
240PBS_USE_IFF = _pbs.PBS_USE_IFF
241PBS_INTERACTIVE = _pbs.PBS_INTERACTIVE
242PBS_TERM_BUF_SZ = _pbs.PBS_TERM_BUF_SZ
243PBS_TERM_CCA = _pbs.PBS_TERM_CCA
244PBS_BATCH_SERVICE_NAME = _pbs.PBS_BATCH_SERVICE_NAME
245PBS_BATCH_SERVICE_PORT = _pbs.PBS_BATCH_SERVICE_PORT
246PBS_BATCH_SERVICE_NAME_DIS = _pbs.PBS_BATCH_SERVICE_NAME_DIS
247PBS_BATCH_SERVICE_PORT_DIS = _pbs.PBS_BATCH_SERVICE_PORT_DIS
248PBS_MOM_SERVICE_NAME = _pbs.PBS_MOM_SERVICE_NAME
249PBS_MOM_SERVICE_PORT = _pbs.PBS_MOM_SERVICE_PORT
250PBS_MANAGER_SERVICE_NAME = _pbs.PBS_MANAGER_SERVICE_NAME
251PBS_MANAGER_SERVICE_PORT = _pbs.PBS_MANAGER_SERVICE_PORT
252PBS_SCHEDULER_SERVICE_NAME = _pbs.PBS_SCHEDULER_SERVICE_NAME
253PBS_SCHEDULER_SERVICE_PORT = _pbs.PBS_SCHEDULER_SERVICE_PORT
254SET = _pbs.SET
255UNSET = _pbs.UNSET
256INCR = _pbs.INCR
257DECR = _pbs.DECR
258EQ = _pbs.EQ
259NE = _pbs.NE
260GE = _pbs.GE
261GT = _pbs.GT
262LE = _pbs.LE
263LT = _pbs.LT
264DFLT = _pbs.DFLT
265class attrl(_object):
266    __swig_setmethods__ = {}
267    __setattr__ = lambda self, name, value: _swig_setattr(self, attrl, name, value)
268    __swig_getmethods__ = {}
269    __getattr__ = lambda self, name: _swig_getattr(self, attrl, name)
270    def __init__(self): raise AttributeError, "No constructor defined"
271    __repr__ = _swig_repr
272    __swig_setmethods__["name"] = _pbs.attrl_name_set
273    __swig_getmethods__["name"] = _pbs.attrl_name_get
274    if _newclass:name = property(_pbs.attrl_name_get, _pbs.attrl_name_set)
275    __swig_setmethods__["resource"] = _pbs.attrl_resource_set
276    __swig_getmethods__["resource"] = _pbs.attrl_resource_get
277    if _newclass:resource = property(_pbs.attrl_resource_get, _pbs.attrl_resource_set)
278    __swig_setmethods__["value"] = _pbs.attrl_value_set
279    __swig_getmethods__["value"] = _pbs.attrl_value_get
280    if _newclass:value = property(_pbs.attrl_value_get, _pbs.attrl_value_set)
281    __swig_setmethods__["op"] = _pbs.attrl_op_set
282    __swig_getmethods__["op"] = _pbs.attrl_op_get
283    if _newclass:op = property(_pbs.attrl_op_get, _pbs.attrl_op_set)
284    def __str__(*args): return _pbs.attrl___str__(*args)
285    __swig_destroy__ = _pbs.delete_attrl
286    __del__ = lambda self : None;
287attrl_swigregister = _pbs.attrl_swigregister
288attrl_swigregister(attrl)
289
290class attropl(_object):
291    __swig_setmethods__ = {}
292    __setattr__ = lambda self, name, value: _swig_setattr(self, attropl, name, value)
293    __swig_getmethods__ = {}
294    __getattr__ = lambda self, name: _swig_getattr(self, attropl, name)
295    def __init__(self): raise AttributeError, "No constructor defined"
296    __repr__ = _swig_repr
297    __swig_setmethods__["name"] = _pbs.attropl_name_set
298    __swig_getmethods__["name"] = _pbs.attropl_name_get
299    if _newclass:name = property(_pbs.attropl_name_get, _pbs.attropl_name_set)
300    __swig_setmethods__["resource"] = _pbs.attropl_resource_set
301    __swig_getmethods__["resource"] = _pbs.attropl_resource_get
302    if _newclass:resource = property(_pbs.attropl_resource_get, _pbs.attropl_resource_set)
303    __swig_setmethods__["value"] = _pbs.attropl_value_set
304    __swig_getmethods__["value"] = _pbs.attropl_value_get
305    if _newclass:value = property(_pbs.attropl_value_get, _pbs.attropl_value_set)
306    __swig_setmethods__["op"] = _pbs.attropl_op_set
307    __swig_getmethods__["op"] = _pbs.attropl_op_get
308    if _newclass:op = property(_pbs.attropl_op_get, _pbs.attropl_op_set)
309    def __str__(*args): return _pbs.attropl___str__(*args)
310    __swig_destroy__ = _pbs.delete_attropl
311    __del__ = lambda self : None;
312attropl_swigregister = _pbs.attropl_swigregister
313attropl_swigregister(attropl)
314
315class batch_status(_object):
316    __swig_setmethods__ = {}
317    __setattr__ = lambda self, name, value: _swig_setattr(self, batch_status, name, value)
318    __swig_getmethods__ = {}
319    __getattr__ = lambda self, name: _swig_getattr(self, batch_status, name)
320    def __init__(self): raise AttributeError, "No constructor defined"
321    __repr__ = _swig_repr
322    __swig_setmethods__["name"] = _pbs.batch_status_name_set
323    __swig_getmethods__["name"] = _pbs.batch_status_name_get
324    if _newclass:name = property(_pbs.batch_status_name_get, _pbs.batch_status_name_set)
325    __swig_setmethods__["attribs"] = _pbs.batch_status_attribs_set
326    __swig_getmethods__["attribs"] = _pbs.batch_status_attribs_get
327    if _newclass:attribs = property(_pbs.batch_status_attribs_get, _pbs.batch_status_attribs_set)
328    __swig_setmethods__["text"] = _pbs.batch_status_text_set
329    __swig_getmethods__["text"] = _pbs.batch_status_text_get
330    if _newclass:text = property(_pbs.batch_status_text_get, _pbs.batch_status_text_set)
331batch_status_swigregister = _pbs.batch_status_swigregister
332batch_status_swigregister(batch_status)
333
334RESOURCE_T_NULL = _pbs.RESOURCE_T_NULL
335RESOURCE_T_ALL = _pbs.RESOURCE_T_ALL
336avail = _pbs.avail
337pbs_asyrunjob = _pbs.pbs_asyrunjob
338pbs_alterjob = _pbs.pbs_alterjob
339pbs_connect = _pbs.pbs_connect
340pbs_query_max_connections = _pbs.pbs_query_max_connections
341pbs_default = _pbs.pbs_default
342pbs_deljob = _pbs.pbs_deljob
343pbs_disconnect = _pbs.pbs_disconnect
344pbs_holdjob = _pbs.pbs_holdjob
345pbs_locjob = _pbs.pbs_locjob
346pbs_manager = _pbs.pbs_manager
347pbs_movejob = _pbs.pbs_movejob
348pbs_msgjob = _pbs.pbs_msgjob
349pbs_orderjob = _pbs.pbs_orderjob
350pbs_rescquery = _pbs.pbs_rescquery
351pbs_rescreserve = _pbs.pbs_rescreserve
352pbs_rescrelease = _pbs.pbs_rescrelease
353pbs_rerunjob = _pbs.pbs_rerunjob
354pbs_rlsjob = _pbs.pbs_rlsjob
355pbs_runjob = _pbs.pbs_runjob
356pbs_selectjob = _pbs.pbs_selectjob
357pbs_sigjob = _pbs.pbs_sigjob
358pbs_statfree = _pbs.pbs_statfree
359pbs_statjob = _pbs.pbs_statjob
360pbs_selstat = _pbs.pbs_selstat
361pbs_statque = _pbs.pbs_statque
362pbs_statserver = _pbs.pbs_statserver
363pbs_statnode = _pbs.pbs_statnode
364pbs_submit = _pbs.pbs_submit
365pbs_terminate = _pbs.pbs_terminate
366totpool = _pbs.totpool
367usepool = _pbs.usepool
368openrm = _pbs.openrm
369closerm = _pbs.closerm
370downrm = _pbs.downrm
371configrm = _pbs.configrm
372addreq = _pbs.addreq
373allreq = _pbs.allreq
374flushreq = _pbs.flushreq
375activereq = _pbs.activereq
376fullresp = _pbs.fullresp
377getreq = _pbs.getreq
378LOG_BUF_SIZE = _pbs.LOG_BUF_SIZE
379log_close = _pbs.log_close
380log_err = _pbs.log_err
381log_event = _pbs.log_event
382log_open = _pbs.log_open
383log_record = _pbs.log_record
384log_roll = _pbs.log_roll
385log_size = _pbs.log_size
386setup_env = _pbs.setup_env
387chk_file_sec = _pbs.chk_file_sec
388PBSEVENT_ERROR = _pbs.PBSEVENT_ERROR
389PBSEVENT_SYSTEM = _pbs.PBSEVENT_SYSTEM
390PBSEVENT_ADMIN = _pbs.PBSEVENT_ADMIN
391PBSEVENT_JOB = _pbs.PBSEVENT_JOB
392PBSEVENT_JOB_USAGE = _pbs.PBSEVENT_JOB_USAGE
393PBSEVENT_SECURITY = _pbs.PBSEVENT_SECURITY
394PBSEVENT_SCHED = _pbs.PBSEVENT_SCHED
395PBSEVENT_DEBUG = _pbs.PBSEVENT_DEBUG
396PBSEVENT_DEBUG2 = _pbs.PBSEVENT_DEBUG2
397PBSEVENT_FORCE = _pbs.PBSEVENT_FORCE
398PBS_EVENTCLASS_SERVER = _pbs.PBS_EVENTCLASS_SERVER
399PBS_EVENTCLASS_QUEUE = _pbs.PBS_EVENTCLASS_QUEUE
400PBS_EVENTCLASS_JOB = _pbs.PBS_EVENTCLASS_JOB
401PBS_EVENTCLASS_REQUEST = _pbs.PBS_EVENTCLASS_REQUEST
402PBS_EVENTCLASS_FILE = _pbs.PBS_EVENTCLASS_FILE
403PBS_EVENTCLASS_ACCT = _pbs.PBS_EVENTCLASS_ACCT
404PBS_EVENTCLASS_NODE = _pbs.PBS_EVENTCLASS_NODE
405PBSEVENT_MASK = _pbs.PBSEVENT_MASK
406#  PBS python interface
407#  Author: Bas van der Vlies <basv@sara.nl>
408#  Date  : 27 Feb 2002
409#  Desc. : This is python wrapper class for getting the resource
410#          mom values.
411#
412# CVS info
413# $Id: pbs.py 161 2008-09-24 13:38:53Z bas $
414# $Date: 2002/10/21 14:14:47 $
415# $Revision: 1.6 $
416#
417import string
418import types
419
420# Default linux resources to get from the mom
421#
422default_linux_res = [   
423        "availmem",     # available memory size in KB
424        "ideal_load",   # static ideal_load value
425        "loadave",      # the current load average
426        "max_load",     # static max_load value
427        "ncpus",        # number of cpus
428        "physmem",      # physical memory size in KB
429        "resi",         # resident memory size for a pid or session in KB
430        "totmem",       # total memory size in KB
431        "walltime",     # wall clock time for a pid
432]
433
434# Default irix6 resources to get from the mom
435#
436default_irix6_res = [   
437        "availmem",     # available memory size in KB
438        "loadave",      # the current load average
439        "ncpus",        # number of cpus
440        "physmem",      # physical memory size in KB
441        "resi",         # resident memory size for a pid or session in KB
442        "walltime",     # wall clock time for a pid
443        "quota",        # quota information (sizes in KB)
444]
445
446default_mom_res = [   
447        "arch",         # the architecture of the machine
448        "uname",        # the architecture of the machine
449        "cput",         # cpu time for a pid or session
450        "idletime",     # seconds of idle time
451        "mem",          # memory size for a pid or session in KB
452        "sessions",     # list of sessions in the system
453        "pids",         # list of pids in a session
454        "nsessions",    # number of sessions in the system
455        "nusers",       # number of users in the system
456        "size",         # size of a file or filesystem
457        "host",         # Name  of host on which job should be run
458        "nodes",        # Number and/or type of nodes to be reserved for exclusive use by the job
459        "other",        # Allows a  user  to  specify  site  specific  information
460        "software",     # Allows a user to specify software required by the job
461]
462
463def check_resp(dict, str):
464  """
465  Check the daemon response. If we have no permission to
466  query the values then we got a 'None' response. Else
467  if we supplied a keyword that does not exits we get a
468  '?' response
469  """
470  if not str:
471    return
472     
473  key, val = string.split(str, '=')
474  key = string.strip(key)
475  val = string.strip(val)
476
477  # Did we got a valid response
478  #
479  if not val[0] == '?':
480    dict[key] = val
481
482def use_default_keywords(id, d):
483  """
484  Get the default values from the mom daemon
485  """
486  for res in default_mom_res:
487    addreq(id, res)
488    resp = getreq(id)
489    check_resp(d, resp)
490
491  # Do not proceed if we have an empty dictionary
492  #
493  if not d:
494    return
495
496  if d['arch' ] == 'linux':
497    for res in default_linux_res:
498      addreq(id, res)
499      resp = getreq(id)
500      check_resp(d, resp)
501
502def use_user_keywords(id, d, l):
503  for res in l:
504    if type(res) is types.StringType:
505      addreq(id, res)
506      resp = getreq(id)
507      check_resp(d, resp)
508    else:
509      raise TypeError, 'Expected a string got %s :%s' %(type(res), res) 
510
511def get_mom_values(id, list = None):
512  """
513  This function will query the mom with a default resmon keywords
514  and 'arch' depended keywords. Supported archs are:
515    linux
516    irix6
517  User can also supply their own list of keywords as second parameter.
518  arguments:
519    id   : connection number with mom daemon on a node
520    list : optional parameter. If supplied then use this. A list
521           of mom keywords.
522  """
523
524  d = {}
525  if not list:
526    use_default_keywords(id, d)
527  else:
528    use_user_keywords(id, d , list)
529     
530  return d
531
532def version():
533  """
534  Returns the pbs python interface version as a string.
535  """
536  return '2.9.8'
537
538# A useful dict with error codes to text
539#
540# SVN Info:
541#       $Id: pbs.py 161 2008-09-24 13:38:53Z bas $
542#
543errors_txt = { 
544        0 : 'no error',
545        15001 :  'Unknown Job Identifier',
546        15002 : 'Undefined Attribute',
547        15003 : 'attempt to set READ ONLY attribute',
548        15004 : 'Invalid request',
549        15005 : 'Unknown batch request',
550        15006 : 'Too many submit retries',
551        15007 : 'No permission',
552        15008 : 'access from host not allowed',
553        15009 : 'job already exists',
554        15010 : 'system error occurred',
555        15011 : 'internal server error occurred',
556        15012 : 'parent job of dependent in rte que',
557        15013 : 'unknown signal name',
558        15014 : 'bad attribute value',
559        15015 : 'Cannot modify attrib in run state',
560        15016 : 'request invalid for job state',
561        15018 : 'Unknown queue name',
562        15019 : 'Invalid Credential in request',
563        15020 : 'Expired Credential in request',
564        15021 : 'Queue not enabled',
565        15022 : 'No access permission for queue',
566        15023 : 'Bad user - no password entry',
567        15024 : 'Max hop count exceeded',
568        15025 : 'Queue already exists',
569        15026 : 'incompatable queue attribute type',
570        15027 : 'Queue Busy (not empty)',
571        15028 : 'Queue name too long',
572        15029 : 'Feature',
573        15030 : 'Cannot enable queue,needs add def',
574        15031 : 'Protocol (ASN.1) error',
575        15032 : 'Bad attribute list structure',
576        15033 : 'No free connections',
577        15034 : 'No server to connect to',
578        15035 : 'Unknown resource',
579        15036 : 'Job exceeds Queue resource limits',
580        15037 : 'No Default Queue Defined',
581        15038 : 'Job Not Rerunnable',
582        15039 : 'Route rejected by all destinations',
583        15040 : 'Time in Route Queue Expired',
584        15041 : 'Request to MOM failed',
585        15042 : '(qsub) cannot access script file',
586        15043 : 'Stage In of files failed',
587        15044 : 'Resources temporarily unavailable',
588        15045 : 'Bad Group specified',
589        15046 : 'Max number of jobs in queue',
590        15047 : 'Checkpoint Busy, may be retries',
591        15048 : 'Limit exceeds allowable',
592        15049 : 'Bad Account attribute value',
593        15050 : 'Job already in exit state',
594        15051 : 'Job files not copied',
595        15052 : 'unknown job id after clean init',
596        15053 : 'No Master in Sync Set',
597        15054 : 'Invalid dependency',
598        15055 : 'Duplicate entry in List',
599        15056 : 'Bad DIS based Request Protocol',
600        15057 : 'cannot execute there',
601        15058 : 'sister rejected',
602        15059 : 'sister could not communicate',
603        15060 : 'req rejected -server shutting down',
604        15061 : 'not all tasks could checkpoint',
605        15062 : 'Named node is not in the list',
606        15063 : 'node-attribute not recognized',
607        15064 : 'Server has no node list',
608        15065 : 'Node name is too big',
609        15066 : 'Node name already exists',
610        15067 : 'Bad node-attribute value',
611        15068 : 'State values are mutually exclusive',
612        15069 : 'Error(s) during global modification of nodes',
613        15070 : 'could not contact Mom',
614        15071 : 'no time-shared nodes',
615        15201 : 'resource unknown',
616        15202 : 'parameter could not be used',
617        15203 : 'a parameter needed did not exist',
618        15204 : "something specified didn't exist",
619        15205 : 'a system error occured',
620        15206 : 'only part of reservation made'
621}
622
623def error():
624  """
625  Check if there is an error, if so fetch the error message string.
626  It says more then a number!
627  """
628  e = get_error()
629  if errors_txt.has_key(e):
630     return (e, errors_txt[e])
631  else:
632     return (e, "Could not find a text for this error, uhhh")
633
634
635cvar = _pbs.cvar
636
Note: See TracBrowser for help on using the repository browser.