0

A C/MPI program that is executed using two processes. Process 0 hold a 4 × 4 array A that contains the floating-point values shown below.

1.0  2.0   3.0    4.0   
5.0  6.0   7.0    8.0     A[4][4]
9.0  10.0  11.0  12.0   
13.0 14.0  15.0  16.0   

What is the ordered sequence of the values of the array A that are sent by process 0 to 1 in the following two fragments of code?

MPI_Type_contiguous( 8, MPI_FLOAT, &atype );
    MPI_Type_commit( &atype );
    if ( rank == 0 ) { 
    MPI_Send( a, 1, atype, 1, TAG, MPI_COMM_WORLD );
    }



MPI_Type_vector( 4, 2, 2, MPI_FLOAT, &atype );
   MPI_Type_commit( &atype );
    if ( rank == 0 ) { 
    MPI_Send( a, 1, atype, 1, TAG, MPI_COMM_WORLD );
    }

Any help on this would be great

2
Contributors
1
Reply
13
Views
1 Year
Discussion Span
Last Post by Nutster
0

How are these functions being called? Where and how are rank and atype defined? I need more context to answer this question.

Edited by Nutster

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.