Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 729 Bytes

README.md

File metadata and controls

18 lines (11 loc) · 729 Bytes

Modifying extent

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.

  1. Verify that the datatype works by communicating a single column/row.

  2. Try to send multiple columns / rows. What happens? Can you explain why?

  3. Create a new datatype with resized extent, so that communicating multiple columns / rows succeeds.

  4. Generalize the code to multiple processes and scatter columns / rows with MPI_Scatter collective. Define a new array for the receive buffer and print it out on all ranks.