1. For each of the following code segments, use OpenMP pragmas to make the loop parallel, or
explain why the code segment is not suitable for parallel execution.
a. for (i = 0; i < (int) sqrt(x); i++) {
a[i] = i + 12;
if (i < 10) b[i] = a[i];
}
b. flag = 0;
for (i = 0; (i < n) \& (!flag); i++) {
a[i] = 2.8 * i;
if (a[i] < b[i]) flag = 1;
}
c. for (i = 0; i < n; i++) {
a[i] = fun(i);
}
d. for (i = 0; i < n; i++) {
a[i] = fun(i);
if (a[i] < b[i]) b[i] = a[i];
}
e. for (i = 0; i < n; i++) {
a[i] = fun(i);
if (a[i] < b[i]) break;
}
f. product = 0;
for (i = 0; i < n; i++) {
product += a[i] * b[i];
}
g. for (i = j; i < 3 * j; i++) {
a[i] = a[i] + a[i-j];
}
h. for (i = j; i < n; i++) {
a[i] = c * a[i-j];
}
2. Suppose a parallel program completes execution on 32 processors in 348 seconds, and it has
been found that this program spends 21 seconds in initialization and cleanup on one processor, and for
the remaining time all 32 processors are active. What is the scaled speedup of this parallel program?
3. Suppose a parallel program executing on 20 processors spends 98% of its time inside parallel
code. What is the scaled speedup of this parallel program?
4. The table below shows the speedups observed for six different parallel programs A, B, C, D,
E, F as the number of processors is increased from 1 through 8.
Processors
Speedup
A
B
C
D
E
F
1
1.00
1.00
1.00
1.00
1.00
1.00
2
1.60
1.92
1.92
1.96
1.74
1.94
3
2.00
2.73
2.78
2.88
2.30
2.82
4
2.29
3.39
3.57
3.67
2.74
3.65
5
2.50
3.91
4.31
4.46
3.09
4.42
6
2.67
4.29
5.00
5.22
3.38
5.15
7
2.80
4.55
5.65
5.93
3.62
5.84
8
2.91
4.71
6.25
6.25
3.81
6.50
Using the Karp-Flatt metric as the basis, choose the statement that best describes the expected speedup
for each program with 16 processors.
I. The speedup achieved on 16 processors will probably be at least 40% higher than the speedup
achieved on eight processors.
II. The speedup achieved on 16 processors will probably be less than 40% higher than the speedup
achieved on eight processors, due to the increase in overhead as processors are added.
III. The speedup achieved on 16 processors will probably be less than 40% higher than the speedup
achieved on eight processors, due to the large serial component of the computation.
5. Let n ≥ f(p) denote the isoefficiency relation of a parallel system and let M(n) denote the
amount of memory required to store a problem of size n. Use the scalability function to rank the
parallel systems shown below from the most scalable to the least scalable:
a. f(p) = Cp, M(n) = n2.
b. f(p) = C√p, M(n) = n2.
c. f(p) = C√plog p, M(n) = n2.
d. f(p) = Cplog p, M(n) = n2.
e. f(p) = Cp, M(n) = n.
f. f(p) = Cp√p, M(n) = n.
g. f(p) = Cp2√p, M(n) = n.
6. Suppose a problem of size 100,000 can be solved in 15 hours on a computer today. Assuming
that the execution time is solely determined by the CPU speed, determine how large a problem can be
solved in 15 hours time by a computer that is 100 times as fast as today’s computer, if the algorithm
used to solve the problem has a time complexity given by (for a problem size of n):
a. Θ(n2)
b. Θ(nlog2n)
c. Θ(n3)
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.