Software Analye PERFORMANCE ANALYSIS OF PARALLEL ALGORIHMS Felcan ALECU PhD, Unverty Lecturer, Economc Informatc Deartment, Academy of Economc Stude, Bucharet, Romana E-mal: alecu.felcan@e.ae.ro Abtract: A grd a collecton of ndvdual machne. he goal to create the lluon of a owerful comuter out of a large collecton of connected ytem harng reource. Some reource may be ued by all uer of the grd whle other may have ecfc retrcton. he mot common reource comutng cycle rovded by the roceor. Grd comutng rereent unlmted oortunte n term of bune and techncal aect. he man reaon of arallelzaton a equental rogram to run the rogram fater. he frt crteron to be condered when evaluatng the erformance of a arallel rogram the eedu ued to exre how many tme a arallel rogram work fater than the correondng equental one ued to olve the ame roblem. When runnng a arallel rogram on a real arallel ytem there an overhead comng from roceor load mbalance and from communcaton tme needed for changng data between roceor and for ynchronzaton. h the reaon why the executon tme of the rogram wll be greater than the theoretcal value. Key word: grd comutng; grd network; arallel roceng; erformance analy; arallel eedu; arallel effcency he erformance of arallel algorthm executed on multroceor ytem he frt crteron taken nto conderaton when the erformance of the arallel ytem are analyzed the eedu ued to exre how many tme a arallel rogram work fater than a equental one, where both rogram are olvng the ame roblem. he mot mortant reaon of arallelzaton a equental rogram to run the rogram fater. he eedu formula S where - the executon tme of the fatet equental rogram that olve the roblem; 29
Software Analye - the executon tme of the arallel rogram ued to fnalze the ame roblem. If a arallel rogram executed on a comuter havng roceor, the hghet value that can be obtaned for the eedu equal wth the number of roceor from the ytem. he maxmum eedu value could be acheved n an deal multroceor ytem where there are no communcaton cot and the workload of roceor balanced. In uch a ytem, every roceor need / tme unt n order to comlete t job o the eedu value wll be a the followng: S here a very mle reaon why the eedu value cannot be hgher than n uch a cae, all the ytem roceor could be emulated by a ngle equental one obtanng a eral executon tme lower than. But th not oble becaue rereent the executon tme of the fatet equental rogram ued to olve the roblem. Accordng to the Amdahl law, t very dffcult, even nto an deal arallel ytem, to obtan a eedu value equal wth the number of roceor becaue each rogram, n term of runnng tme, ha a fracton α that cannot be arallelzed and ha to be executed equentally by a ngle roceor. he ret of ( - α) wll be executed n arallel. he arallel executon tme and the eedu wll become: + S When, we have α ( α) / α + ( α) / α + ( α) / α ( ) + lm S he maxmum eedu that could be obtaned runnng on a arallel ytem a rogram wth a fracton α that cannot be arallelzed /α, no matter of the number of roceor from the ytem. For examle, f a rogram fracton of 20% cannot be arallelzed on a four roceor ytem, the arallel executon tme and the eedu wll be equal wth: 0.2 + 0.8/ 4 0. 4 S 0.4 α 0.4 2.5 he arallel executon tme wll be 40% of the eral executon tme and the arallel rogram wll be only 2.5 tme fater than the equental one becaue 20% of the rogram cannot be arallelzed (fgure ). he maxmum eedu that we can obtan /0.2 5 and th mean that the arallel executon tme wll never be horter than 20% of the equental executon tme even n a ytem wth an nfnte number of roceor. Amdahl low conclude t very mortant to dentfy the fracton of a rogram than cannot be arallelzed and to mnmze t. 30
Software Analye he arallel effcency quantfe the number of the valuable oeraton erformed by the roceor durng the arallel rogram executon. he arallel effcency could be exreed a the followng: S E where S the eedu and rereent the number of the roceor from the ytem. Sequental executon Parallel executon P P 4 P P 2 P 3 20% equental 20% 20% 20% 20% 00% equental Fgure. Parallel executon on an deal ytem Due to the fact the eedu value lower than the number of roceor, the arallel effcency wll be alway located between 0 and. Another mortant ndcator the executon cot rereentng the total roceor tme ued to olve the roblem. For a arallel alcaton, the arallel cot could be calculated accordng wth the followng formula: C For a equental rogram, t cot (equental cot) wll be equal wth the total executon tme: C For th reaon, the arallel effcency could be alo exreed a the followng: S C E C Fnally, the ulementary cot of arallel roceng ndcate the total roceor tme ent for econdary oeraton not drectly connected wth the man uroe of the rogram that executed. Such a cot cannot be dentfed for a equental rogram. C C C u l he fgure 2 reent the way n whch a arallel rogram wll be executed on a real 4 roceor ytem. h tme, the rogram contan a fracton of 20% that cannot be 3
Software Analye arallelzed, the load of the roceor not balanced and the communcaton tme are not neglected anymore. he ource of th tye of cot rereented by the followng element: - load mbalance generated by the unbalanced tak that are agned to dfferent roceor. In uch a cae, ome roceor wll fnh the executon earler o they need to wat n an dle tate for the other tak to be comleted. Alo, the reence of a rogram fracton that cannot be arallelzed generate load mbalance becaue th orton of code hould be executed by a ngle roceor n a equental manner. - ulementary calculaton generated by the need to comute ome value locally even f they are already calculated by another roceor that, unfortunately, buy at the tme when thee data are neceary. - communcaton and ynchronzaton between roceor the roceor need to communcate each other n order to obtan the fnal reult. Alo, there are ome redefned executon moment when ome roceor hould ynchronze ther actvty. Sequental executon Parallel executon P P 4 P P 2 P 3 20% equental ~20% ~20% ~20% ~20% 00% equental Fgure 2. Parallel executon on a real ytem In order to obtan a fater rogram, we can conclude we need to reduce to the mnmum the fracton that cannot be arallelzed, to aure the load balance of the tak at the roceor level and alo to mnmze the tme dedcated for communcaton and ynchronzaton. he erformance of arallel algorthm executed on grd ytem A grd a collecton of machne that contrbute any combnaton of reource a a whole. Bacally, grd comutng rereent a new evolutonary level of dtrbuted comutng. It tre to create the lluon of a vrtual ngle owerful comuter ntead of a large collecton of ndvdual ytem connected together. hee ytem are harng varou reource lke comutng cycle, data torage caacty ung unfyng fle ytem over 32
Software Analye multle machne, communcaton, oftware and lcene, ecal equment and caacte. he ue of the grd often born from a need for ncreaed reource of ome tye. Grd can be bult n all ze, rangng from jut a few machne n a deartment to grou of machne organzed n herarchy annng the world. he mlet grd cont of jut few machne, all of the ame hardware archtecture and ame oeratng ytem, connected on a local network. Some eole would call th a cluter mlementaton rather than a grd. he next te to nclude heterogeneou machne but wthn the ame organzaton. Such a grd alo referred to a an ntragrd. Securty become more mortant a more organzaton are nvolved. Sentve data n one deartment may need to be rotected from acce by job runnng for other deartment. Dedcated grd machne may be added to ncreae the ervce qualty. Over tme, a grd may grow to cro organzaton boundare and may be ued for common nteret roject. h known a an ntergrd. We wll conder a arallel rogram that executed n a tme of on a grd network comoed by comuter numbered from to. Alo, the equental executon tme of the rogram on an ndvdual taton wll be. he eedu of a arallel rogram that run on the cluter of taton can be comuted by dvdng the bet equental tme by the arallel one: mn S grd he ndvdual comuter of the grd network are not dentcal o they wll have dfferent roceng ower. he rato between the ower of an ordnary comuter and the mot owerful one can be exreed can be exreed by the formula: j mn j P,.. Each roorton wll atfy the followng relaton: P. Baed on thee rato, we can calculate the heterogenety factor of the comuter beng art of the cluter of taton by ung the dfference n ower that ext between them: ( P ) HF Durng a rogram executon, the degree of arallelm wll vary and th wll generate the load mbalance of the roceor from the ytem. Bacally, the degree of arallelm equal wth the number of roceor that are artcatng to the rogram executon. he average degree of arallelm defned a beng the average number of taton that were actve durng the entre executon of the rogram, a the followng: GP m 33
Software Analye where rereent how much tme the taton wa actve. he eedu formula can be now obtaned baed on the heterogenety of the taton that are art of the grd network and ung the average degree of arallelm of the rogram that executed: S GP ( GE). grd m In concluon n order to obtan a fater arallel rogram, there the need to reduce to the mnmum the fracton that cannot be arallelzed, to aure the load balance of the tak at the roceor level and alo to mnmze the amount of data ued for communcaton and ynchronzaton. Reference. Grama, A. et al, An Introducton to Parallel Comutng: Degn and Analy of Algorthm, Addon Weley, 2 nd edton, 2003 2. Gro, W. et al, he Sourcebook of Parallel Comutng, Morgan Kaufmann, 2002 3. Jordan, H. F., Jordan, H. E. Fundamental of Parallel Comutng, Prentce Hall, 2002 4. Joeh, J., Fellenten, C., Grd Comutng, Prentce Hall, 2003 5. Ladd, S., Gude to Parallel Programmng, Srnger-Verlag, 2004 6. anenbaum, A. S. Dtrbuted Oeratng Sytem, Prentce Hall, 995 7. Wyrzykowk, R., Parallel Proceng And Aled Mathematc, Srnger, 2004 Alecu Felcan ha graduated the Faculty of Cybernetc, Stattc and Economc Informatc n 2000 and he hold a PhD dloma n Economc from 2006. Currently he lecturer of Economc Informatc wthn the Deartment of Economc Informatc at Faculty of Cybernetc, Stattc and Economc Informatc from the Academy of Economc Stude. He the author of more than 20 journal artcle n the feld of arallel comuter, grd comutng and dtrbuted roceng. 34