Assessment COM337/2004

advertisement
COM337 Parallel Programming
Course Work Assignment –
Comparative Study on Sequential and
Parallel Solutions
Introduction
The objective of this assignment is to assess your ability to write a multi-threaded solution to a
well-established parallel computing conundrum using the Java programming language. You
will build upon the work undertaken in the taught tutorial classes. This assignment is worth
50% of the total module mark (the other 50% is awarded by way of a TCT held at the end of
the module), and you must achieve at least 35% in this piece of work (out of an average of
40% for all module work put together). You must hand in all the necessary source code in
electronic and printed form, the report and a completed front cover sheet.
Problem Statement
Assume that you have to write a computer program that will receive as input a large array A of
unsorted integers and a target number X. The program will have to output three counters N1,
N2 and N3 showing the number of integers from array A which are less than X (for N1), equal
to X (for N2) and greater than X (for N3). You have to be prepared to write a program for a
single CPU computer and for a multi-CPU parallel computer platform.
Your Tasks
In this assignment you are required to write two programs: a sequential Java program and a
concurrent Java program that will produce the result from the above task. The sequential and
parallel programmes should be able to run on a single CPU and multi-CPU parallel computer
platforms respectively.
In addition, you are required to produce a report on the approach you adopted for your Java
solution. In particular, this will consist of a critical evaluation of your solution, highlighting the
salient features of your program that involve concurrency and the advantages and
disadvantages of the programming constructs employed.
In addition, your report has to address the following points:
 Discuss your approach within the context of FLYNN’S TAXONOMY;
 Discuss the advantages (disadvantages) of both sequential and concurrent solutions;
 For both solutions, compare the number of operations per CPU, which are directly
involved in the comparison task, i.e. the number of comparison operations ( “x < y”, “x ==
y” and “x > y” );
 Describe how your solution addresses the problems of synchronization and
communication in concurrent programs.
For the testing purposes in this assignment, you can assume that each of the input array
contains 16 randomly generated integer numbers. You can also assume that you have 6
CPUs available for this task on the parallel machine. However, your program should be able
to run on computer platforms with different numbers of CPUs and different size of the input
arrays.
Ensure that you use examples from your solution within this report and provide some form of
visual feedback showing that the programs perform the required tasks correctly. As a guide,
the report should not exceed 1000 words.
Marking Scheme
Working sequential program
Working parallel program
Relevant tests showing required behaviour
Report on your approach
Report on application of concurrency in your solution
Report on applied construct advantages and disadvantages
15 Marks
45 Marks
5 Marks
15 Marks
10 Marks
10 Marks
-------------100 Marks
Download