Skip to content
Snippets Groups Projects
Commit ab66905e authored by David Goz's avatar David Goz :sleeping:
Browse files

/mpi/comp_comm/ comments global data structure

parent 5d29c556
No related branches found
No related tags found
No related merge requests found
......@@ -19,25 +19,25 @@ MyData **global_phi;
typedef struct MyGrid
{
int local_start[NDIM];
int local_end[NDIM];
int global_start[NDIM];
int global_end[NDIM];
int dim[NDIM];
int local_start[NDIM]; /* Local start index in each dimension */
int local_end[NDIM]; /* Local end index in each dimension */
int global_start[NDIM]; /* Global start index in each dimension */
int global_end[NDIM]; /* Global end index in each dimension */
int dim[NDIM]; /* Local domain size (no ghosts) */
} myDomain;
typedef struct Task_2D_Cartesian
{
int rank;
int nranks;
int coords[NDIM];
myDomain domain;
int nbrtop;
int nbrbottom;
int nbrleft;
int nbrright;
MPI_Comm comm2d;
int rank; /* Local process rank */
int nranks; /* Communicator size */
int coords[NDIM]; /* Cartesian topology coordinate */
myDomain domain; /* MyGrid structure (defined above) */
int nbrtop; /* Top neighbor process in cartesian topology */
int nbrbottom; /* Bottom neighbor process in cartesian topology */
int nbrleft; /* Left neighbor process in cartesian topology */
int nbrright; /* Right neighbor process in cartesian topology */
MPI_Comm comm2d; /* Cartesian communicator */
} Task;
/* function prototypes */
......@@ -136,9 +136,7 @@ int main(int argc, char **argv)
/************************************************************************************************************/
/* 2D MPI-cartesian decomposition:
the grids are replicated across the MPI processes.
This approach is not the most efficient in terms of memory usage,
because the arrays are replicated across MPI process instead of to be distributed */
the grids are distributed across the MPI processes.
/* get the reminder, i.e. take into account uneven
decomposition of points among the processes */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment