Lab05: Matrix Multiply Part 3

Objective
  • Apply parallel techniques to matrix algebra
  • Use MPI_Type_vector to create a new datatype representing the column(s) of the matrix.
  • Send groups of columns of a matrix to different processors.

    BACKGROUND:


    1 2 3 4 5 6
    7 8 9 10 11 12
    13 14 15 16 17 18
    19 20 21 22 23 24
    25 26 27 28 29 30
    31 32 33 34 35 36

  • We'd like to be able to send groups of consecutive columns to each processor
  • For example, with 3 processors (0, 1, and 2) we can send processors 1 and 2
    each three consecutive columns:

    Process 0 creates the matrix,
    Process 1 receives:
    1 2 3
    7 8 9
    13 14 15
    19 20 21
    25 26 27
    31 32 33

    Process 2 receives:
    4 5 6
    10 11 12
    16 17 18
    22 23 24
    28 29 30
    34 35 36

  • With 4 processors (0, 1, 2, and 3) each processor other than 0 would receive
    2 consecutive columns

    Assignment for Part 2

    1. Create a matrix of size maxn, for example maxn = 6 or 12 (from Part 1).
    2. Send various groups of consecutive columns to a different processors
      for example, demonstrate sending groups of 2, 3 or 4 consecutive columns.
    3. Print columns received within each processor
      IDENTIFY THE PROCESS THAT IS PRINTING THE COLUMN

    Help

  • Argo Beowulf Cluster: MPI Commands and Examples, click the link to MPI_Type_vector and read the example program
  • Also use: MPI_Type_commit and MPI_Type_free
  • Read section 5.7 in the Introduction to MPI course at WebCT-HPC