Starting from:

$30

NWEN303 Project 1

 NWEN303 Project 1  [Total Marks: 100]
In this Project you are required to use parallelism in order to improve the efficiency of a given
Particle simulator written in Java.
This project will require you to both write code and explain concepts that relate to concurrent
programming.
You are expected to:
- Write your solutions to the coded questions within the java classes specified (by making
your own classes when instructed to).
- Write your answers (with a good amount of detail) for the explanation questions in a report
format submitted as a single PDF file.
Task1 [15 Marks]
Understand the given code 1
The class “Model.java” is in charge of managing all of the logic of the particle simulator.
In your report, explain how this class works.
Give details on variables, algorithms, objects etc.
Explain the meaning of the four main actions in Model.step().
Also, explain how the particles are merged.
Explain how model work, what steps are performed and how merging of particle works.
BONUS MARKS: [5 Marks]
The logic of the particle simulator may contain some bugs. If you spot them:
- identify them using a comment near the corresponding code
- explain (in a paragraph) in the Report why the code is wrong/buggy
- State in the Report an appropriate correction that should be made.
Do not lose too much time searching for bugs!!
Task2 [15 Marks]
Understand the given code 2
Gui.java already has a minimal form of parallelism.
Show, in your report, that you understand how it works (what does it do and how does it do it),
and explain what data is contended and what the contention pattern is; out of the four contentions
patterns seen in the lecture. Is this parallelism properly implemented? Justify your answers.
Note for task 3 – 6: Create files
For the following task please create a new file and name it “ModelParallel.java”
This class “(ModelParallel”) should behave exactly the same as Model.java, but should use
multiple cores for better performance.
Feel free to either modify the Gui class or to create a new Gui class in order to be able to work with
either Model or ModelParallel.
Task3 [10 Marks]
Discuss how to introduce parallelism
In your report explain:
(a) How you plan to add parallelism in the algorithm.
(b) Why is it going to help in simulating particle moving, attracting each other and merging?
(c) What kind of data contentions you will need to resolve?
(d) How are you sure that there is no hidden aliasing creating unpredicted data contentions?
Task4 [30 Marks]
Implement ModelParallel
Here you need to implement the parallel version of the model. You can use any technique that we
have seen in the class or that you discover in any other way.
However, all the code must be in Java and run in a single JVM process.
Note: This is the bulk of the project, and while it’s worth only 30 marks individually, is a
fundamental building block for the next two parts
Write four or five sentences explaining your design decisions for task 4.
Task5 [15 Marks]
Test ModelParallel Correctness
You need to ensure that ModelParallel behaves exactly as Model in all the situations.
You are free to use any kind of tool that you can find/access to improve the quality of your work.
State the use of the tools in the report and it will be positively considered.
To show this: create and write the appropriate test files in your project and In your report: Explain
your testing techniques and justify why the testing results gave you a good level of confidence that
your work is correct.
Please, use a sentence like “In order to ensure that ModelParallel behaves exactly as Model in all
the situations I designed the following automated testing strategy:... This gave me a high level of
confidence because ...”
Task6 [15 Marks]
Test ModelParallel Efficiency
You need to show that, at least in some important cases, ModelParallel runs faster than Model.
You are free to use any kind of tool that you can find/access to improve the quality of your work.
State the use of the tools in the report and it will be positively considered.
To show this: create and write the appropriate test files in your project and In your report: Explain
your testing techniques and justify why your testing give you a good level of confidence that your
work is efficient.
Please, use a sentence like “In order to check that ModelParallel is more efficient than Model I
designed the following automated testing strategy:... This gave me a high level of confidence
because ...”
TO SUBMIT: Your submission should include:
1. A jar file with all your code
2. Your report (in pdf format (more preferred) or txt format(less preferred))
3. A txt file stating any bugs in your code and how to run your code (ie a readme file) 

More products