Docsity

Unsolved Quiz 2 - Parallel Algorithms | COSC 612, Quizzes of Algorithms and Programming

Toggle sidebar
bg1
COSC 612 FA09 Test #2 Name:
Open books/notes/internet.
Return test by 7:00pm, except for 9 & 10. 9 & 10 involve submitting a picture. You have
until 8am 11/11/09 to mail me the answers to 9 & 10.
Short questions
1. What is 164 (# 4 of the 16-th roots of unity) in phaser notation (r ei
) and in x,y
notation (x + i y).
phaser:
x,y:
2. Compute the inner product (40 41 42 43) * 0.25 * (40 43 42 41)T .
Comment: This computes the a33 element of the matrix obtained from F * F-1. This means
the answer is one. Show the intermediate steps!
3. What is 83 * 81?
4. MPI programming: When a set of processes need to receive data from a single
process that uses MPI_Send, those receiving processes can use either MPI_Recv or
MPI_Bcast.
TRUE FALSE
5. A collection of processes execute the statement
MPI_Bcast(a, 10, MPI_INT, 0, MPI_COMM_WORLD);
Exactly one process, process #0, will actually execute that statement. The other processes
in MPI_COMM_WORLD will skip over it.
TRUE FALSE
pf3
pf4

Partial preview of the text

Download Unsolved Quiz 2 - Parallel Algorithms | COSC 612 and more Quizzes Algorithms and Programming in PDF only on Docsity!

COSC 612 FA09 Test #2 Name: Open books/notes/internet. Return test by 7:00pm, except for 9 & 10. 9 & 10 involve submitting a picture. You have until 8am 11/11/09 to mail me the answers to 9 & 10. Short questions

  1. What is  164 (# 4 of the 16-th roots of unity) in phaser notation ( r ei^ ) and in x,y notation ( x + i y ). phaser: x,y:
  2. Compute the inner product ( 40  41  42  43 ) * 0.25 * ( 40  43  42  41 )T^. Comment: This computes the a 33 element of the matrix obtained from F * F-1. This means the answer is one. Show the intermediate steps!
  3. What is  83 *  81?
  4. MPI programming: When a set of processes need to receive data from a single process that uses MPI_Send, those receiving processes can use either MPI_Recv or MPI_Bcast. TRUE FALSE
  5. A collection of processes execute the statement MPI_Bcast(a, 10, MPI_INT, 0, MPI_COMM_WORLD); Exactly one process, process #0, will actually execute that statement. The other processes in MPI_COMM_WORLD will skip over it. TRUE FALSE
  1. Suppose there are 8 processes in MPI_COMM_WORLD. What is the maximum value of &my_rank after a call to MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
  2. What does MPI_Reduce( &x,&y, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD) do? a. Computes the sum of x and y, and send the result to process 0. b. Computes the sum of x over all processes, and send the result to process 0, where it is stored in y. c. Computes the sum of x over all processes, and stores the result in each process’s y. Longer answers
  3. Process 0, 1, 2 all have the same data: a[] = {1, 2, 3}. b[] = {10, 20, 30} x = 3; y = 5; Each process knows its own rank, pid. All processes execute the following MPI code, restarting from the initial state given above for each code fragment. Give resulting (changed) data values: a. MPI_Bcast (&x, &y, 1, MPI_INT, 0, MPI_COMM_WORLD); b. if (pid == 0) MPI_Recv( &a[0], 3, MPI_INT, 1, MPI_ANY_TAG, &status); If (pid == 1) MPI_Send( &b[0], 3, MPI_INT, 1, 0, &status);

Suppose the Fourier transform of a polynomial with coefficients, a 0 , a 1 , … an-1, F(f(x)) is given by coefficients A 0 , A 1 , … An-1. That is, F(an-1 + an-2 + … + a 1 + a 0 ) = (An-1 + An-2 + … + A 1 + A 0 ) f(x) = 2x^2 + 3x + 4, g(x) = 5x + 6.