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.