Parallel and Distributed Computing
引入本课内容
| English | 释义 | 拼音 |
|---|---|---|
| sequential computing/siːˈkwenʃl kəmˈpjuːtɪŋ/ | 顺序计算 | shùn xù jì suàn |
| Parallel computing/ˈpærəlel kəmˈpjuːtɪŋ/ | 并行计算 | bìng xíng jì suàn |
| processors/ˈprəʊsesəz/ | 处理器 | chǔ lǐ qì |
| Distributed computing/ˈdɪstrɪbjuːtɪd kəmˈpjuːtɪŋ/ | 分布式计算 | fēn bù shì jì suàn |
| speedup/ˈspiːdʌp/ | 加速比 | jiā sù bǐ |
一次一步
- 传统上计算机一次运行一步。
- 这是顺序计算(sequential computing):每一步必须完成才能开始下一步。
- 它简单,但对大任务可能慢。
- 要更快,我们可以一次做几步。
In sequential computing:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
One step at a time, in order.
并行与分布式计算
- 并行计算使用多个处理器,同时运行任务的不同部分。
- 分布式计算通过网络将任务分散到许多独立的计算机上,这些计算机通常位于不同的地方。
- 并行计算 = 一台机器上的多个处理器。分布式计算 = 多台机器。
- 两者都旨在更快地完成大型任务。

并行计算:多个处理器同时工作
Sequential, parallel, or distributed?
Sequential runs one step at a time; parallel uses several processors in one machine at once; distributed spreads a task across many separate computers.
Match each term to its meaning.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Parallel uses processors at the same time; distributed spreads work across separate computers.
加速比及其极限
- 并行计算的好处用加速比(speedup)衡量:
- $\text{speedup} = \dfrac{\text{time using one processor}}{\text{time using several processors}}$.
- 但任何必须顺序运行的部分都不能通过添加处理器加速。
- 所以顺序的部分设定一个下限——总加速比的一个硬上限。
A task takes 100 s on one processor and 40 s on several. What is the speedup?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
speedup = 100 / 40 = 2.5×.
If 20 s of a 100 s task must run sequentially, what is the maximum possible speedup?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Even with infinite processors, 20 s remains: 100 / 20 = 5×.
Why can adding more processors never remove the speedup cap?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
The sequential portion sets a floor on the total time.
Distributed computing is only useful for small jobs that fit on one machine.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
False. Distributed computing suits huge jobs too big for one machine, such as indexing the web, by splitting the work across many computers.
分布式计算何时大显身手
- 分布式方案在处理巨大的任务时大显身手,例如处理庞大的数据集,或由搜索引擎为整个互联网建立索引。
- 这些工作对一台机器来说太大,可以自然地分配到成千上万台机器上。
有上限的加速比。 一个 100 秒的任务中,并行部分需要 80 秒,顺序部分需要 20 秒。使用 4 个处理器时,并行部分需要 $80 / 4 = 20$ 秒,加上顺序部分的 20 秒,共 40 秒。加速比为 $= 100 / 40 = 2.5\times$。即使使用一百万个处理器,顺序部分仍需要 20 秒,所以加速比永远不能超过 $100 / 20 = 5$。
顺序计算一次运行一步。并行计算同时使用多个处理器;分布式计算把工作分散到多台机器上。并行计算的收益用加速比衡量(单处理器时间 ÷ 多处理器时间),但顺序部分为加速比设定了上限(这里是 5 倍)。
出了什么问题?只有网站团队能看到这些信息。