回到首页

输入关键词,多个关键词用空格分隔。

← How to Write Fast Code · 系列目录

How to Write Fast Code 第 4 课 并行架构

约 1 分钟

前面我们了解了并行程序的基本概念和写法,这节课我们从更大的角度来思考,如何去设计一个并行架构。


这节课会涉及大量架构和设计模式的内容,具体可以参考我另一门课程的笔记。

假如我们要设计一个自动语音识别系统,我们需要考虑的东西至少有:

  • 算法的实现
  • 并行处理
  • 软件架构
  • 硬件架构

A parallel software pattern is genralizable solution to a class of recurring problems that occurs in the design of parallel software

主要的设计目标有三个:

  • Define a set of vocabularies to communicate
  • Present a set of expert techniques for beginners to learn
  • Allows experts to more quickly design complex systems

大的组织架构如下:

OPL: The Organization

上图中可以看到,有两种模式:结构模式与计算模式

Structual Patterns define the structure of the SW but not what is computed

Identifying the SW Structure

一些例子:

  • Pipe and Filter
  • Iterative Refinement
  • MapReduce
  • 还有很多,具体参考 CMU 18653 的笔记

Computational patterns describe the key computation but not how they are implemented.

Identifying Key Computations

一些例子:

  • Linear Algebra
  • Spectral Methods
  • Dynamic Programming
  • 还有很多,具体是偏领域相关的

最后可以用一张图总结

A Pattern Language for Parallel Programming

不同的描述模式的语言有很多,这里使用的是 OPL,具体的网址在这里

这部分知识对于理解整个架构的概念很有帮助,我会专门新开一个系列来介绍这里的内容。

相关文章