• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python math.const函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中schedcat.util.math.const函数的典型用法代码示例。如果您正苦于以下问题:Python const函数的具体用法?Python const怎么用?Python const使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: oheads

    def oheads(self, sched=False):
        self.o.lock = const(3)
        self.o.unlock = const(5)
        self.o.read_lock = const(7)
        self.o.read_unlock = const(11)
        self.o.syscall_in = const(17)
        self.o.syscall_out = const(19)

        if sched:
            self.o.ipi_latency = const(23)
            self.o.schedule    = const(27)
            self.o.ctx_switch  = const(31)
            self.o.cache_affinity_loss.set_cpmd_cost(m.CacheDelay.L1, const(41))
开发者ID:ChenZewei,项目名称:schedcat,代码行数:13,代码来源:overheads.py


示例2: zero_overheads

 def zero_overheads(self):
     # cache-related preemption/migration delay
     self.cache_affinity_loss = CacheDelay()
     # cost of loading working set into cache at start of execution
     self.initial_cache_load = CacheDelay()
     for (name, field) in self.FIELD_MAPPING:
         self.__dict__[field] = const(0)
开发者ID:binarybison,项目名称:schedcat,代码行数:7,代码来源:model.py


示例3: test_ctx_switch

 def test_ctx_switch(self):
     self.o.ctx_switch = const(100)
     self.assertEqual(pfair.charge_scheduling_overheads(self.o, 4,  False, self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, 12500)
     self.assertEqual(self.ts[1].cost,  6500)
     self.unchanged_period()
     self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:7,代码来源:overheads.py


示例4: test_tick

 def test_tick(self):
     self.o.tick = const(50)
     self.assertEqual(pfair.charge_scheduling_overheads(self.o, 4,  False, self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, 11500)
     self.assertEqual(self.ts[1].cost,  6000)
     self.unchanged_period()
     self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:7,代码来源:overheads.py


示例5: test_cache_affinity_loss

 def test_cache_affinity_loss(self):
     self.o.cache_affinity_loss = const(0.5)
     self.assertEqual(pfair.charge_scheduling_overheads(self.o, 4,  False, self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, 10500)
     self.assertEqual(self.ts[1].cost,  5000)
     self.unchanged_period()
     self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:7,代码来源:overheads.py


示例6: test_dedicated

    def test_dedicated(self):
        self.o.ipi_latency = const(100)
        self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4,  True, self.ts), self.ts)
        self.assertEqual(self.ts[0].cost, 10100)
        self.assertEqual(self.ts[1].cost,  5100)
        self.unchanged_period()
        self.unchanged_deadline()

        self.o.release = const(133)
        self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4,  True, self.ts), self.ts)
        self.assertEqual(jlfp.quantize_params(self.ts), self.ts)
        self.assertEqual(self.ts[0].cost, 10333)
        self.assertEqual(self.ts[1].cost,  5333)

        self.unchanged_period()
        self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:16,代码来源:overheads.py


示例7: test_ipi_latency

 def test_ipi_latency(self):
     # IPI latency is irrelevant for Pfair
     self.o.ipi_latency = const(1000)
     self.assertEqual(pfair.charge_scheduling_overheads(self.o, 4,  False, self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, 10000)
     self.assertEqual(self.ts[1].cost,  5000)
     self.unchanged_period()
     self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:8,代码来源:overheads.py


示例8: test_release

 def test_release(self):
     self.o.release = const(1)
     self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4,  False, self.ts), self.ts)
     self.assertEqual(jlfp.quantize_params(self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, 10005)
     self.assertEqual(self.ts[1].cost,  5005)
     self.unchanged_period()
     self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:8,代码来源:overheads.py


示例9: test_initial_load

 def test_initial_load(self):
     self.o.initial_cache_load = const(4)
     self.assertEqual(jlfp.charge_initial_load(self.o, self.ts), self.ts)
     self.assertEqual(jlfp.quantize_params(self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, 10004)
     self.assertEqual(self.ts[1].cost,  5004)
     self.unchanged_period()
     self.unchanged_deadline()
开发者ID:ChenZewei,项目名称:schedcat,代码行数:8,代码来源:overheads.py


示例10: test_release_latency

 def test_release_latency(self):
     self.o.release_latency = const(1)
     self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4,  False, self.ts), self.ts)
     self.assertEqual(jlfp.quantize_params(self.ts), self.ts)
     self.unchanged_cost()
     self.assertEqual(self.ts[0].period, 99999)
     self.assertEqual(self.ts[1].period, 49999)
     self.assertEqual(self.ts[0].deadline, 99999)
     self.assertEqual(self.ts[1].deadline, 49999)
