本文整理汇总了Python中Cobalt.Proxy.ComponentProxy.get_current_event_type方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentProxy.get_current_event_type方法的具体用法?Python ComponentProxy.get_current_event_type怎么用?Python ComponentProxy.get_current_event_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cobalt.Proxy.ComponentProxy
的用法示例。
在下文中一共展示了ComponentProxy.get_current_event_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ClusterQsim
# 需要导入模块: from Cobalt.Proxy import ComponentProxy [as 别名]
# 或者: from Cobalt.Proxy.ComponentProxy import get_current_event_type [as 别名]
#.........这里部分代码省略.........
(timestamp, spec['jobid'], ":".join(spec['location']))
elif eventtype == 'E': #end
first_yield_hold = self.first_yield_hold_time_dict.get(int(spec['jobid']), 0)
if first_yield_hold > 0:
overhead = spec['start_time'] - first_yield_hold
else:
overhead = 0
message = "%s;E;%s;queue=%s qtime=%s Resource_List.nodect=%s Resource_List.walltime=%s start=%s end=%f exec_host=%s runtime=%s hold=%s overhead=%s" % \
(timestamp, spec['jobid'], spec['queue'], spec['submittime'], spec['nodes'], log_walltime, spec['start_time'],
round(float(spec['end_time']), 1), ":".join(spec['location']),
spec['runtime'], spec['hold_time'], overhead)
else:
print "---invalid event type, type=", eventtype
return
self.pbslog.LogMessage(message)
def get_live_job_by_id(self, jobid):
'''get waiting or running job instance by jobid'''
job = None
joblist = self.queues.get_jobs([{'jobid':int(jobid)}])
if joblist:
job = joblist[0]
return job
def get_jobs(self, specs):
'''get a list of jobs, each time triggers time stamp increment and job
states update'''
jobs = []
if self.event_manager.get_go_next():
del self.yielding_job_list[:]
cur_event = self.event_manager.get_current_event_type()
if cur_event in ["Q", "E"]:
self.update_job_states(specs, {}, cur_event)
self.compute_utility_scores()
#unhold holding job. MUST be after compute_utility_scores()
if cur_event == "U":
cur_job = self.event_manager.get_current_event_job()
if cur_job in self.job_hold_dict.keys():
self.unhold_job(cur_job)
else:
#if the job not in job_hold_dict, do nothing. the job should have already started
return []
if cur_event == "C":
if self.job_hold_dict.keys():
self.unhold_all()
self.event_manager.set_go_next(True)
jobs = self.queues.get_jobs([{'tag':"job"}])
if self.yielding_job_list:
jobs = [job for job in jobs if job.jobid not in self.yielding_job_list]
return jobs
get_jobs = exposed(query(get_jobs))
def update_job_states(self, specs, updates, cur_event):