When the datatype contains gaps in the beginning or in the end, one might need to modify the extent of the datatype.
Starting from skeleton.c or skeleton.F90, create a vector datatype for sending a column (C) or row (Fortran) of a matrix.
-
Verify that the datatype works by communicating a single column/row.
-
Try to send multiple columns / rows. What happens? Can you explain why?
-
Create a new datatype with resized extent, so that communicating multiple columns / rows succeeds.
-
Try to scatter columns / rows with
MPI_Scatter