version 0.6.0
Loading...
Searching...
No Matches
How to exchange data between processors

The following guidelines will help you to exchange date between processors.

The local grid (associated to a given processor) overlaps the neighbor local grids (associated to other processors). Equations are solved on the non-overlappping zone, and solutions are exchanged explicitly after the resolution such a way that the solution are known everywhere on the each local grid (velocity, temperature, pressure, density, viscosity, etc.).

Most of the time, cell (or face) operations on arrays can be done one the whole local grid without any need to exchange the array between processors (because all the fields involved are well known on the ovelapping zone):

do k=1,nz
   do j=1,ny
      do i=1,nx
         array(i,j,k)=...
      enddo
   enddo
enddo

Some operations - for instance if the computation of a gradient is required - may not be well computed on the overlapping zone - since the gradient needs values defined on the neighbor processors. In this case, explicit exchange between processors are requested. The mpi_exchange can be used. For instance:

use mpi_exchange

do k=ks,ke
   do j=js,je
      do i=is,ie
         array(i,j,k)=...
      enddo
   enddo
enddo
call mpi_exchange(array)

mpi_exchange can also be used for any face fields (like velocity).