Parallel + Distrubuted Prog
Parallel + Distrubuted Prog
actual speedup:
sequential algorithm on 1 proc. of a parall.omputer
S(N) =
parallel algorithm on N proc. of a parall. computer
relative speedup:
parallel algorithm on 1 proc. paral. computer
S(N) =
parallel algorithm on N proc. paral. computer
KE
IS instruction flow
PE
DS data flow
Pomnilnik
Pomnilnik
Memory
Memory
the computer executes at a given moment a number of operations over different data,
Multi-processor system:
processors share shared memory,
processors access global memory through a common bus (bottleneck if we have a lot of
processors).
processors communicate with each other by reading and writing to a shared memory.
P1 P2 … Pn computers
Connection network
stopped
https://computing.llnl.gov/tutorials/pthreads/
17 Parallel and distributed programming, Janez Žibert, Jernej Vičič UP FAMNIT
Processes in one-processor system
Computer Computer
application application
Scheduler
Scheduler determines
which thread will be CPE
executed
iterative parallelism,
recursive parallelism,
principe producer/consumer,
principe client/server,
principe interaction among equals.
Recursion:
calculate area pl on a given interval
split the interval into two halves and calculate left and right area,
lpl and rpl
recursion is stopped when |(lpl+dpl) – pl|< eps
starting call
pl = ninteg(a,b,f(a),f(b),(f(a)+f(b))+(b-a)/2)
each program reads from the input and writes to the output, the program
uses the data produced by the previous program and produces data for its
successor,
data between programs (processes) are stored in a buffer organized by a
FIFO queue.
grid interaction
...
Worker Coordinator
35