CSE762 Homework # 2

Due Date : Oct 19th

We have k vectors (V_{1}, V_{2}, V_{3}, ⋯ V_{k}) each with n components (x_{1}, x_{2}, x_{3}, ⋯ x_{n}) and you are to develop a distributed program using p4 to add the vectors and return a summation vector with n components

Example: Assume you have 8 vectors (V_{1}, V_{2}, V_{3}, V_{4}, V_{5}, V_{6}, V_{7}, V_{8}) and run the algorithm on 4 computers. (C_{1}, C_{2}, C_{3}, C_{4}) where the summation of

• (V_{1}&V_{2}) would be computed on C1

• (V_{3}&V_{4}) would be computed on C2

• (V_{5}&V_{6}) would be computed on C3

• (V_{7}&V_{8}) would be computed on C4 and the result of the summations would be summed up again until only one vector remains. Note : Your application should be able to handle vectors of variable size (n) and number (k) and should read the data for the vectors from a text data file and display the results on the screen.

• The number of vectors (k) should be multiple of the number of compute (nproc).

• k should be no less than 64.

• Try nproc = 1, 2, and 4.

• Choose the vector size (n) between 10 and 20.

Submit the all files ( README, *.c, procgroup, makefile ) by e-mail and hardcopy.

To send, • tar cvf hw2-username.tar *.c readme makefile procgroup • uuencode hw2-username.tar hw2-username.tar ¿ aa

• mail -s ”hw#2” kimd@top.cis.syr.edu ¡ aa