Write a program which decomposes an integer matrix (m x n) using a 2D MPI cartesian grid:
- handle the remainders for non multiple sizes
- fill the matrix with the row-linearized indexes
Aij = m · i + j
- reconstruct the absolute indexes from the local ones
- remember that in C the indexes of arrays start from 0
The program writes the matrix to file using MPI-I/O collective write and using MPI data-types:
- which data-type do you have to use?
Check the results using:
- shell Command : od -i output.dat
- parallel MPI-I/O read functions (similar to write structure)
- serial standard C and Fortran check:
• only rank=0 performs check
• read row-by-row in C and column-by-column in Fortran and check each element of the row/columns
• use binary files and fread in C
• use unformatted and access='stream' in Fortran
Which check is the most scrupolous one?
- is the Parallel MPI-I/O check enough?