slides6 (1111)

slides6 (1111) - Synchronous Computations ITCS 4/5145...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
6.1 Synchronous Computations ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson, 2009.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.2 Synchronous Computations In a (fully) synchronous application, all the processes synchronized at regular points. Barrier A basic mechanism for synchronizing processes - inserted at the point in each process where it must wait. All processes can continue from this point when all the processes have reached it (or, in some implementations, when a stated number of processes have reached this point).
Background image of page 2
6.3 Processes reaching barrier at different times
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.4 In message-passing systems, barriers provided with library routines:
Background image of page 4
6.5 MPI MPI_Barrier() Barrier with a named communicator being the only parameter. Called by each process in the group, blocking until all members of the group have reached the barrier call and only returning then.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.6 Barrier Implementation Centralized counter implementation (a linear barrier ):
Background image of page 6
6.7 Good barrier implementations must take into account that a barrier might be used more than once in a process. Might be possible for a process to enter the barrier for a second time before previous processes have left the barrier for the first time.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.8 Counter-based barriers often have two phases: • A process enters arrival phase and does not leave this phase until all processes have arrived in this phase. • Then processes move to departure phase and are released. Two-phase handles the reentrant scenario.
Background image of page 8
6.9 Master: for (i = 0; i < n; i++) /*count slaves as they reach barrier*/ recv(Pany); for (i = 0; i < n; i++) /* release slaves */ send(Pi); Slave processes: send(P master ); recv(P master ); Example code:
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.10 Barrier implementation in a message-passing system
Background image of page 10
Tree Implementation More efficient. O(log p ) steps Suppose 8 processes, P 0, P 1, P 2, P 3, P 4, P 5, P 6, P 7: 1st stage: P 1 sends message to P 0; (when P 1 reaches its barrier) P 3 sends message to P 2; (when P 3 reaches its barrier) P 5 sends message to P 4; (when P 5 reaches its barrier) P 7 sends message to P 6; (when P 7 reaches its barrier) 2nd stage: P 2 sends message to P 0; ( P 2 & P 3 reached their barrier) P 6 sends message to P 4; ( P 6 & P 7 reached their barrier) 3rd stage: P 4 sends message to P 0; ( P 4, P 5, P 6, & P 7 reached barrier) P 0 terminates arrival phase; (when P 0 reaches barrier & received message from P 4) Release with a reverse tree construction . 6.11
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Tree barrier 6.12
Background image of page 12
Butterfly Barrier 6.13
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Suppose a process Pi needs to be synchronized and to exchange data with process Pi -1 and process Pi +1 before continuing: Not a perfect three-process barrier because process Pi -1 will only synchronize with Pi and continue as soon as Pi allows. Similarly, process Pi +1 only synchronizes with P i . 6.14
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/07/2010 for the course ECON 20091_ECO taught by Professor Mohammadsafarzadeh during the Fall '09 term at USC.

Page1 / 78

slides6 (1111) - Synchronous Computations ITCS 4/5145...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online