Doctoral theses at NTNU, 2017:175 s i Alexandru Ciprian Iordan A s exl e an h d r t u Improving the Energy-Efficiency C l ip a rian or of Task Based Programming on Io t r c d a o Chip Multiprocessors n D ISBN 978-82-326-2422-5 (printed ver.) ISBN 978-82-326-2423-2 (electronic ver.) ISSN 1503-8181 Doctoral theses at NTNU, 2017:175 NTNUniversity of Science and TechnologyThesis for the Degree ofPhilosophiae Doctorormation Technology and ElectricalEngineeringDepartment of Computer Science U nf gian y of I we ult r c o a N F Alexandru Ciprian Iordan Improving the Energy-Efficiency of Task Based Programming on Chip Multiprocessors Thesis for the Degree of Philosophiae Doctor Trondheim, June 2017 Norwegian University of Science and Technology Faculty of Information Technology and Electrical Engineering Department of Computer Science NTNU Norwegian University of Science and Technology Thesis for the Degree of Philosophiae Doctor Faculty of Information Technology and Electrical Engineering Department of Computer Science © Alexandru Ciprian Iordan ISBN 978-82-326-2422-5 (printed ver.) ISBN 978-82-326-2423-2 (electronic ver.) ISSN 1503-8181 Doctoral theses at NTNU, 2017:175 Printed by NTNU Grafisk senter Tomylovingwifeandourbeautifulchildren. Abstract In the early 2000s, the superscalar CPU paradigm reached the point of diminishing re- turnsmainlyduetopowerrequirementsandoverheatingconcerns.Facedwithaconstant demand for performance, hardware developers were in need of new ways to efficiently use the ever increasing transistor count predicted by Moore’s law. The Chip MultiPro- cessors(CMPs)cameasanaturalsolutiontothepowerwall: severallesscomplexand significantly less "power hungry" cores integrated on a single chip. In almost all ICT segmentstoday,fromHighPerformanceComputing(HPC)toembeddeddevices,CMPs havebecomethearchitectureofchoice. WiththiswideadoptionofCMPs,softwarede- velopers need to use parallel programming to fully exploit this architecture. Although parallelizationcanmaximizetheperformanceandenergyefficiencyofapplicationsrun- ning on CMPs, it also comes with its own set of challenges. Among these, inherent managementoverheadsthatcanaccountforsub-linearspeedupsandcanincreasetheen- ergyconsumptionofexecutions. Becauseofrisingconcernsforenergycostandbattery life,muchresearchanddevelopmenttodayfocusesonreducingpowerrequirementsand savingenergy. In this thesis, we investigate how parallel programming can be used to improve the en- ergy efficiency of applications running on CMP systems. We focus on a programming paradigmcalledTaskBasedProgramming(TBP).ThebaseconceptoftheTBPmodelis thattheprogrammerfocusesonidentifyingandannotatingpiecesofcode(tasks)which can be executed concurrently with other tasks. An important result of our work is an increased understanding of how computations, parallelization and energy consumption relatewhenexecutingonCMPsystems. Working in this direction, we use a simulation framework to allow for increased flex- ibility in design space exploration and noninvasive measurements. Unfortunately, the performanceoverheadofsimulationissignificant: simulatingaparallelapplicationcan be 10000x slower than executing it on real hardware. In the first part of our research, wetookituponourselvestotrytosolvethisissue. Weinvestigatethechallengesofem- ploying a sampling based technique to take advantage of the periodic behavior in TBP parallelapplications. Ourproposalisasimple3-phasemethodologythatidentifiesonly asmallnumberofrepresentativeexecutionsamplestosimulatethusreducingtheoverall simulationtime. In the second part of our work, we look at parallelization as a mean to save energy on CMPplatforms. WetestandcomparetwoTBPlibraries,WoolandIntelTBB,focusing onthebehaviorofsomebasicTBPparallelizationoperationsliketaskspawning,tasksyn- chronizationandtaskstealing.Weinvestigatetheenergyfootprintoftheseparallelization overheadsandtheeffectithasontheenergy-efficiencyoftheexecutingsystem.Wehave identifiedthatfailedtaskstealsamountforthelargestoverhead. Toreducetheirimpact and improve our system’s energy efficiency, we devised a new occupancy-aware policy forvictimselection. Thispolicyallowsforamoreinformeddecisionwhenselectingthe victimfortaskstealingandreducesthenumberoffailedsteals. i ii Preface This doctoral thesis was submitted to the Norwegian University of Science and Tech- nology(NTNU)inpartialfulfillmentoftherequirementsforthedegreeofphilosophiae doctor(PhD).TheworkhereinwasperformedattheDepartmentofComputerandInfor- mationScience(IDI),NTNU,underthesupervisionofProfessorLasseNatvig. This thesis consists of two parts. The first part consists of introduction, background, methodology,researchprocess,asummaryofpapersandfinalconclusions. Thesecond partisthemaincontribution,presentedasacollectionofsixresearchpapers. iii iv Acknowledgements Nodeedisachievedsingle-handedlyandtheworkforthisthesisisnoexception. There aresomanypeoplethatIneedtothankfortheirsupport,guidance,orsimplybeingthere withmethroughoutmyPhDexperience. First,IwouldliketothankmysupervisorProf.LasseNatvigforhisadviceandguidance duringmyNorwegianadventurethatbecamethisthesis.FromthefirsteveningwhenIar- rivedinTrondheimandhepickedmeupfromtheairportbus,itwashishelpandconstant support that made me stay on track. Thank you for being patient with my many ideas and (slow) investigations, but also for pulling me back when I was a bit too ambitious. I also extend my gratitude to my co-supervisors, Prof. Per Gunnar Kjeldsberg and Dr. Gaute Myklebust for providing valuable feedback and encouragement in my evaluation meetings. I also owe a great deal of gratitude to Magnus Jahre for his help beyond and above my academic work. He was my “person to go to” for any issues that I faced, research or otherwise, and he always provided me with good insight. Thank you for the countless slabberas1meetingsandforhelpingmegoovertheculturalbarier. IwouldliketothankmycolleaguesatthedepartmentofComputerandInformationSci- ence throughout the years: Kostas, Dragana, Asbjorn, Stefano, Ian, Nico, Yaman, Jan- Christian, Abdullah, Nikita, Juan Manuel, Odd Rune and many others. Thank you for providingagreatworkingenvironmentwithcountlessinteresting,engaginganddiverse discussions. IwouldliketothankAnaLuciaVarbanescuforfirstsuggestingmethePhDpositionat NTNU.Hersupportandguidanceinpreparingfortheinterviewwasinvaluableaswellas alltheadvicessheprovidedeversince. I also need to thank Prof. Radu Varbanescu for introducing me to all the wonders and perilsofacademicresearch. Itwashissupportduringmybachelorandmasterstudiesin RomaniathatgotmetothepointwhereIwantedandwasabletodoPhDwork. Finally, I would like to thank my family. To my parents and parents-in-law thank you for all the help and support in making sure I do not feel alone far away from my home country.Yourvisitsandcarepackagesovertheyearshavemeantalotforme.However,to mylovingwifeCristinaIowemaybethemost.Withoutherrelentlesssupportbeforeand duringmyPhDwork,noneofitwouldhavebeenpossible. AndalsoIshouldnotforget tomentionourtwobeautifulchildren,DavidandMatei,whomadesureIhadsomething todooutsidemywork. 1Norwegian:slabberas-pleasantconversationoverteaorcoffee v
Description: