如何在“生命游戏”的进程之间划分二维数组
我正在做一个使用 MPI 来实现 Game of Life 的作业。我想知道是否应该使用块行分区、循环行分区或块棋盘分区?
I am doing an assignment using MPI to implement Game of Life. I was wondering if I should use a block-row partitioning, a cyclic row partitioning or a block-checkerboard partitioning?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
分区类型之间的优缺点是什么?我试图找到对分区的引用(这似乎与并行处理相关),但如果不深入思考,很难找到这样的引用。 :)
尝试最适合您需要的一个,因为这是一项作业,您应该先尝试最简单的一个,然后在时间允许的情况下完成其他任务。
What are the pros and cons between the types of partitioning? I tried to find references to the partitionings (which seems to tie in with parallell processing) but it was difficult to find such without going way over my head into it. :)
Try the one that fits your needs the most, since it is an assignment you should try the simplest one first and do the others when time allows.
无论您如何操作,都不要忘记使每侧的分区更大并有一些重叠。
这意味着复制一些数据,但也意味着每个分区可以独立计算。在每个刻度结束时,您的分区可以将其重叠复制到其邻居。
However you do it, don't forget to make your partitions bigger on each side with some overlap.
This will mean duplicating some data, but it also means each partition can compute independently. At the end of each tick your partitions can copy their overlap to their neighbors.