Главная » Просмотр файлов » 1994. Compiler Transformations for High-Perforamce Computing

1994. Compiler Transformations for High-Perforamce Computing (798436), страница 16

Файл №798436 1994. Compiler Transformations for High-Perforamce Computing (1994. Compiler Transformations for High-Perforamce Computing) 16 страница1994. Compiler Transformations for High-Perforamce Computing (798436) страница 162019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 16)

Thesecond pair of boundcomputationsbecomes useless and is also removed.Thefinal result is shown in Figure58(c).7.3.3BoundsReductionIn Figure58(c), the guards control whichiterationsof the loop performcomputation. Since the desired set of iterationsisa contiguousrange,the compilercanachieve the same effect by changingtheinductionexpressionsto reduce the loopbounds[Koelbel1990].Figure58(d)shows the result of the transformation.7.4 CommunicationOptimizationAn importantpart of compilationfor distributed-memorymachinesis the analysis of an application’scommunicationneeds and introductionof explicitmessage-passingoperationsinto it.

Before astatementis executedon a given processor, any data it relieson thatis notavailablelocally must be sent. A simplemindedapproachis togenerateamessagefor each nonlocaldataitemreferencedby thestatement,buttheresultingoverheadwillusuallybe unacceptablyhigh. Compilerdesignershavedevelopeda set of optimizationsthat reduce the time requiredfor communication.The same fundamentalissues arise incommunicationoptimizationas in optimizationfor memoryaccess (describedin Section 6.5): maximizingreuse, minimizingthe workingset, and makinguseof availableparallelismin the em-nmunication system. However,the problemsaremagnifiedbecause while the ratio of onememoryaccess to one computationonS-DLX is 16:1,the ratio of the numberTransformations●399of cvcles reauiredto send one word to thenumberof ‘cycles requiredfor a singleoperationon dMX is about 500:1.Like vectors on vector processors,communicationo~erationson a distributedmemorymachineare characterizedby astartuptime, t~, and a per-elementcost,t~, the time requiredto send one byteonce the message has been initiated.OndMX,t, = 10PS andth = 100ns,sosending ‘one 10-byte message costs 11 pswhile sendingtwo 5-byte messages costs21 ps.

To avoid payingthe startupcostunnecessarily. . . the o~timizationsin this.section combinedata from multiplemessagesandsendthemina singleoperation.7.4.1 MessageVectorizationAnalysiscan often determinethe set ofdata items transferredin a loop. Ratherthan sending each elementof an array inan individualmessage, the compilercangroup many of them togetherand sendthem in a sirwle block transfer.Becausethis is analo~ousto the way a vectorprocessor interactswith memory,the optimizationis calledmessagevectorization [Balasundaramet al. 1990; Gerndt1990; Zima et al. 1988].Figure59(a) shows a sample loop thatmultiplieseach elementof array a by themirrorelementof array b. Figure 59(b) isan inefficientparallelversion for processors O and 1 on dMX.

To simplifythecode, we assumethatthe arrayshavealreadybeen allocatedto the processorsusinga block decomposition:the lowerhalf of each array is on processorO andthe upper half on processor1.Each processorbeginsby computingthe lower and upper bounds of the rangethatit is res~onsiblefor. Duringeachiteration,it s&dsthe elementof”b thatthe other processorwill need and waitsto receivethe correspondingmessage.NotethatFortran’scall-by-referencesemanticsc.on~ertthearrav.referenceimplicitlyinto the addressof the correspondingelement,which is then used bythe low-levelcommunicationroutinetoextractthe bytes to be sent or received,ACMComputmgSurveys,Vol.