开发者ID:ChenZewei,项目名称:schedcat,代码行数:9,代码来源:overheads.py


示例11: test_tick_example

 def test_tick_example(self):
     e1  = 2000
     e2  = 3000
     Q   = 5000
     tck = 2000
     self.ts[0].cost = e1
     self.ts[1].cost = e2
     self.o.tick = const(tck)
     self.o.quantum_length = Q
     self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 1,  False, self.ts), self.ts)
     self.assertEqual(jlfp.quantize_params(self.ts), self.ts)
     self.assertEqual(self.ts[0].cost, int(ceil(30000 / 3)))
     self.assertEqual(self.ts[1].cost, 5000 + int(ceil(20000 / 3)))
开发者ID:ChenZewei,项目名称:schedcat,代码行数:13,代码来源:overheads.py


示例12: load_approximations

    def load_approximations(self, fname, non_decreasing=True, custom_fields=None,
                            per_cpu_task_counts=False, num_cpus=None):
        if custom_fields is None:
            custom_fields = []

        data = load_column_csv(fname, convert=float)
        if not 'TASK-COUNT' in data.by_name:
            raise IOError, "TASK-COUNT column is missing"

        # initialize custom fields, if any
        for (name, field) in custom_fields:
            self.__dict__[field] = const(0)

        for (name, field) in Overheads.FIELD_MAPPING + custom_fields:
            if name in data.by_name:
                points = zip(data.by_name['TASK-COUNT'], data.by_name[name])
                if per_cpu_task_counts:
                    points = [(num_cpus * x, y) for (x, y) in points]
                if non_decreasing:
                    self.__dict__[field] = monotonic_pwlin(points)
                else:
                    self.__dict__[field] = piece_wise_linear(points)
开发者ID:binarybison,项目名称:schedcat,代码行数:22,代码来源:model.py


示例13: custom_range

            x += step
    else: # should really be if step < 0 with an extra check for step == 0 
        while x > stop:
            my_list.append(x)
            x += step
    return my_list

def custom_range():
    my_list = range(2,10)+range(10,60,10)+range(60,201,20)
    print my_list
    return my_list

#main
o_np_avg = m.Overheads()
o_np_avg.zero_overheads()
o_np_avg.ctx_switch = const(27)

o_np_max = m.Overheads()
o_np_max.zero_overheads()
o_np_max.ctx_switch = const(44)

for wgs in custom_range():
    global u
    u_no = 0.0
    u_avg = 0.0
    u_max = 0.0
    u_no_99 = 0.0
    u_avg_99 = 0.0
    u_max_99 = 0.0
    
    for u in float_range(0.2, 1.01, 0.01):
开发者ID:RSpliet,项目名称:schedcat,代码行数:31,代码来源:gpu-lp-block-util.py


示例14: __init__

 def __init__(self, l1=0, l2=0, l3=0, mem=0):
     self.mem_hierarchy  = [const(mem), const(l1), const(l2), const(l3)]
     for (i, name) in CacheDelay.MAPPING:
         self.__dict__[name] = self.mem_hierarchy[i]
开发者ID:binarybison,项目名称:schedcat,代码行数:4,代码来源:model.py


示例15: setUp

 def setUp(self):
     self.f     = m.lin(1, 3)
     self.c     = m.const(123)
     self.pwlin = m.monotonic_pwlin([(0, 1), (1, 0), (1, 4), (2, 5)])
开发者ID:Mutinifni,项目名称:schedcat3,代码行数:4,代码来源:util.py


