Quiz

  1. Suppose that you wish to create datatypes to access the selected (darker) elements of the two-dimensional arrays shown in the following figures:

    For figure (a), which derived datatype call would be best?

    MPI_TYPE_CONTIGUOUS
    MPI_TYPE_VECTOR
    MPI_TYPE_INDEXED
    MPI_TYPE_STRUCT

  2. For figure (b), which derived datatype call would be best?

    MPI_TYPE_CONTIGUOUS
    MPI_TYPE_VECTOR
    MPI_TYPE_INDEXED
    MPI_TYPE_STRUCT

  3. For figure (c), which derived datatype call would be best?

    MPI_TYPE_CONTIGUOUS
    MPI_TYPE_VECTOR
    MPI_TYPE_INDEXED
    MPI_TYPE_STRUCT

  4. Assuming that you have already created and committed a derived datatype to access the selected (darker) elements of the two-dimensional array shown in figure (b):

    If the array is named "buf", how should the message buffer be specified in the send call?

    Fortran: call MPI_SEND (buf(1,1), ...) --- C: MPI_Send (buf, ...);
    Fortran: call MPI_SEND (buf(2,1), ...) --- C: MPI_Send (&buf[1][0], ...);

  5. Check all that apply: if sends and receives use the datatypes listed below, which combinations will generate an error when the program runs?

    Assume that:
    vectype1 was created with
    count_dd=10, blocklength=5, stride=10, oldtype=MPI_INT or MPI_INTEGER
    vectype2 was created with
    count_dd=10, blocklength=5, stride=20, oldtype=MPI_INT or MPI_INTEGER
    vectype3 was created with
    count_dd=10, blocklength=6, stride=10, oldtype=MPI_INT or MPI_INTEGER

    receive: datatype=vectype1, count_msg=1

    send: datatype=vectype2, count_msg=1

    receive: datatype=vectype1, count_msg=1

    send: datatype=vectype3, count_msg=1

    receive: datatype=vectype3, count_msg=1

    send: datatype=vectype1, count_msg=1

    receive: datatype=vectype1, count_msg=1
    send: datatype=MPI_INT or MPI_INTEGER, count_msg=50


If you would like an explanation of the correct answers to show up along with your score, select Yes in the box below:
Show Answers:


Name (required for Virtual Workshop Certificate):