UniExeterRSE / PIP-fork

Partially Ionised Plasma Code
GNU General Public License v3.0
0 stars 0 forks source link

Testing non-uniform grid split #10

Open mtwest2718 opened 2 years ago

mtwest2718 commented 2 years ago

When splitting the grid, does the code take account of the excess grid points if the range cannot be split evenly amongst the mpi processes?

mtwest2718 commented 2 years ago

From what I have found

  1. The code runs, say if you have 1000 grid points and mpi_siz(1) = 3
  2. The number of points in each block is 333 + 2*magin(1)
  3. The relevant code is lines 26-28 in MPI_rot.f90
  4. This is integer math, so any remainder is forgotten.

So yeah, this is a bug.

I believe I have a way to fix this by adding the excess grid points to the "farthest rightward" block in each direction