Parallel Computing I Homework 1: Getting Started: Task 1 (2 Points)
Parallel Computing I Homework 1: Getting Started: Task 1 (2 Points)
Task 1 (2 Points)
Think about four factors influencing the run time of a program. Rate their influence (e.g. high,
normal, low) and reason your decision.
Task 2 (5 Points)
Download the c-program task2.c and open it with a text editor. Try to understand the function
of the program. You can compile the program with a c-compiler, for example gcc. You can use
the jobfile jobtask2.pbs to submit the compiled code to the cluster.
In this task you are going to extend the code and measure the time needed for calculation
the sum for different sizes n and s.
Initialize the array x with random numbers.
Modify the code so it automatically varies
n (e.g. 1000, 10.000... 10.000.000)
and s (1, 2, 4... 10)
Plot the results in a graph and describe them
Task 3 (5 Points)
Download the c-program task3.c and open it with a text editor. The program sends a message
from one process to another and back. The time needed is called round-trip latency.
In this task you are going to measure the time needed for messages of different size size.
Vary the size of the message and plot the time needed for transferring a message from
one process to another.
To submit the code to the cluster you can use the jobfile jobtask3.pbs
Currently we are requesting one node and two processors per node. Change the jobfile in
order to request two nodes and one processor per node. Now repeat your measurements.
Evaluate the result.
Task 3 (8 Points)
Consider the exaples from pthread-programming in the lecture and in the exercise. Study the
pthread tutorial in following the additional reading links.
Program a matrix-matrix multiplication with pthreads
Explain in words, what your program is doing!