问题描述
我正在使用MPI解决PDE.为此,我将2D域分解为不同的单元格(每个单元格的大小分别为xcell,ycell
和xcell = size_x_domain/(number of X subdomains)
和ycell = size_y_domain/(number of Y subdomains)
.
因此,我正在使用number of processes = (number of X subdomains)*(number of Y subdomains)
相对于顺序版本而言,收益是我在代表子域的每个进程之间进行通信.
下图显示了我的分解过程,其中包括8个进程(X包含2个子域,Y包含4个子域):
(xs,xe
)代表单元格的x_start
和x_end
,(ys,ye
)代表单元格的y_start
和y_end
我想知道是否必须将 i索引设置为行索引并将 j设置为列索引吗?
将第一个索引放置在行中,将第二个索引放置在列中是一般规则吗? (例如,使用C,Fortran和Matlab语言或更多语言)
感谢您的帮助.
我不确定,但也许尝试对所有4种通信使用不同的标志.
I am using MPI for solving PDE. For this, I breakdown the 2D domain into different cells (size of each of these cells is "xcell,ycell
" with xcell = size_x_domain/(number of X subdomains)
and ycell = size_y_domain/(number of Y subdomains)
.
So, I am running the code with number of processes = (number of X subdomains)*(number of Y subdomains)
The gain relatively to sequential version is that I communicate between each process representing the sub-domains.
Here a figure illustrating my breakdown with 8 processes (2 subdomains for X and 4 for Y) :
(xs,xe
) represent x_start
and x_end
of the cell,(ys,ye
) represent y_start
and y_end
of the cell
I would like to know if I have to set, into x(i,j)
array, i the index as row index and j as column index ?
Is it a general rule to put the first index for row and the second one for column ? ( for example, in C, Fortran and Matlab language or maybe more)
Thanks for your help.
I'm not sure, but maybe try having a different flag for all 4 of the communications.
这篇关于MPI约定用于行和列的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!