A Comparison of Task Pools for Dynamic Load Balanc

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

AComparisonofTaskPoolsforDynamicLoadBalancingofIrregularAlgorithms∗MatthiasKorchThomasRauberUniversitätBayreuthFakultätfürMathematik,PhysikundInformatikFachgruppeInformatik{matthias.korch,rauber}@uni-bayreuth.deAbstractSinceastaticworkdistributiondoesnotallowforsatisfac-toryspeed-upsofparallelirregularalgorithms,thereisaneedforadynamicdistributionofworkanddatathatcanbeadaptedtotheruntimebehaviorofthealgorithm.Taskpoolsaredatastructureswhichcandistributetasksdynamicallytodifferentprocessorswhereeachtaskspecifiescomputa-tionstobeperformedandprovidesthedataforthesecom-putations.Thispaperdiscussesthecharacteristicsoftask-basedalgorithmsanddescribestheimplementationofse-lectedtypesoftaskpoolsforshared-memorymultiproces-sors.SeveraltaskpoolshavebeenimplementedinCwithPOSIXthreadsandinJava.Thetaskpoolsdifferinthedatastructurestostorethetasks,themechanismtoachieveloadbalance,andthememorymanagerusedtostorethetasks.Runtimeexperimentshavebeenperformedonthreediffer-entshared-memorysystemsusingasyntheticalgorithm,thehierarchicalradiositymethod,andavolumerenderingalgo-rithm.1.IntroductionDesigningparallelalgorithmsforirregularproblemsischal-lengingworkbecauseitisusuallynotpossibletopredicttheamountofworkconnectedtoagivenpartoftheinputdata.Therefore,thereisnogoodstrategyavailabletodetermineastaticworkdistributionthatminimizesthecommunica-tionduringtheexecutionofthealgorithmandleadstoagoodloadbalanceatthesametime.Touseallprocessorsefficiently,irregularalgorithmsmustsupportadynamicas-signmentofcomputationstoprocessors.Onewaytodesignirregularalgorithmsforshared-memorymultiprocessorsistosplitthealgorithmintosev-eraltypesoftaskswhichareusedastheminimumunitofparallelism.Everytaskspecifiesasequenceofoperationstobeperformedandprovidesthedatafortheseoperations.Tasksarestoredinacommondatastructurewhichiscalled∗ThisisapreprintofanarticlepublishedinConcurrencyandCompu-tation:PracticeandExperience,16:1–47.Copyrightc2004JohnWileyandSons,Ltd.taskpool.Atthebeginningofthealgorithm,tasksfortheinputdataarecreatedandstoredinthetaskpool.Then,everyprocessorremovesandexecutestasksfromthepooluntilalltaskshavebeenexecuted.Duringtheexecutionofatask,newtaskscanbecreated.Taskpoolscanbeusedasauniversalapproachtoirregu-larproblems.Buttheuseoftaskpoolsoftenleadstolowerlocalitythanmethodswhichexploitspecialpropertiesoftheproblem.Forexample,methodsperformingiterativestepscanusecostestimatesextractedfromearlierstepstoreadaptthedatadistributionaftereachiteration[36].Parallelalgorithmsthatusetaskpoolscanbedescribedbyanabstractmodel.Usingthismodel,theruntimebehav-iorofsuchalgorithmscanbecharacterizedbytaskgraphs,anditispossibletousetaskgrammarsforthedescriptionofthealgorithmitself.Thus,executingatask-basedalgorithmleadstotheproblemofschedulingadirectedacyclicgraph(DAG)tomultipleprocessorsdynamically.EventhestaticschedulingproblemisNP-hard[4].Thedesignerofataskpoolcanattackthisschedulingproblembyintroducingheuristicmethodsthatreducethelatencyoftheschedulebelowaspecificbound.Anotherpossibilityistoignorethestructureofthetaskgraphanduseasimplegreedyalgorithm.Thismayincreasetheidletimebutallowsforefficientimplementationsofthetaskpoolsoperations.Thispaperfollowsthesecondapproachbymin-imizingthenumberofinstructionsofthetaskpoolopera-tionsandchoosingdatastructuresthatreducecontentiononshareddata.Implementationsoftaskpoolsusuallyusecentralordis-tributedqueuestostoretasks.Ifdistributedqueuesareused,amechanismtotransfertasksbetweenthequeuesshouldberealized,sothattheworkloadcanbebalanced.Ifpartsofthetaskpooldatastructuresaresharedbyseveralproces-sors,synchronizationmustbeusedtoavoidraceconditions.Thispaperdescribessomepossiblewaystoreducethenum-berofsynchronizationoperationsandalsothetimeproces-sorsspendwaitingtoacquirelocks.Sinceallocatingandfreeingobjectsinmainmemoryisexpensive,oneshouldalwaystrytoreducethenumberofsuchsystemcalls.Thiscanbeachievedbyre-usingmemoryblocksorbyallocat-1inglargeblockswhichcanholdseveralobjects.Becausetaskpoolsusedynamicobjectstorepresenttaskinstancesandtypicallylargenumbersoftaskinstanceswithshortex-ecutiontimesareusedtoachieveagooddistributionoftheworkload,savingsystemcallscanimprovetheperformancesignificantly.ThispaperdescribesseveraltypesoftaskpoolswhichhavebeenimplementedinCwithPOSIXthreadsandinJava.Theseimplementationshavebeenevaluatedonthreedifferentshared-memorysystems:aLinuxPC,aSunEn-terprise420RandaSunFire6800.Resultsareshownforasyntheticalgorithmandtworealisticapplications:thera-diosityandthevolrendapplicationfromtheSPLASH-2ap-plicationsuite[46].Thebestresultshavebeenobtainedusingtaskpoolswithdynamictaskstealing.Synchroniza-tionoverheadandwaitingtimesofsuchtaskpoolscanbereducedbyusingprivateandpublicqueues.Therestofthepaperisorganizedasfollows:Section2givesanoverviewoftask-basedalgorithmsanddescribesdifferenttypesoftaskpools.Then,Section3presentsrun-timeexperimentsperformedwithseveraltaskpoolvariants.Section4discussesrelatedwork,andSection5concludesthepaper.2.Task-basedalgorithms2.1.Structureanddescriptionoftask-basedalgorithmsTask-based

1 / 26
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功