The invention discloses a grid parallel preprocessing method based on MPI. The grid parallel preprocessing method based on the MPI comprises the following steps: giving a partition number of grids in a computation area; starting MPI
multiprocessing, setting a process number; judging whether the process number is equal to the partition number; opening grid files if the process number is equal to the partition number, reading
grid cell information files by a main process, initially and averagely assigning the grid cells to each process, creating an adjacent array of each process; otherwise, restarting the MPI
multiprocessing; invoking ParMETIS by each process to divide the grids; reading the
grid cell information by blocks into the array through each process, setting an index position of the array; looping through the
grid cell information files by each process, judging whether the difference of subtracting the index
position number of the array from the array length is less than the length of the grid
cell information; if the answer is yes, reading data of the grid
cell information files and filling the array with the data; otherwise, assigning array elements to the grid cells; judging whether the partition number of the grid
cell is equal to the process number; if the answer is yes, storing the grid cell information into a process file; otherwise, keeping judging circularly.