Assignment 1 – OpenMP
•
•
• •
•
Use OpenMP to parallelize the deqn code
The overall objective is to achieve good speedup by inserting OpenMP directives in the deqn code
You also need to
benchmark the runtime of each relevant loop and the runtime of the whole parallel program against the number ofthreads
Analyze the overhead of OpenMP
Computer Science, University of Warwick
1
Assignment 1 – OpenMP
•
• •
• • • •
Write a report
Explain in detail what you did with the sequentialcode
benchmark the runtime of each relevant loop and the runtime of the whole parallel program against the number of threads; present the runtimes in graph or table; analyze the results
Discuss the iteration scheduling in your program Analyze the overhead of OpenMP
Presentation skills, spelling, punctuation and grammar Up to four A4 pages
Computer Science, University of Warwick
2
Submission
– Put all the codes and the report (pdf file) in a package and submit the package through Tabula
– Deadline: 12 noon, Feb 4th, Tuesday, 2020
Computer Science, University of Warwick
3
deqn
• Model the transfer of heat through a material
• Expressed as a partial differential equation
• Discretise the equation over time and space using finite difference method
• Given the initial temperature of the material, we can calculate the temperature of the material at any time point and space location
Computer Science, University of Warwick
4
Data Dependency
ux-h,y
ux,y-h
ux,y
ux,y+h
ux+h,y
t
ux-h,y
ux,y
ux+h,y
ux,y+h
t+k
Question: How to parallelize the computation?
Computer Science, University of Warwick
5
Parallelism
Thread 1 Thread 2
Ux,y-1
Ux-1,y
Ux,y
Ux+1,y
Ux,y+1
• Each thread calculates the temperature at any time and at its local space in parallel
• Thread communication
Computer Science, University of Warwick
6