cdvmDDe (1158399), страница 4

Файл №1158399 cdvmDDe (Раздаточные материалы) 4 страницаcdvmDDe (1158399) страница 42019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

DVM( REALIGN array "["dummy-var"]"...

WITH base "["align-expr"]"... ) ;

Proposed compiler output.

DVM_REALIGN(arr,base,k,i,a,b,new);

Note. The executable directive is converted to the statement.

Implementation.

The function wfREALIGN verifies an array and issues a message if

  • it is not defined;

  • it is not specified by a ALIGN directive;

  • ranks mismatch.

Other parts of the directive are verified as for ALIGN directive.

Required subtrees are built by the function wfREALIGN.

3.1.7TEMPLATE clause

Context and syntax.

DVM(DISTRIBUTE ... ; TEMPLATE [ "["size"]"... ] )

void * template-id ;

Proposed compiler output.

AMViewRef template-id;

Note. Source declaration is substituted. Distribution formats will be used in the template creation. If size is specified the creation will be implicit.

Implementation.

The function ISWFdcltr verifies (besides all) that the template-id is declared as void *, and issues a message otherwise. The function wfTEMPLATE verifies a TEMPLATE subdirective parameter and issues a message if ranks mismatch.

The function crRef(N,type) changes the type "void*" by the RTL type "AMViewRef".

3.1.8CREATE_TEMPLATE directive

Context and syntax.

DVM(CREATE_TEMPLATE template-id "["size"]"... ) ;

Proposed compiler output.

DVM_CREATE_TEMPLATE(am,t,r,di);

DVM_DISTRIBUTE(amv,ps,k,axs);

Note. The executable directive is converted to the statement.

Implementation.

The function wfLX_CRTEMP verifies the directive and issues a message if

  • the template-id is not defined;

  • it is not specified as TEMPLATE;

  • it is a "static" template (so created automatically);

  • ranks mismatch.

Required subtrees are built by the function mk_templ(amv,dims,dir).

3.2Distribution of computations (loops and tasks)

3.2.1PARALLEL directive

Context and syntax.

DVM ( PARALLEL "["loop-var"]"...

ON base "["align_expr"]"...

[ ; sub-directives]...)

loop-nest

Proposed compiler output.

{

[ dvm_create_rg ]

DVM_PARALLEL(n,r);

[ other sub-directives... ]

DVM_DO_ON((n,r,vs,ls,hs,ss,base,rb,is,as,bs);

[ dvm_reduction or dvm_reduction20 ]

{

DVM_DOPL(n)

loop-headers DVM_FOR...

{

loop-body

}

}

[ end_reduction ]

DVM_END_PARALLEL(n);

}

Implementation.

The core of the directive are verified as for ALIGN directive. The function wfDVMvar verifies the loop-var list comparing it with loop headers and issues a message if it consists of not all loop variables or contains them in other order.

Required subtrees are built by the function pLoop. It also inserts subtrees built for subdirectives into appropriate place in a paralle loop shell.

3.2.2ACROSS clause

Context and syntax.

DVM ( PARALLEL ... ; ACROSS array "["widths"]"... )

Proposed compiler output.

dvm_parallel ... sub_directives

DVM_ACROSS(loopid, (

DVM_ACROSS_SH(a,k,ls,hs,corner) // for each renewee

...

))

{ dvm_dopl

loop-headers...

loop-body

}

DVM_END_ACROSS()

[ end_reduction ]

dvm_end_parallel

Implementation.

The function wfDVMshw() verifies shadow edge width list and issues a message if:

  • ranks mismatch;

  • declared (or default) maximal edge width is exceeded.

The function wfDVMshad() verifies renewee and issues a message if CORNER is used for 1-D array (warning).

Required subtrees are built by the function wfACROSS. Final tree building is performed by the function Ploop, after the loop is entirely parsed. It inserts early created subtree into appropriate point of a parallel loop shell.

3.2.3PROCESSORS directive and NUMBER_OF_PROCESSORS() function

Context and syntax.

DVM(PROCESSORS "["dim"]"...) void * proc_id ;

Proposed compiler output.

PSRef proc_id;

...

DVM_PROCESSORS(Iproc_id),r,dims);

Note. Source declaration is substituted. The macro is generated not at the point of declaration, but in a sequence of implicit actions.

Implementation.

