Вы находитесь на странице: 1из 3

1.

Sorting 32-bit floating point values



(a) Given an array of 32-bit floating-point values,
write a parallel program (using OpenMP) to sort
them in ascending order. The sort does not need
to be in-place (i.e., you can use additional storage
for the output). The sort need not be stable. You
may use any parallel sorting algorithm.

(15 points: 7 for correctness, 8 for
scalability/speedup/performance w.r.t. serial code)

(b) Discuss the parallelization strategy in the report.
What assumptions did you make about the input array?
Are there any drawbacks to your parallelization
approach?
(10 points)

(c) Report performance as you vary thread
concurrency, problem size (array size), and input array
characteristics (e.g., in addition to uniform random
floats, consider input sequences that are already sorted,
almost sorted, sorted in reverse, with high percentage
of repeats).
(10 points)


2. Finding unique strings

(a) You are given a text file as input, with a string in


each line of the file. You cannot make
assumptions on the lengths of the strings, or the
size of the file. Your goal is to write a parallel
program to determine the number of unique
strings in the file, and the number of times each
unique string appears in the file. You may use a
set representation for this purpose, or
alternately, sort all strings in some ordering, and
count the unique strings. All steps of the
approach need to be parallelized, no matter
which scheme (set representation or sorting)
you use.

(15 points: 7 for correctness, 8 for
scalability/speedup/performance w.r.t serial code)

(b) Discuss the parallelization strategy in the report.
What assumptions did you make about the input string
sequences? Are there any drawbacks to your
parallelization approach?
(10 points)

(c) Report performance as you vary thread
concurrency, problem size (I will provide a few
representative text files), and input text file
characteristics (e.g., consider text files with strings that
are already ordered, strings that are almost sorted, files
with all unique strings, files with a high percentage of
duplicates, etc.).

(10 points)

Вам также может понравиться