26, No. 4, December1994400“Daviddoi=l,na[il= a[ilendF. Baconet al.theirinternalbuffersizes are exceeded.The compilermay be able to performadditionalcommunicationoptimizationby using strip miningto reduce the message lengthas shown in Figure59(d).+ b[n+l-i]do(a) originalLB = Pid*(n/2)loop+ 1US = LB + (n/2)otherPid= idoi=LB,7.4.2 Message- PidUBcallSEND(b[i]callRECEIVE (b[n+l-i]a[i]= a[i]end, 4,Oncemessagevectorizationhas beenperformed,the compilercan furtherreduce the frequencyof communicationbygroupingmessagestogetherthatsendoverlappingor adjacentdata.

The Fortran D compiler[Tseng 1993] uses RegularSections[CallahanandKennedy1988a],an arraysummarizationstrategy, to describethe arrayslice in eachmessage. When two slices being sent tothe same processoroverlapor cover contiguousrangesof the array,the associated messages are combined.otherPid), 4)+ b[n+l-i]do(b) parallelLB = Pid*(n/2)loop+ 1LIE = LB + (n/2)otherPid= 1 - PidotherLB= otherPidotherUB= otherLBcallSEND(b[LB]callRECEIVE(bdoi=LB,(n/2),(n/2)*4,[otherLB]otherPid), (n/2)*4,otherPid)= a[i]+ b[n+l-i]7.4.3 Messagedo j= LB,loopUB,withvectorizedSEND(b[j]callRECEIVE(b[otherLB+, 256*4,256*4,doi= j,a[i]endSendinga messageis generallymuchmore expensivethan performinga blockcopy locallyon a processor.Thereforeitis worthwhileto aggregatemessages being sent to the same processor even if thedatatheycontainis unrelated[Tseng1993].

A simpleaggregationstrategyisto identifyall the messagesdirectedatthe same targetprocessorand copy thevariousstrips of data into a single buffer.Thetargetprocessorperformsthereverse operation.messages256callotherPid)(j-LB)],otherPid)j+255= a[i]+ b[n+l-i]dodo(d) afterstriparrayminingmessages (assumingsize is a multipleFigure 59.Messageof 256)vectorization7.4.4 CollectiveWhen the message arrives,the iterationproceeds.Figure59(c) is a much more efficientversionthat handlesall communicationin a single messagebefore the loop begins executing.Each processorcomputesthe upper and lower bound for both itselfand for the other processorso as to placethe incomingelementsof b properly.Message-passinglibrariesand networkhardwareoftenperformpoorlywhenACMAggregationdo(c) parallelend+ 1+ (n/2)UBa[i]end*CoalescingComputmgSurveys,Vol. 26, No. 4, December1994CommunicationManyparallelarchitecturesand message-pawinglibrariesoffer e.pecial-purpose communicationprimitivessuch asbroadcast,hardwarereduction,and scatter-gather.Compilerscan improveperformanceby recognizingopportunitiestoexploitthese operations,which are oftenhighlyefficient.The idea is analogoustoidiomand reductionrecognitionon sequentialmachines.Li and Chen [1991]presentcompilertechniquesthat rely onpatternmatchingto identifyopportunities for using collectivecommunication.Compiler7.4.5 MessagePipelining7.5Anotherimportantoptimizationis topipelineparallelcomputationsby overlappingcommunicationand computation.Studieshave demonstratedthatmanyapplicationsperformvery poorlywithout pipelining[Rogers1991].

Many message-passingsystems allow the processorto continueexecutinginstructionswhilea messageis being sent. Some supportfully nonblockingsend and receive operations. In either case, the compilerhas theopportunityto arrangefor useful computation to be performedwhile the networkis deliveringmessages.A varietyof algorithmshave been developedto discoveropportunitiesforpipeliningand to move message transferoperationsso as to maximizethe amountof resultingoverlap[Rogers1991;Koelbel and Mehrotra1991; Tseng 1993].7.4.6 RedundantCommunicationEliminationTo avoidsendingmessageswhereverpossible, the compilercan performa variety of transformationsto eliminateredundantcommunication.Manyof theoptimizationscovered earliercan also beused on messages.If a message is sentwithinthe body of a loop but the datadoes not changefromone iterationtothe next, the SEND can be hoistedout ofthe loop.

When two messages containthesame data, only one need be sent.Messagesofferfurtheropportunitiesfor optimization.If the contentsof a message are subsumedby a previouscommunication,the message need not be sent;thissituationis oftencreatedwhenSENDS are hoistedin order to maximizepipeliningopportunities.If a messagecontainsdata, some of which has alreadybeen sent, the overlap can be removedtoreduce the amountof data transferred.Anotherpossibilityis that a message isbeing sent to a collectionof processors,some of whichpreviouslyreceivedthedata.

The list of recipientscan be pruned,reducingthe amountof communicationtraffic.These optimizationsare used bythe PTRANII compiler[Guptaet al.1993] to reduce overall message traffic.Transformations●401SIMD TransformationsSIMDarchitecturesexhibitmuchmoreregularbehaviorthan MIMDmachines,eliminatingmanyproblematicsynchronizationissues.

In additionto the alignmentand decompositionstrategiesfordistributed-memorysystems (see Section7.1.2), the regularityof SIMDinterconnection networksoffers additionalopportunitiesfor optimization.The compilercan use very accurate cost models to estimatethe performanceof a particularlayout.Early SIMD compilationwork targetedIVTRAN[Millsteinand Muntz1975], aFortrandialect for the Illiac IV that provided layout and alignmentdeclarations.Thecompilerprovideda parallelizingmodulecalledthe Paralyzer[Presbergand Johnson1975] thatused an earlyform of dependenceanalysisto identifyindependentloopsandappliedlineartransformationsto optimizecommunication.The ConnectionMachineConvolutionCompiler[Bromleyet al. 1991] targetsthe topologyof the SIMDarchitectureexplicitlywith a pattern-matchingstrategy.

Характеристики

Тип файла
PDF-файл
Размер
6,02 Mb
Тип материала
Высшее учебное заведение

Список файлов статьи

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6508
Авторов
на СтудИзбе
302
Средний доход
с одного платного файла
Обучение Подробнее