The function ISWFdcltr verifies (besides all) that the proc-id is declared as void *, and issues a message otherwise. The function ISWFdclr also builds a tree for the macro DVM_PROCESSORS and keeps it using function addIMloc in temporary local or global list. Statements will be inserted in appropriate place by functions genIMglob or genIMloc.

The function crRef(N,type) changes the type "void*" by the RTL type "PSRef".

3.2.4TASK directive

Context and syntax.

DVM(TASK) void * task-id "["size"]"

Proposed compiler output.

AMViewRef AMV_task-id;

PSRef task-id [ size ]={0};

...

DVM_TASK(task-id,n);

Note. Source declaration is substituted. The macro is generated not at the point of declaration, but in a sequence of implicit actions.

Implementation.

The function ISWFdcltr verifies (besides all) that the task-id is declared as void *, and issues a message otherwise. The function ISWFdclr also builds a tree for the macro DVM_TASK and keeps it using function addIMloc in temporary local or global list. Statements will be inserted in appropriate place by functions genIMglob or genIMloc.

The function crRef(N,type) changes the type "void*" by the RTL type "PSRef" and creates a declaration of AM-representation variable AMV_.... The function crAMVdcltrs(N) creates a declarator for it.

3.2.5MAP directive

Context and syntax.

DVM(MAP task-id"["task_ind"]" ONTO proc-section );

Proposed compiler output.

DVM_MAP(task,ind, [ DVM_ONTO(ps,k,ls,hs) ]) ;

Note. The executable directive is converted to the statement.

Implementation.

Required subtrees are built by the function wfMAP, using the tree built for the ONTO clause.

3.2.6TASK_REGION directive

Context and syntax.

DVM(TASK_REGION task-id)

{

ON-block... | ON-loop

}

Proposed compiler output.

{DVM_TASKREGION(no,task);

...

}

Implementation.

The function wfTASKREGION verifies compound statement. All their statements must be an ON-blocks or it should consist of single statement - ON-loop. Then the function builds required subtree including statements for a REDUCTION sub-directive, and for the debugger (-dx option).

3.2.7ON-block construct

Context and syntax.

DVM(ON task-id "["task-ind"]")

{ C-statements }

Proposed compiler output.

if(DVM_RUN(task,ind))

{ statements

DVM_STOP();

}

Implementation.

The function wfLXItask verifies task-id and issues a message if it is not defined or not specified as a TASK.

Required subtrees are built by the function mkRUNAM().

3.2.8ON-loop construct

Context and syntax.

DVM(PARALLEL "["var"]" ON task-id "["var"]")

DO(var, ..., ..., ...)

{ C-statements }

Proposed compiler output.

for(var=0; ...)

if(DVM_RUN(task,var))

{ statements

DVM_STOP();

}

Implementation.

The function wfLXItask verifies task-id and issues a message if it is not defined or not specified as a TASK.

Required subtrees are built by the function mkRUNAM().

3.3Shadow edges

3.3.1SHADOW clause

Context and syntax.

DVM( DISTRIBUTE | ALIGN ...

; SHADOW "["widths"]"... )

Note. Nothing is generated at this point. Compiler keeps provided widths as the maximal ones. They will be used at array creation.

Implementation.

The function wfSHADOW verifies the width list and issues a message if ranks mismatch.

3.3.2SHADOW_RENEW clause

Context and syntax.

DVM(PARALLEL ... ; SHADOW_RENEW renewee... ... )

renewee ::= array [ "["widhs"]"... ] [ CORNER ]

Proposed compiler output.

DVM_SHADOW_RENEW(loop-number,

(DVM_SHADOWS(a,k,ls,hs,corner), // for each renewee

...

))

Note. It is shorthand for the sequence "CREATE_SHADOW_GROUP; SHADOW_START; SHADOW_WAIT;" with temporary shadow edge group, performed before the loop.

Implementation.

The function wfDVMshw() verifies shadow edge width list and issues a message if:

  • ranks mismatch;

  • declared (or default) maximum width is exceeded.

The function wfDVMshad() verifies renewee and issues a message if CORNER is used for 1-D array (warning).

Required subtrees are built by the function wfSHRENEW. Final tree building is performed by the function Ploop, after the loop is entirely parsed. It inserts early created subtree into appropriate point of a parallel loop shell.

3.3.3SHADOW_GROUP directive

Context and syntax.

DVM(SHADOW_GROUP) void * sh-group-id;

Proposed compiler output.

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

Список файлов учебной работы

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