pbs_ifl_mock.py 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. # coding: utf-8
  2. # Copyright (C) 1994-2018 Altair Engineering, Inc.
  3. # For more information, contact Altair at www.altair.com.
  4. #
  5. # This file is part of the PBS Professional ("PBS Pro") software.
  6. #
  7. # Open Source License Information:
  8. #
  9. # PBS Pro is free software. You can redistribute it and/or modify it under the
  10. # terms of the GNU Affero General Public License as published by the Free
  11. # Software Foundation, either version 3 of the License, or (at your option) any
  12. # later version.
  13. #
  14. # PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
  15. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. # FOR A PARTICULAR PURPOSE.
  17. # See the GNU Affero General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Affero General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. #
  22. # Commercial License Information:
  23. #
  24. # For a copy of the commercial license terms and conditions,
  25. # go to: (http://www.pbspro.com/UserArea/agreement.html)
  26. # or contact the Altair Legal Department.
  27. #
  28. # Altair’s dual-license business model allows companies, individuals, and
  29. # organizations to create proprietary derivative works of PBS Pro and
  30. # distribute them - whether embedded or bundled with other software -
  31. # under a commercial license agreement.
  32. #
  33. # Use of Altair’s trademarks, including but not limited to "PBS™",
  34. # "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
  35. # trademark licensing policies.
  36. MGR_OBJ_NONE = -1
  37. MGR_OBJ_SERVER = 0
  38. MGR_OBJ_QUEUE = 1
  39. MGR_OBJ_JOB = 2
  40. MGR_OBJ_NODE = 3
  41. MGR_OBJ_RESV = 4
  42. MGR_OBJ_RSC = 5
  43. MGR_OBJ_SCHED = 6
  44. MGR_OBJ_HOST = 7
  45. MGR_OBJ_HOOK = 8
  46. MGR_OBJ_PBS_HOOK = 9
  47. MGR_CMD_NONE = 10
  48. MGR_CMD_CREATE = 11
  49. MGR_CMD_DELETE = 12
  50. MGR_CMD_SET = 13
  51. MGR_CMD_UNSET = 14
  52. MGR_CMD_LIST = 15
  53. MGR_CMD_PRINT = 16
  54. MGR_CMD_ACTIVE = 17
  55. MGR_CMD_IMPORT = 18
  56. MGR_CMD_EXPORT = 19
  57. MSG_OUT = 1
  58. MSG_ERR = 2
  59. ATTR_a = 'Execution_Time'
  60. ATTR_c = 'Checkpoint'
  61. ATTR_e = 'Error_Path'
  62. ATTR_g = 'group_list'
  63. ATTR_h = 'Hold_Types'
  64. ATTR_j = 'Join_Path'
  65. ATTR_J = 'array_indices_submitted'
  66. ATTR_k = 'Keep_Files'
  67. ATTR_l = 'Resource_List'
  68. ATTR_m = 'Mail_Points'
  69. ATTR_o = 'Output_Path'
  70. ATTR_p = 'Priority'
  71. ATTR_q = 'destination'
  72. ATTR_R = 'Remove_Files'
  73. ATTR_r = 'Rerunable'
  74. ATTR_u = 'User_List'
  75. ATTR_v = 'Variable_List'
  76. ATTR_A = 'Account_Name'
  77. ATTR_M = 'Mail_Users'
  78. ATTR_N = 'Job_Name'
  79. ATTR_S = 'Shell_Path_List'
  80. ATTR_W = 'Additional_Attributes' # Not in pbs_ifl.h
  81. ATTR_array_indices_submitted = ATTR_J
  82. ATTR_depend = 'depend'
  83. ATTR_inter = 'interactive'
  84. ATTR_sandbox = 'sandbox'
  85. ATTR_stagein = 'stagein'
  86. ATTR_stageout = 'stageout'
  87. ATTR_resvTag = 'reserve_Tag'
  88. ATTR_resv_start = 'reserve_start'
  89. ATTR_resv_end = 'reserve_end'
  90. ATTR_resv_duration = 'reserve_duration'
  91. ATTR_resv_state = 'reserve_state'
  92. ATTR_resv_substate = 'reserve_substate'
  93. ATTR_auth_u = 'Authorized_Users'
  94. ATTR_auth_g = 'Authorized_Groups'
  95. ATTR_auth_h = 'Authorized_Hosts'
  96. ATTR_pwd = 'pwd'
  97. ATTR_cred = 'cred'
  98. ATTR_nodemux = 'no_stdio_sockets'
  99. ATTR_umask = 'umask'
  100. ATTR_block = 'block'
  101. ATTR_convert = 'qmove'
  102. ATTR_DefaultChunk = 'default_chunk'
  103. ATTR_X11_cookie = 'forward_x11_cookie'
  104. ATTR_X11_port = 'forward_x11_port'
  105. ATTR_resv_standing = 'reserve_standing'
  106. ATTR_resv_count = 'reserve_count'
  107. ATTR_resv_idx = 'reserve_index'
  108. ATTR_resv_rrule = 'reserve_rrule'
  109. ATTR_resv_execvnodes = 'reserve_execvnodes'
  110. ATTR_resv_timezone = 'reserve_timezone'
  111. ATTR_ctime = 'ctime'
  112. ATTR_estimated = 'estimated'
  113. ATTR_exechost = 'exec_host'
  114. ATTR_exechost2 = 'exec_host2'
  115. ATTR_execvnode = 'exec_vnode'
  116. ATTR_resv_nodes = 'resv_nodes'
  117. ATTR_mtime = 'mtime'
  118. ATTR_qtime = 'qtime'
  119. ATTR_session = 'session_id'
  120. ATTR_jobdir = 'jobdir'
  121. ATTR_euser = 'euser'
  122. ATTR_egroup = 'egroup'
  123. ATTR_project = 'project'
  124. ATTR_hashname = 'hashname'
  125. ATTR_hopcount = 'hop_count'
  126. ATTR_security = 'security'
  127. ATTR_sched_hint = 'sched_hint'
  128. ATTR_SchedSelect = 'schedselect'
  129. ATTR_substate = 'substate'
  130. ATTR_name = 'Job_Name'
  131. ATTR_owner = 'Job_Owner'
  132. ATTR_used = 'resources_used'
  133. ATTR_state = 'job_state'
  134. ATTR_queue = 'queue'
  135. ATTR_server = 'server'
  136. ATTR_maxrun = 'max_running'
  137. ATTR_max_run = 'max_run'
  138. ATTR_max_run_res = 'max_run_res'
  139. ATTR_max_run_soft = 'max_run_soft'
  140. ATTR_max_run_res_soft = 'max_run_res_soft'
  141. ATTR_total = 'total_jobs'
  142. ATTR_comment = 'comment'
  143. ATTR_cookie = 'cookie'
  144. ATTR_qrank = 'queue_rank'
  145. ATTR_altid = 'alt_id'
  146. ATTR_altid2 = 'alt_id2'
  147. ATTR_metaid = 'meta_id'
  148. ATTR_acct_id = 'accounting_id'
  149. ATTR_array = 'array'
  150. ATTR_array_id = 'array_id'
  151. ATTR_array_index = 'array_index'
  152. ATTR_array_state_count = 'array_state_count'
  153. ATTR_array_indices_remaining = 'array_indices_remaining'
  154. ATTR_etime = 'etime'
  155. ATTR_gridname = 'gridname'
  156. ATTR_refresh = 'last_context_refresh'
  157. ATTR_ReqCredEnable = 'require_cred_enable'
  158. ATTR_ReqCred = 'require_cred'
  159. ATTR_runcount = 'run_count'
  160. ATTR_stime = 'stime'
  161. ATTR_pset = 'pset'
  162. ATTR_executable = 'executable'
  163. ATTR_Arglist = 'argument_list'
  164. ATTR_version = 'pbs_version'
  165. ATTR_eligible_time = 'eligible_time'
  166. ATTR_accrue_type = 'accrue_type'
  167. ATTR_sample_starttime = 'sample_starttime'
  168. ATTR_job_kill_delay = 'job_kill_delay'
  169. ATTR_history_timestamp = 'history_timestamp'
  170. ATTR_stageout_status = 'Stageout_status'
  171. ATTR_exit_status = 'Exit_status'
  172. ATTR_submit_arguments = 'Submit_arguments'
  173. ATTR_resv_name = 'Reserve_Name'
  174. ATTR_resv_owner = 'Reserve_Owner'
  175. ATTR_resv_type = 'reserve_type'
  176. ATTR_resv_Tag = 'reservation_Tag'
  177. ATTR_resv_ID = 'reserve_ID'
  178. ATTR_resv_retry = 'reserve_retry'
  179. ATTR_aclgren = 'acl_group_enable'
  180. ATTR_aclgroup = 'acl_groups'
  181. ATTR_aclhten = 'acl_host_enable'
  182. ATTR_aclhost = 'acl_hosts'
  183. ATTR_acluren = 'acl_user_enable'
  184. ATTR_acluser = 'acl_users'
  185. ATTR_altrouter = 'alt_router'
  186. ATTR_chkptmin = 'checkpoint_min'
  187. ATTR_enable = 'enabled'
  188. ATTR_fromroute = 'from_route_only'
  189. ATTR_HasNodes = 'hasnodes'
  190. ATTR_killdelay = 'kill_delay'
  191. ATTR_maxgrprun = 'max_group_run'
  192. ATTR_maxgrprunsoft = 'max_group_run_soft'
  193. ATTR_maxque = 'max_queuable'
  194. ATTR_max_queued = 'max_queued'
  195. ATTR_max_queued_res = 'max_queued_res'
  196. ATTR_maxuserrun = 'max_user_run'
  197. ATTR_maxuserrunsoft = 'max_user_run_soft'
  198. ATTR_qtype = 'queue_type'
  199. ATTR_rescassn = 'resources_assigned'
  200. ATTR_rescdflt = 'resources_default'
  201. ATTR_rescmax = 'resources_max'
  202. ATTR_rescmin = 'resources_min'
  203. ATTR_rndzretry = 'rendezvous_retry'
  204. ATTR_routedest = 'route_destinations'
  205. ATTR_routeheld = 'route_held_jobs'
  206. ATTR_routewait = 'route_waiting_jobs'
  207. ATTR_routeretry = 'route_retry_time'
  208. ATTR_routelife = 'route_lifetime'
  209. ATTR_rsvexpdt = 'reserved_expedite'
  210. ATTR_rsvsync = 'reserved_sync'
  211. ATTR_start = 'started'
  212. ATTR_count = 'state_count'
  213. ATTR_number = 'number_jobs'
  214. ATTR_SvrHost = 'server_host'
  215. ATTR_aclroot = 'acl_roots'
  216. ATTR_managers = 'managers'
  217. ATTR_dfltque = 'default_queue'
  218. ATTR_defnode = 'default_node'
  219. ATTR_locsvrs = 'location_servers'
  220. ATTR_logevents = 'log_events'
  221. ATTR_logfile = 'log_file'
  222. ATTR_mailfrom = 'mail_from'
  223. ATTR_nodepack = 'node_pack'
  224. ATTR_nodefailrq = 'node_fail_requeue'
  225. ATTR_operators = 'operators'
  226. ATTR_queryother = 'query_other_jobs'
  227. ATTR_resccost = 'resources_cost'
  228. ATTR_rescavail = 'resources_available'
  229. ATTR_maxuserres = 'max_user_res'
  230. ATTR_maxuserressoft = 'max_user_res_soft'
  231. ATTR_maxgroupres = 'max_group_res'
  232. ATTR_maxgroupressoft = 'max_group_res_soft'
  233. ATTR_maxarraysize = 'max_array_size'
  234. ATTR_PNames = 'pnames'
  235. ATTR_schedit = 'scheduler_iteration'
  236. ATTR_scheduling = 'scheduling'
  237. ATTR_status = 'server_state'
  238. ATTR_syscost = 'system_cost'
  239. ATTR_FlatUID = 'flatuid'
  240. ATTR_FLicenses = 'FLicenses'
  241. ATTR_ResvEnable = 'resv_enable'
  242. ATTR_aclResvgren = 'acl_resv_group_enable'
  243. ATTR_aclResvgroup = 'acl_resv_groups'
  244. ATTR_aclResvhten = 'acl_resv_host_enable'
  245. ATTR_aclResvhost = 'acl_resv_hosts'
  246. ATTR_aclResvuren = 'acl_resv_user_enable'
  247. ATTR_aclResvuser = 'acl_resv_users'
  248. ATTR_NodeGroupEnable = 'node_group_enable'
  249. ATTR_NodeGroupKey = 'node_group_key'
  250. ATTR_ssignon_enable = 'single_signon_password_enable'
  251. ATTR_dfltqdelargs = 'default_qdel_arguments'
  252. ATTR_dfltqsubargs = 'default_qsub_arguments'
  253. ATTR_rpp_retry = 'rpp_retry'
  254. ATTR_rpp_highwater = 'rpp_highwater'
  255. ATTR_rpp_max_pkt_check = 'rpp_max_pkt_check'
  256. ATTR_license_location = 'pbs_license_file_location'
  257. ATTR_pbs_license_info = 'pbs_license_info'
  258. ATTR_license_min = 'pbs_license_min'
  259. ATTR_license_max = 'pbs_license_max'
  260. ATTR_license_linger = 'pbs_license_linger_time'
  261. ATTR_license_count = 'license_count'
  262. ATTR_job_sort_formula = 'job_sort_formula'
  263. ATTR_EligibleTimeEnable = 'eligible_time_enable'
  264. ATTR_resv_retry_init = 'reserve_retry_init'
  265. ATTR_resv_retry_cutoff = 'reserve_retry_cutoff'
  266. ATTR_JobHistoryEnable = 'job_history_enable'
  267. ATTR_JobHistoryDuration = 'job_history_duration'
  268. ATTR_max_concurrent_prov = 'max_concurrent_provision'
  269. ATTR_resv_post_processing = 'resv_post_processing_time'
  270. ATTR_backfill_depth = 'backfill_depth'
  271. ATTR_job_requeue_timeout = 'job_requeue_timeout'
  272. ATTR_SchedHost = 'sched_host'
  273. ATTR_sched_cycle_len = 'sched_cycle_length'
  274. ATTR_do_not_span_psets = 'do_not_span_psets'
  275. ATTR_soft_time = 'soft_limit_time'
  276. ATTR_power_provisioning = 'power_provisioning'
  277. ATTR_max_job_sequence_id = 'max_job_sequence_id'
  278. ATTR_rel_list = 'resource_released_list'
  279. ATTR_released = 'resources_released'
  280. ATTR_restrict_res_to_release_on_suspend = 'restrict_res_to_release_on_suspend'
  281. ATTR_sched_preempt_enforce_resumption = 'sched_preempt_enforce_resumption'
  282. ATTR_tolerate_node_failures = 'tolerate_node_failures'
  283. ATTR_NODE_Host = 'Host'
  284. ATTR_NODE_Mom = 'Mom'
  285. ATTR_NODE_Port = 'Port'
  286. ATTR_NODE_state = 'state'
  287. ATTR_NODE_ntype = 'ntype'
  288. ATTR_NODE_jobs = 'jobs'
  289. ATTR_NODE_resvs = 'resv'
  290. ATTR_NODE_resv_enable = 'resv_enable'
  291. ATTR_NODE_np = 'np'
  292. ATTR_NODE_pcpus = 'pcpus'
  293. ATTR_NODE_properties = 'properties'
  294. ATTR_NODE_NoMultiNode = 'no_multinode_jobs'
  295. ATTR_NODE_No_Tasks = 'no_tasks'
  296. ATTR_NODE_Sharing = 'sharing'
  297. ATTR_NODE_HPCBP_User_name = 'hpcbp_user_name'
  298. ATTR_NODE_HPCBP_WS_address = 'hpcbp_webservice_address'
  299. ATTR_NODE_HPCBP_Stage_protocol = 'hpcbp_stage_protocol'
  300. ATTR_NODE_HPCBP_enable = 'hpcbp_enable'
  301. ATTR_NODE_ProvisionEnable = 'provision_enable'
  302. ATTR_NODE_current_aoe = 'current_aoe'
  303. ATTR_NODE_in_multivnode_host = 'in_multivnode_host'
  304. ATTR_NODE_License = 'license'
  305. ATTR_NODE_LicenseInfo = 'license_info'
  306. ATTR_NODE_TopologyInfo = 'topology_info'
  307. ATTR_NODE_last_used_time = 'last_used_time'
  308. ATTR_NODE_last_state_change_time = 'last_state_change_time'
  309. ATTR_RESC_TYPE = 'type'
  310. ATTR_RESC_FLAG = 'flag'
  311. SHUT_IMMEDIATE = 0x0
  312. SHUT_DELAY = 0x01
  313. SHUT_QUICK = 0x02
  314. SHUT_WHO_SCHED = 0x10
  315. SHUT_WHO_MOM = 0x20
  316. SHUT_WHO_SECDRY = 0x40
  317. SHUT_WHO_IDLESECDRY = 0x80
  318. SHUT_WHO_SECDONLY = 0x100
  319. USER_HOLD = 'u'
  320. OTHER_HOLD = 'o'
  321. SYSTEM_HOLD = 's'
  322. BAD_PASSWORD_HOLD = 'p'
  323. class attropl:
  324. def __init__(self):
  325. self.name = None
  326. self.value = None
  327. self.attribute = None
  328. self.next = None
  329. self.resource = None
  330. self.op = None
  331. class attrl:
  332. def __init__(self):
  333. self.name = None
  334. self.value = None
  335. self.attribute = None
  336. self.next = None
  337. self.resource = None
  338. self.op = None
  339. class batch_status:
  340. def __init__(self):
  341. self.next = None
  342. self.name = None
  343. self.attribs = None
  344. self.text = None
  345. class ecl_attrerr:
  346. def __init__(self):
  347. self.ecl_attribute = None
  348. self.ecl_errcode = None
  349. self.ecl_errmsg = None
  350. class ecl_attribute_errors:
  351. def __init(self):
  352. self.ecl_numerrors = None
  353. self.ecl_attrerr = None
  354. def pbs_asyrunjob(c, jobid, attrib, extend):
  355. pass
  356. def pbs_alterjob(c, jobid, attrib, extend):
  357. pass
  358. def pbs_connect(c):
  359. pass
  360. def pbs_connect_extend(c, extend):
  361. pass
  362. def pbs_default(void):
  363. pass
  364. def pbs_deljob(c, jobid, extend):
  365. pass
  366. def pbs_disconnect(c):
  367. pass
  368. def pbs_geterrmsg(c):
  369. pass
  370. def pbs_holdjob(c, jobid, hold, extend):
  371. pass
  372. def pbs_locjob(c, jobid, extend):
  373. pass
  374. def pbs_manager(c, cmd, type, id, attropl, extend):
  375. pass
  376. def pbs_movejob(c, jobid, destin, extend):
  377. pass
  378. def pbs_msgjob(c, jobid, file, msg, extend):
  379. pass
  380. def pbs_orderjob(c, jobid1, jobid2, extend):
  381. pass
  382. def pbs_rerunjob(c, jobid, extend):
  383. pass
  384. def pbs_rlsjob(c, jobid, hold, extend):
  385. pass
  386. def pbs_runjob(c, jobid, loc, extend):
  387. pass
  388. def pbs_selectjob(c, attropl, extend):
  389. pass
  390. def pbs_sigjob(c, jobid, sig, extend):
  391. pass
  392. def pbs_statfree(batch_status):
  393. pass
  394. def pbs_statjob(c, jobid, attrl, extend):
  395. pass
  396. def pbs_selstat(c, attropl, attrl, extend):
  397. pass
  398. def pbs_statque(c, q, attrl, extend):
  399. pass
  400. def pbs_statserver(c, attrl, extend):
  401. pass
  402. def pbs_statsched(c, attrl, extend):
  403. pass
  404. def pbs_stathost(c, id, attrl, extend):
  405. pass
  406. def pbs_statnode(c, id, attrl, extend):
  407. pass
  408. def pbs_statvnode(c, id, attrl, extend):
  409. pass
  410. def pbs_statresv(c, id, attrl, extend):
  411. pass
  412. def pbs_stathook(c, id, attrl, s1):
  413. pass
  414. def pbs_statrsc(c, id, attrl, extend):
  415. pass
  416. def pbs_get_attributes_in_error(c):
  417. pass
  418. def pbs_submit(c, attropl, script, destin, extend):
  419. pass
  420. def pbs_submit_resv(c, attropl, jobid):
  421. pass
  422. def pbs_delresv(c, id, extend):
  423. pass
  424. def pbs_terminate(c, manner, extend):
  425. pass
  426. def pbs_modify_resv(c, resvid, attrib, extend):
  427. pass