hw4 - 1 add the letters of your last name up using a = 1 b...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 4 This assignment is similar to Homework 3 that used OpenMP. Write and run a Java or Pthreads program to compute the following recurrence: for (int i = 0; i<n; i++) { t = t + a[i]; } print(t); The program should solve the recurrence in parallel. Time the program using arrays of size 10000, 100000 and 1000000. Do several timings. Turn in program listings, output, and times for the six runs. Note: because there are a limited number of machines (qstruct01 - qustruct04 and algol01 - algol20) I suggest you pick a machine to use by hashing your surname (last name, or family name). Pick any reasonable hash function, or use the following:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. add the letters of your last name up, using a = 1, b = 2, . .., z = 26. 2. H = (above sum) % 21 for the algol machine name, H = (above sum) % 5 for the qstruct machine name. 3. If possible, test and run your program on another machine you have access to, then a. login to the machine determined above. b. do a “who” command to see if anyone else is logged into that machine c. if not, run your program, if there is, wait a few minutes and/or pick another machine and check it. 4. At some point in the not-to-distant future I will assign machine to students, and you will be spared at least some of this foolishness....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online