当前位置: 首页>>代码示例>>Python>>正文


Python Job.priority方法代码示例

本文整理汇总了Python中job.Job.priority方法的典型用法代码示例。如果您正苦于以下问题:Python Job.priority方法的具体用法?Python Job.priority怎么用?Python Job.priority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在job.Job的用法示例。


在下文中一共展示了Job.priority方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: unit_test

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import priority [as 别名]
def unit_test():
	for i in range(0, 20):
		job = Job(nmaps=64, lmap=140, lmapapprox=60, nreds=1, lred=15, submit=i*150)
		job.approxAlgoMapVal = options.approx # Approximate 50% of the maps
		if random.random() < 0.5:
			job.priority = Job.Priority.VERY_HIGH
		jobId = simulator.addJob(job)
	
	for jobID in simulator.jobsQueue:
		myjob = simulator.jobs[jobID]
		print myjob.jobId, myjob.priority, myjob.submit

	sys.exit(0)
开发者ID:,项目名称:,代码行数:15,代码来源:

示例2: range

# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import priority [as 别名]
			else:
				job.priority=getProbabilisticSJF(job.nreds, options.sjf)
			simulator.addJob(job)
		'''
		manager.initManager(options.infile)
		if options.sjf > 0.0:
			manager.applySJFPriority(options.sjf)
		manager.copyToSimulator(simulator);
		'''
	else:
		# Submit jobs
		for i in range(0, options.jobs):
			# Create the job
			job = Job(nmaps=64, lmap=140, lmapapprox=60, nreds=1, lred=15, submit=0)
			job.approxAlgoMapVal = options.approx # Approximate X% of the maps
			job.approxDropMapVal = options.drop   # Drop X% of the maps
			job.gauss = options.gauss # +/-%
			# Probabilistic shortest job first policy 
			job.priority = getProbabilisticSJF(job.nreds, options.sjf)
			jobId = simulator.addJob(job)
	
	# Start running simulator
	simulator.run()
	
	# Summary
	print 'Nodes:   %d'  %      len(simulator.nodes)
	print 'Energy:  %.1fWh'  % (simulator.getEnergy())
	print 'Perf:    %.1fs %d jobs' % (simulator.getPerformance(), len(simulator.jobs))
	print 'Quality: %.1f%%' % (simulator.getQuality())
	
开发者ID:,项目名称:,代码行数:31,代码来源:


注:本文中的job.Job.priority方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。