Amdahl‘s Law+ Gustafson-Barsis‘s Law

Amdahl’s Law

If 95% of the program can be parallelized, the theoretical maximum
speedup using parallel computing would be 20×, no matter how
many processors are used, i.e. if the non-parallelisable part takes 1
hour, then no matter how many cores you throw at it, it won’t
complete in <1 hour.

Consider a program that executes a single loop, where all
iterations can be computed independently, i.e., code can be
parallelized. By splitting the loop into several parts, e.g., one loop
iteration per processor, each processor now has to deal with loop
overheads such as calculation of bounds, test for loop completion
etc. This overhead is replicated as many times as there are
processors. In effect, loop overhead acts as a further (serial)
overhead in running the code. Also getting data to/from many
processor overheads?
In a nutshell Amdahl’s Law greatly simplifies the real world!
It also assumes a fixed problem size – sometimes can’t predict
length of time required for jobs,
– e.g., state space exploration or differential equations that don’t solve…
在这里插入图片描述

举例:

在这里插入图片描述

Gustafson-Barsis’s Law

阿姆达尔定用于计算算法并行化后可获得的最大预期改进:

Speedup = 1 / ( (1-p) + p/N )

其中 p 是代码的并行运行时间, N 是计算机核数;但此定律没有考虑到并行执行时的锁竞争、线程管理等消耗,最重要的是此定律没有考虑在计算机核数增加时,是否处理的数据也会更多,而只计算了固定核数固定任务的加速比。

古斯塔夫森定律相比于阿姆达尔定律,认为在计算机核数增加后所处理的任务就会更多,求解规模变大后串行代码运行时间是否会增加?

Speedup = p - a * ( p - 1 )

其中 p 是计算机核数, a 是串行代码执行时间所占百分比。

Speed up S using N processes is given as a linear formula dependent
on the number of processes and the fraction of time to run sequential
parts. Gustafson’s Law proposes that programmers tend to set the
size of problems to use the available equipment to solve problems
within a practical fixed time. Faster (more parallel) equipment
available, larger problems can be solved in the same time.
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值