Sunum yükleniyor. Lütfen bekleyiniz

Sunum yükleniyor. Lütfen bekleyiniz

Paralel Programlamaya Giriş

Benzer bir sunumlar


... konulu sunumlar: "Paralel Programlamaya Giriş"— Sunum transkripti:

1 Paralel Programlamaya Giriş
BM-308 Paralel Programlamaya Giriş Bahar 2017 (6. Sunu) (Yrd. Doç. Dr. Deniz Dal)

2 Deadlock (Ölümcül Kilitlenme)
Deadlock occurs when 2 (or more) processes are blocked and each is waiting for the other to make progress. (4 yönlü bir kavşakta bütün yönleri kontrol eden trafik ışıklarının tamamı kırmızı yanıyor?????) Neither process makes progress because each depends on the other to make progress first. The program shown below is an example. It fails to run to completion because processes 0 and 1 deadlock.

3 Deadlock (Ölümcül Kilitlenme) (01_Deadlock.cpp)
if( myrank == 0 ) { /* Receive, then send a message */ MPI_Recv( b, 100, MPI_DOUBLE, 1, 19, MPI_COMM_WORLD, &status ); MPI_Send( a, 100, MPI_DOUBLE, 1, 17, MPI_COMM_WORLD ); } else { MPI_Recv( b, 100, MPI_DOUBLE, 0, 17, MPI_COMM_WORLD, &status ); MPI_Send( a, 100, MPI_DOUBLE, 0, 19, MPI_COMM_WORLD );

4 Avoiding Deadlock The following program shown is similar to the program in the preceding section. Its communication is better organized and the program does not deadlock. Once again, process 0 attempts to exchange messages with process 1. Process 0 sends, then receives; process 1 receives, then sends. The protocol is safe.

5 Avoiding Deadlock (02_Safe_Exchange.cpp)
if( myrank == 0 ) { /* Send, then receive a message */ MPI_Send( a, 100, MPI_DOUBLE, 1, 17, MPI_COMM_WORLD ); MPI_Recv( b, 100, MPI_DOUBLE, 1, 19, MPI_COMM_WORLD, &status ); } else { /* Receive, then send a message */ MPI_Recv( b, 100, MPI_DOUBLE, 0, 17, MPI_COMM_WORLD, &status ); MPI_Send( a, 100, MPI_DOUBLE, 0, 19, MPI_COMM_WORLD );

6 Data Distributions

7 Block Distribution

8 Block Distribution

9 Cyclic Distribution

10 Cyclic Distribution

11 Block-Cyclic Distribution

12 Block-Cyclic Distribution

13 Soru?? Bilgisayar Mühendisliği Bölümü, bitirme projesi yapacak öğrencileri öğretim üyelerine hangi algoritma ile dağıtmaktadır?


"Paralel Programlamaya Giriş" indir ppt

Benzer bir sunumlar


Google Reklamları