如何在“生命游戏”的进程之间划分二维数组

发布于 2024-08-12 18:40:24 字数 68 浏览 3 评论 0原文

我正在做一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦太阳 2024-08-19 18:40:24

分区类型之间的优缺点是什么?我试图找到对分区的引用(这似乎与并行处理相关),但如果不深入思考,很难找到这样的引用。 :)

尝试最适合您需要的一个,因为这是一项作业,您应该先尝试最简单的一个,然后在时间允许的情况下完成其他任务。

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.

近箐 2024-08-19 18:40:24

无论您如何操作,都不要忘记使每侧的分区更大并有一些重叠。

这意味着复制一些数据,但也意味着每个分区可以独立计算。在每个刻度结束时,您的分区可以将其重叠复制到其邻居。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文