我正在研究并行编程,并且正在研究 mapreduce 和其他分布式算法。最好只学习 mapreduce 还是有更通用的算法可以更好地为我服务?
最佳答案
这取决于您打算将算法用于什么目的。
MapReduce是一个通用且非常有用的编程模型。 (谷歌的许多内部索引过程都基于它)。学习它肯定不会对您造成任何伤害。
MapReduce is a programming model and an associated implementation for processing and generating large data sets. Users specify a map function that processes a key/value pair to generate a set of intermediate key/value pairs, and a reduce function that merges all intermediate values associated with the same intermediate key. Many real world tasks are expressible in this model, as shown in the paper.
要学习的最重要的并行处理概念非常简单:如果要获得有效的加速,则需要尽量减少同步。
争取:
- 大粒度的工作 block
- 保持大小工作 block 的大小相似
- 尽量减少同步步骤的数量
关于algorithm - MapReduce 只是另一种编程原则的概括吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2407493/