Miary Wydajności Cza ykonania rónoległego (par) jet czaem pomiędzy momentem rozpoczęcia obliczeń do momentu gdy otatni proceor zakończy obliczenia Przypiezenie (S) jet definioane jako tounek czau niezbędnego do roziązania problemu z ykorzytaniem jednego proceora (eq) do czau potrzebnego do roziązania tego amego problemu z ykorzytaniem ytemu rónoległego o "p" proceorach (par) zględne - eq jet czaem ykonania algorytmu rónoległego na jednym z proceoró ytemu ieloproceoroego rzeczyite - eq jet czaem ykonania najlepzego algorytmu ekencyjnego na jednym z proceoró ytemu rónoległego bezględne - eq jet czaem ykonania najlepzego algorytmu ekencyjnego na najlepzym komputerze ekencyjnym Miary Wydajności Efektyność programu rónoległego (E) jet definioana jako tounek przyśpiezenia do liczby proceoró Kozt jet zykle definioany jako iloczyn rónoległego czau przetarzania i liczby proceoró. Skaloalność ytemu rónoległego jet miarą jego zdolności do ziękzenia przyśpiezenia proporcjonalnie do liczby proceoró. Kozt komunikacji ieciach tatycznych Podtaoe parametry - cza przygotoania (tartup time) (t ) - cza przełania nagłóka (per-hop time) (t h ) - cza przełania jednego łoa (t ) Strategie przeyłania - tore and forard (zapamiętaj i prześlij) - cut-through routing Page
Komunikat przeyłany od proceora P 0 do P ime P 0 P P P P 0 P P Komunikat przeyłany metodą SF ime P Komunikat przeyłany metodą C (podział na die części) ime P 0 P P P Komunikat przeyłany metodą C (podział na cztery części) Kozt Komunikacji Store and forard routing (SF) komunikat jet przeyłany pomiędzy proceorami taki poób, że każdy z pośredniczących przełaniu proceoró najpier zapamiętuje cały komunikat ojej lokalnej pamięci i dopiero potem yyła komunikat dalej tcomm t ( mt th) l Cut-through routing (C) komunikat jet dzielony na róne części, które ą przeyłane pomiędzy proceorami bez oczekiania na odebranie całego komunikatu tcomm t lth mt Podtaoe Prymityy komunikacyjne -Pojedynczy komunikat pomiędzy doma proceorami - One-to-all broadcat - All-to-all broadcat - One-to-all peronalized - All-to-all peronalized - Circular hift Page
Komunikacja grupoa One-to-all broadcat M M M M 0 p- Single-node accumulation 0 p- M p- M p- M p- All-to-all broadcat M M 0 M M p- M 0 0 p- 0 p- Multinode accumulation M M 0 M M 0 Komunikacja grupoa M p- M M 0 One-to-all peronalized M 0 M M p- 0 p- 0 p- Single-node gather M 0,p- M,p- M p-,p- M p-,0 M p-, M p-.p- M 0, M 0,0 M, M,0 M p-, M p-,0 All-to-all peronalized M,0 M 0,0 M, M 0, M,p- M 0,p- 0 p- 0 p- Multinode gather 8 8 One-to-all broadcat - SF 0 Dla ieci typu ring one _ to_ all_ b p t t m 0 9 9 Page
One-to-all broadcat - SF 8 9 0 0 Dla ieci typu meh z zapętleniem one _ to_ all_ b t tm p 0 0 One-to-all broadcat - SF (0) () (00) (0) (00) (0) 0 (000) (00) t t m log Dla ieci hypercube p one_ to_ all_ b One-to-all broadcat - SF procedure ONE_O_ALL_BC(d,my_id,X); mak:= d -; for i:=d- donto 0 do mak:=mak XOR i ; if (my_id AND mak)=0 then if (my_id AND i )=0 then mg_detination:=my_id XOR i ; end X to mg_detination; endif ele mg_ource:=my_id XOR i ; receive X from mg_ource; endele; endfor; end ONE_O_ALL_BC Proceor 0 yyła komunikat Page
All-to-all broadcat - SF () () () () () () () () (0) () () () 0 (0) () () () Pierzy krok () () () (,) (,) (,) (,) () (0,) (0,) (,) (,) 0 () (0) () () Drugi krok All-to-all broadcat - SF (0) () () (..) (0..) (0..,) (0..,,) (0,..) (0,,..) (0..,..) (0..,..) 0 () Siódmy krok () () () All-to-all broadcat - SF procedure ALL_O_ALL_BC_RING(my_id,my_mg,p,reult); left:=(my_id - ) mod p; right:=(my_id + ) mod p; reult:=my_mg; mg:=reult; for i:= to p- do end mg to right; receive mg from left; reult:=reult mg; endfor; end ALL_O_ALL_BC_RING; alltoallbc t t m p Page
All-to-all broadcat - SF () () (,) (,) () () (,) (,) () (0) 0 () () (0,) 0 (,) (,) (0,) a) Wtępne b) Rozmiezczenie rozmiezczenie komunikató przed komunikató drugim krokiem All-to-all broadcat - SF (..) (..) (0..) (0..) (0..) (0..) (0..) (0..) (0..) 0 (..) (..) (0..) (0..) 0 (0..) (0..) (0..) c) Rozmiezczenie komunikató przed trzecim krokiem d) Końcoe rozmiezczenie komunikató alltoallbc t log p t m p One-to-all peronalized - SF 0 Pierzy krok () 0 Drugi krok () () 8 8 Page
One-to-all peronalized - SF () () () () Siódmy krok 0 () () () onetoall per t t m p 9 9 One-to-all peronalized - SF (..) (8..) 8 9 0 (..) (0..) 0 0 0 One-to-all peronalized - SF () () () () 8 9 0 (0) () (8) (9) () () () () 0 (0) () () () onetoall per p t mp t Page
8 One-to-all peronalized broadcat - SF (0..) 0 (0..) 0 (..) a) Wtępne rozmiezczenie komunikató b) Rozmiezczenie komunikató przed drugim krokiem One-to-all peronalized broadcat - SF (,) () () (,) () () (0,) 0 (,) () (0) 0 () () c) Rozmiezczenie komunikató przed trzecim krokiem d) Końcoe rozmiezczenie komunikató onetoall per t log p t m p Collective Communication MPI provide a variety of routine for ditributing & reditributing data, gathering data, performing global um etc. communication involving a group of procee It alay involve every proce in the communicator. hree clae of collective operation: ynchronization - barrier data movement - broadcat, catter, gather collective computation - global um, global maximum, etc. Page 8
9 Characteritic of collective communication Collective communication cannot interfere ith point-to-point communication and vice vera Collective and point-to-point communication are tranparent to one another. A collective communication may or may not ynchronize the procee involved Completion implie the buffer can be ued or re-ued. Hoever, there i no uch thing a a non-blocking collective communication in MPI. All procee in the communicator mut call the collective communication. Similaritie & Difference ith PP Similaritie: A meage i an array of a particular data type. Data type mut match beteen end and receive. Difference: here i no concept of tag. he ent meage mut fill the pecified receive buffer. Barrier ynchronization hi i the implet of all the collective operation and involve no data at all. It block the calling procee until all group member have called it. In one phae of computation, all procee participate in riting a file. he file i to be ued for the next phae of computation. herefore, no proce hould proceed to the econd phae until all procee are completed in phae one. MPI_Barrier(MPI_Comm communicator); Page 9
0 One_to_all Broadcat data from one proce to all procee in a communicator A broadcat ha a pecified root proce and every proce receive one copy of the meage from the root. All procee mut pecify the ame root. data rank broadcat MPI_Bcat(void *buf, /* INOU buffer */ int count, MPI_Datatype datatype, int root, MPI_COMM_WORLD) 8 8 MPI_SCAER Scatter data from one proce to all procee in a communicator hee routine alo pecify a root proce and all procee mut pecify the ame root. he main difference from broadcat i that end & receive detail are different. 9 9 MPI_SCAER data rank A A A catter A A A MPI_Scatter(void *endbuf, int endcount, /* ent to each proce */ MPI_Datatype endtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_COMM_WORLD); 0 0 Page 0
MPI_ALLGAHER, MPI_ALLOALL Gather data from all procee in a group to one proce hee routine don t have a pecified root proce. Send & receive detail are ignificant on all procee and can be different. MPI_ALLGAHER, MPI_ALLOALL data rank A A A gather A A A MPI_Gather(void *endbuf, int endcount, MPI_Datatype endtype, void *recvbuf, int recvcount, /* for any ingle recv */ MPI_Datatype recvtype, int root, MPI_COMM_WORLD); Global reduction operation hee are ued hen e ant to compute a reult hich involve data ditributed acro a group of procee. Sum of to integer Product of to real number he product of to quare matrice Maximum of to integer return a reult to a proce or all procee MPI_Reduce( ); MPI_Allredule( ); Page