Assignment 4:
Ameliorate communication latency & exploit multi-core computers
Purpose
The purpose of this programming assignment is to:
- Exploit multi-core processors when used as compute servers.
- Amerliorate communication latency.
Specification
Design Document
Create a design document that briefly describes your API, if modified from Assignment 3, and your design of the infrastructural enhancements described below. Identify essential design issues, and how your approach to them is manifested in your object-oriented design. Figures are welcome. This should be no more than 1 or 2 pages.
Ameliorate communication latency
Without sacrificing Computer fault-tolerance, enhance your infrastructure, and API, as needed, to reduce communication latency and/or overlap communication with computation.
When JavaSpaces and ComputeFarm were designed, the Space was envisioned as a shared resource among concurrent clients. Fair use of the Space among such clients precludes them from executing tasks on the Space. Since we now are in an era of cloud computing, where the [virtual] cluster is "owned" by the client, the issue of fair use of the Space does not exist. Assuming that your design retains the Space to facilitate Computer fault-tolerance, you may wish to introduce Space-runnable tasks.
If you choose to support space-runnable tasks, your design may assign responsibility for deciding to execute a task on the Space to the:
- Application statically (at compile time), dynamically (during execution of the job), or some combination of these (e.g., defaulting to compile time)
- Infrastructure dynamically
- Some combination of the above
Please present your thinking in your design document.
Beyond Space-runnable tasks, one approach to overlapping task/result communication with task computation is to enable [application-directed] Computer Task caching and Task prefetching. You however may do essentially whatever you want to improve the performance of your applications by hiding communication latency (i.e., overlapping computation with communication).
Refactor your applications, as necessary, to exploit your performance enhancing features. Such API changes, one would hope, would be minimal.
Instrument your system so that your communication latency amelioration enhancements can be turned on or off, a feature needed to perform the experiments described below.
Exploit multi-core processors when used as compute servers
JVMs increasingly exploit multiple processors by mapping different threads to different processors.
The java.lang.Runtime method
public int availableProcessors()
returns the number of processors available to the Java virtual machine.
Let T be positive integer that is some function of the number of available processors.
On each Computer, start T threads, each of which executes tasks.
Instrument your infrastructore so that this enhancement can be turned on or off.
Applications
For all applications, do not arrange to have all tasks run on the Space; this eliminates parallelism and negates the assignment goal of overlapping computation with communication.
Do the Euclidean TSP & Fibonacci number applications, with the following modifications: For your:
- Fibonacci number application, compute the 20th Fibonacci number;
- Euclidean TSP application: Use the same graph as before.
The clients
Define clients that instantiate applications as done in the previous assignment.
Experiments
The experiment specification is the same as the previous assignment, with 2 differences:
- Run with the number of computers, C = 1 and 8.
- For each value of C, run 4 experiments:
- communication latency amelioration turned off; single worker thread
- communication latency amelioration turned off; multiple worker threads
- communication latency amelioration turned on; single worker thread
- communication latency amelioration turned on; multiple worker threads
For each application, for these 8 experiments, give 4 graphs (e.g., bar graphs) of the parallel efficiency (C = 1 vs. C = 8), 1 bar graph for each of the 4 configurations above. You may superimpose the 4 graphs for a particular application.
Deliverables
The deliverables are the same as those for the previous programming assignment. Make sure that your documents index includes or links to your:
- Design document
- Experimental data, presented as graphs.
- Explanation of your experimental data.
- Description of infrastructure changes that you think would further improve:
- performance
- its measurement of performance.