From: W. Trevor King Date: Tue, 26 Oct 2010 15:01:40 +0000 (-0400) Subject: Update tree_broadcast assigment for fall 2010. X-Git-Url: http://git.tremily.us/?p=parallel_computing.git;a=commitdiff_plain;h=10dedd64b6b1969d1947c31fb44811285f4bf25c Update tree_broadcast assigment for fall 2010. --- diff --git a/assignments/archive/tree_broadcast/index.shtml b/assignments/archive/tree_broadcast/index.shtml index ea57181..fffbac5 100644 --- a/assignments/archive/tree_broadcast/index.shtml +++ b/assignments/archive/tree_broadcast/index.shtml @@ -1,7 +1,7 @@

Assignment #4

-

Due Friday, October 23, 2009

+

Due Friday, October 29, 2010

Purpose

@@ -10,12 +10,13 @@

Note: Please identify all your work.

This assignment consists in building your own broadcast code based -on a binary tree. The code +on a binary tree. The code print_tree.c -provides a simple implementation of a binary tree based on node zero -as being the root. It generates the node numbers from which any node -is to receive the information and to which to send this -information.

+(see Global +Operations) provides a simple implementation of a binary tree +based on node zero as being the root. It generates the node numbers +from which any node is to receive the information and to which to send +this information.

Part A

@@ -24,8 +25,8 @@ similar as the one provided by MPICH2. It should follow the same syntax as MPI_Bcast(), namely

-int My Bcast(void *buffer, int count, MPI Datatype datatype, int root,
-             MPI Comm comm)
+int My_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
+             MPI_Comm comm)
 

This function should be based on the skeleton @@ -34,7 +35,8 @@ is process zero (0). If not, it should print out an error message quoting this fact and return an exit code one (1).

Test your routine carefully for various process numbers and -different count and datatype in the call.

+different count and datatype in the +call.

Part B

@@ -49,13 +51,14 @@ to broadcast the information three (3) different ways:

Broadcast 10,000 integers 100 times and take an average over the 100 broadcasts to smooth out the time fluctuations. Repeat for 10,000 -double. Tabulate your timings and comment on the results.

+double. Tabulate your timings and comment on the +results.

Part C

Modify My_Bcast() to be able to broadcast from any process (the root process) within the virtual machine. Check your code -carefully for different root processes and various number of -processes.

+carefully for different root processes and various numbers +of processes.

diff --git a/assignments/archive/tree_broadcast/index.shtml.2009.10.shtml b/assignments/archive/tree_broadcast/index.shtml.2009.10.shtml new file mode 100644 index 0000000..14269bc --- /dev/null +++ b/assignments/archive/tree_broadcast/index.shtml.2009.10.shtml @@ -0,0 +1,61 @@ + + +

Assignment #4

+

Due Friday, October 23, 2009

+ +

Purpose

+ +

Learn how to implement a truly parallel algorithm.

+ +

Note: Please identify all your work.

+ +

This assignment consists in building your own broadcast code based +on a binary tree. The code +print_tree.c +provides a simple implementation of a binary tree based on node zero +as being the root. It generates the node numbers from which any node +is to receive the information and to which to send this +information.

+ +

Part A

+ +

Write a function My_Bcast() that performs a broadcast +similar as the one provided by MPICH2. It should follow the same +syntax as MPI_Bcast(), namely

+ +
+int My_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
+             MPI_Comm comm)
+
+ +

This function should be based on the skeleton +code print_tree.c. It should therefore assume that root +is process zero (0). If not, it should print out an error message +quoting this fact and return an exit code one (1).

+ +

Test your routine carefully for various process numbers and +different count and datatype in the call.

+ +

Part B

+ +

Instrument your code for timing measurements. Modify your main code +to broadcast the information three (3) different ways:

+ +
    +
  1. sequentially via a for loop,
  2. +
  3. via your My_Bcast(), and
  4. +
  5. via the MPICH2 MPI_Bcast().
  6. +
+ +

Broadcast 10,000 integers 100 times and take an average over the +100 broadcasts to smooth out the time fluctuations. Repeat for 10,000 +double. Tabulate your timings and comment on the results.

+ +

Part C

+ +

Modify My_Bcast() to be able to broadcast from any +process (the root process) within the virtual machine. Check your code +carefully for different root processes and various number of +processes.

+ +