示例16: test_spinlock_infeasible

 def test_spinlock_infeasible(self):
     self.o.syscall_in = const(10000000)
     self.assertIs(locking.charge_spinlock_overheads(self.o, self.ts), False)
开发者ID:ChenZewei,项目名称:schedcat,代码行数:3,代码来源:overheads.py


示例17: ts_test

def ts_test(ts):
    global b
    global b_lp
    global b_np
    #global b_np_qpa
    global avg_np
    global max_np
    global avg_lp
    global max_lp
    global avg_p
    global max_p
    global printed_example
    
    o_np_avg = m.Overheads()
    o_np_avg.zero_overheads()
    o_np_avg.ctx_switch = const(27)
    
    o_np_max = m.Overheads()
    o_np_max.zero_overheads()
    o_np_max.ctx_switch = const(44)
    
    o_p_avg = m.Overheads()
    o_p_avg.zero_overheads()
    o_p_avg.ctx_switch = const(263)
    
    o_p_max = m.Overheads()
    o_p_max.zero_overheads()
    o_p_max.ctx_switch = const(434)
    
    for t in ts:
        t.wss = 0
    
    ts_np = make_np(ts.copy())
    ts_lp = make_lp(ts.copy())
    ts_np_avg = charge_sched_overheads_np(o_np_avg, ts_np.copy())
    ts_np_max = charge_sched_overheads_np(o_np_max, ts_np.copy())
    ts_lp_avg = fp.charge_scheduling_overheads(o_np_avg, 1,  False, ts_lp.copy())
    ts_lp_max = fp.charge_scheduling_overheads(o_np_max, 1,  False, ts_lp.copy())
    ts_p_avg = fp.charge_scheduling_overheads(o_p_avg, 1,  False, ts.copy())
    ts_p_max = fp.charge_scheduling_overheads(o_p_max, 1,  False, ts.copy())
    
    if edf.is_schedulable(1, ts):
        b += 1
    #if edf.is_schedulable(1, ts, preemptive=False):
    #    b_np += 1
    if edf.is_schedulable(1, ts_lp):
        b_lp += 1
    if edf.is_schedulable(1, ts_np):
        b_np += 1
    if edf.is_schedulable(1, ts_np_avg):
        avg_np += 1
    if edf.is_schedulable(1, ts_np_max):
        max_np += 1
    if edf.is_schedulable(1, ts_lp_avg):
        avg_lp += 1
    if edf.is_schedulable(1, ts_lp_max):
        max_lp += 1
    if edf.is_schedulable(1, ts_p_avg):
        avg_p += 1
    if edf.is_schedulable(1, ts_p_max):
        max_p += 1
开发者ID:RSpliet,项目名称:schedcat,代码行数:61,代码来源:gpu-ctxswitch.py


示例18: test_dpcp_integral

 def test_dpcp_integral(self):
     self.no_reads()
     self.init_susp()
     self.o.lock = const(1.75)
     self.assertIs(locking.charge_dpcp_overheads(self.o, self.ts), self.ts)
     self.assertEqual(self.ts[0].resmodel[0].max_write_length, 11 + 2)
开发者ID:ChenZewei,项目名称:schedcat,代码行数:6,代码来源:overheads.py


示例19: test_dpcp_infeasible

 def test_dpcp_infeasible(self):
     self.no_reads()
     self.init_susp()
     self.o.syscall_in = const(10000000)
     self.assertIs(locking.charge_dpcp_overheads(self.o, self.ts), False)
开发者ID:ChenZewei,项目名称:schedcat,代码行数:5,代码来源:overheads.py


示例20: test_sem_integral

 def test_sem_integral(self):
     self.no_reads()
     self.o.unlock = const(1.75)
     self.assertIs(locking.charge_semaphore_overheads(self.o, True, False, self.ts), self.ts)
     self.assertEqual(self.ts[0].resmodel[0].max_write_length, 11 + 2)
开发者ID:ChenZewei,项目名称:schedcat,代码行数:5,代码来源:overheads.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python schedule.every函数代码示例发布时间:2022-05-27
下一篇:
Python sched.scheduler函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap