Paralel Programlamaya Giriş BM-308 Paralel Programlamaya Giriş Bahar 2017 (6. Sunu) (Yrd. Doç. Dr. Deniz Dal)
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.
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 );
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.
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 );
Data Distributions
Block Distribution
Block Distribution
Cyclic Distribution
Cyclic Distribution
Block-Cyclic Distribution
Block-Cyclic Distribution
Soru?? Bilgisayar Mühendisliği Bölümü, bitirme projesi yapacak öğrencileri öğretim üyelerine hangi algoritma ile dağıtmaktadır?