christophe petit wrote:
i am still trying to understand the parallelized version of the heat equation 2D solving that we saw at school.
I am confused between the shift of the values near to the bounds done by the "updateBound" routine  and the main loop (at line 161 in main code)  which calls the routine "Explicit".
Each process "owns" a subdomain of cells, for which it will compute updated values.  The process has storage not only for these cells, which it owns, but also for a perimeter of cells, whose values need to be fetched from nearby processes.  So, there are two steps.  In "updateBound", processes communicate so that each supplies boundary values to neighbors and gets boundary values from neighbors.  In "Explicit", the computation (stencil operation) is performed.
For a given process (say number 1) ( i use 4 here for execution), i send to the east process (3) the penultimate column left column, to the north process (0) the penultimate row top ,and to the others (mpi_proc_null=-2)
the penultimate right column and the bottom row. But how the 4  processes are synchronous ?
When UpdateBound is called, neighboring processes are implicitly synchronized via the MPI_Sendrecv() calls.
I don't understand too why all the processes go through the solving piece of code calling the "Explicit" routine.
The computational domain is distributed among all processes.  Each cell must be updated with the stencil operation.  So, each process calls that computation for the cells that it owns.

You should be able to get better interactivity at your school than on this mailing list.  Further, your questions at school would help the instructor get feedback from the students.

Reply via email to