Question about boundary conditions in the diffusion code

Question about boundary conditions in the diffusion code

by Clint Seinen -
Number of replies: 1

Hey Bruno

In the 'diffusion2dc-mpi-nonblocking.c' code, I see that for all ranks you populate all surrounding boundary points with the fixed temperature distribution - even on the sides that would be on the interior edges of the domain decomposition. Is this done because the communication calls below will overwrite the appropriate arrays on the correct sides? i.e. if its an interior edge, the fixed values will be overwritten with the current value of the neighbour, while for exterior edges, the Isend and Irecv calls will attempt to communicate with MPI_PROC_NULL and not overwrite the fixed distribution?

Thanks,

Clint


In reply to Clint Seinen

Re: Question about boundary conditions in the diffusion code

by Bruno Mundim -
Exactly! If you don't to that, you would have to introduce conditional statements to deal with the communication at the edge of the domain where MPI_PROC_NULL is returned. As an exercise in debugging you could try to remove those statements and see how it fails by reducing the size of the domain to small matrices and one time step only.