Title: Introduction to Parallel Processing
1Introduction to Parallel Processing
- Home Assignment Number 1
- Basic MPI
21. Write a serial program that calculates
Sin2(x)Cos2(x)-1. The program will have two
blocks.. The first will compute a2Sin2(x) from
the Taylor expansion of Sin(x) to order e The
second block will do the same for
b2Cos2(x). Then, the program will print the
error a2b2-1 Measure the run-time using the
'time' command
32. Convert the program of section 1 to a
Parallel SPMD program. The SPMD program will use
3 processes One Master and two workers. The goal
of the program is to verify that
Sin2(x)Cos2(x)1 The master will send the
value of x and e (see below) to the workers. The
first worker will compute aSin(x) by Taylor
expansion of order e. The second worker with
computer bCos(x) by Taylor expansion of order e
as well. Then, when each worker completes its job
it will send back to the master its own result
squared, i.e. a2aa and b2bb. Finally, the
master will print the error a2b2-1 to be
compared of course to zero. Measure the run-time
using 'time' and MPI_wtime().
43. Repeat each program twice. once for e20 and
then for e200. 4. What are your conclusions?
Calculate the speedup and the efficiency in both
cases (see section 3). Submit the source code,
results and documentation to pp_at_ee.bgu.ac.il Spec
ify your names and group ID. Due In Two weeks!