![]() |
![]() |
|
02152 Concurrent Systems Fall 2008 |
CP Lab 2: Data Parallel Algorithm in Java |
Home | Plan | Material |
Assistance for this programming lab will be available in the G-databar, Building 308, rooms 15+16, Thursday September 11, 15.00-17.00.
You do not have to do any particular preparation, but you should know how to crate Java threads ([Proc 4] or [Andrews 5.4.1])
The algorithm of this lab represents a case of iterative parallelism described in [Andrews 1.4].
java Search file pattern
where file is a file name, and pattern is the string to be located.
The program measures the elapsed search time (loading of file not included) and prints the number of occurrences. Run the program on a large file and vary the search pattern.
You may e.g. try to find DNA-patterns in part of the human cromosome 2.
You should, in particular, be careful to analyze which part of the character array each thread should work on.
The measurements can be recorded by supplying the name of a data file as a fourth argument to the program. Each program run will append the number of threads and the running time in milliseconds to the data file. These data can be, for instance, be shown by the gnuplot program.
To make a graph of the results, simply enter enter gnuplot and at the prompt give the plot command.
gnuplot> plot "datafile"
Information on advanced plotting can be obtained by help plot within gnuplot or by consulting one of the tutorials, eg. the one by Kawano or Gavin.
Discuss other scheduling strategies, for which you might not experience
a performance improvement.
Always beware that measuring computing times on a timeshared system is like measuring length with an elastic ruler.
Hans Henrik Løvengreen, Sep 8, 2008 |