CDVM_DD (1158341), страница 2

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

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

Check rank.

Node LX_TEMPL

"Static" template. Compare ranks of DISTRIBUTE-stuff and TEMPLATE-extents.

Nodes LX_SUM, LX_PROD, LX_MAX, LX_MIN, LX_OR, LX_AND, LX_MAXLOC, LX_MINLOC

Modify the name of function to the corresponding Lib-DVM's name. (Function ISWFrf.) Issue an error message if:

  • actual parameter is not identifier or indexed identifier,

  • reduction variable was not defined,

  • location variables undefined,

  • reduction variable has type other than int, long, float or double; simple or array.

Node XXdecl

Save declaration of formal parameters of "main" to pass them to Lib-DVM. (Function getarg.)

Node XXdcltr

Register new object in the current visibility scope. Check that:

  • distributed data are of type int, long, float or double, and not scalar;

  • DVM-pointers are declared as C pointers;

  • arrays of DVM-arrays are 1-dimentional;

  • other DVM-objects are defined as 'void *';

  • ranks of directive and declaration match;

Remember "static" DVM-array. (Function SAadd.)

(Function ISWFdcltr.)

Nodes LXfun, LXfunKR

It may be "A(i,j)", i.e. reference to dynamic DVM-array by means of macro A. So convert it to an indexed expression. (Function ISdinarr.)

Node XXexpr

If it is "<a>=malloc(..)" with distributed <a>, then check syntax of malloc's parameter. (Functions ISmalloc and ISWFmalloc.) Issues an error message if:

  • argument is not a product of dimensions and size of element: d1*...dn*sizeof(...);

  • number of dimensions does not match with rank of array.

Node LXIrg

Check whether it is declared as REDUCTION_GROUP. (Function ISWFrg.)

Node DVMbase

(Function ISWFbase.) Issue an error message if:

  • base is not defined,

  • base is not DVM-array,

  • base is more then identifier,

  • base in CREATE_TEMPLATE is not template, or is "static" template,

  • base in shadow group is template, or is already included into this group.

Node DVMvar

Variables if parallel loop nest are correct. (Function ISWFdvar.) Issues an error message if:

  • variable in loop header is not mentioned in PARALLEL directive,

  • order of variables violated,

  • loop nest is too deep.

Note. For all variables of PARALLEL directive were used it is sufficient that depth of the loop nest is correct.

Node DVMind

This is ALIGN or PARALLEL variables list. They can not duplicate in list. For PARALLEL they must present and should be declared and visible int or long variable. (Function ISWFind.)

Node DVMbind

That is align expression. Should be linear expression of align any variable. Every variable may be used at most once. (Function ISWFbind.)

Node DVMalign

Check rank. (Function ISWFalign.)

Node LXIsg

Check whether it is declared as SHADOW_GROUP. (Function ISWFsg)

Node DVMshw

Verify shadow width list. (Function ISWFshw.) Issue an error message if:

  • rank does not match,

  • width value exceeds declared or default maximum.

Node DVMshad

Verify shadows. (Function ISWFshad.) Issue an error message if:

  • rank does not match,

  • (warning for) useless CORNER for 1-dim array.

Node DVMremote

Check REMOTE_ACCESS patterns in directive: arrays must be declared and distributed and rank should match.

3.2 Transformation concerning "main"

Purpose.

Define whether "main" present in the current file. If so, save its formal parameters, convert operator return, mark first operator of "main". Collect list of global and local initializations (for data tracing).

3.2.1 Downward direction actions (mMAIN0)

Node ASS

If in declaration, so it is initializer. Add to local or global list for tracing of initialized variables. (Function DTadd.)

Node XXdecl

If it is declaration of "main", note it.

Node XXlist

Before the first operator of "main" insert

  • DVM_INIT macro,

  • allocation of "static" DVM-arrays (function cSAalloc),

  • STV macro for initialized globals (function cDTinit).

For other functions if necessary create

  • STV macro of initialized locals. (Function cDTinit.)

3.2.2 Upward direction actions (mMAIN1)

Node RETURN

In "main" convert it to DVM_RETURN macro.

Node XXdecl

After completion of declaration of "main" check whether DVM_RETURN was generated.

Node XXexpr

If it is "p=malloc();" for distributed array p, convert this expression to calls to Lib-DVM. (Function mk_alloc.) Convert malloc for DVM-array to the following sequence declarations and operators (depending on declaration of array). If array is DISTRIBUTEd:

  • define implicit template (AMViewRef DVM_AM;),

  • create it (see function mk_templ)

Then and if array is ALIGNed:

  • DVM_MALLOC(id,rank,elemsize,dims,lshws,hshws,redistr),

  • DVM_ALIGN(id,AM,rank,i-s,a-s,b-s).

3.3 "IS_LOCAL" transformation

Purpose.

Provide access to distributed data in non-parallel branch with checking of data locality.

Node XXoper

If it is assignment operator not in parallel branch and target or assignment is an element of DVM-array than enclose it by the following construct:

{

if (DVM_IS_LOCAL(id,rank,inds,,,))

{

<operator>;

}

DVM_END_LOCAL();

}

(Function mk_local;)

3.4 Access transformation

Purpose.

Access to elements of distributed arrays should be done through array's DVM-handler by means of macro.

As separate pass in upward direction (mACC1).

Node LBK

Access to DVM-arrays should be converted to access through DVM- handler (Lib-DVM macros DAElm<n>), taking into account

-- command line option -d (i.e. data tracing -- use macros DVM_LDV and DVM_STV);

-- possible presence of REMOTE_ACCESS directive (redirect access to remote-access buffer). (Function mk_access.)

Node LXfun

In fact it may be "A(i,j)", i.e. reference to dynamic DVM-array by means of macro A. So it also should be converted. (Function DTdinarr.)

3.5 DVM-directive transformation

Purpose.

Convert non-declarative DVM-directives to appropriate sequence of operators and macros.

In downward direction (mDVM).

Node LX_REDISTR

Create DVM_REDISTRIBUTE macro.

Node LX_REALIGN

Create DVM_REALIGN macro. (Function getInds forms list of dummy variables and align expressions. Function mk_vab forms list of numbers of dummy variables, coefficients and constants if align expressions.)

Node LX_CRTEMP

Convert CREATE_TEMPLATE directive to sequence of macros

DVM_CREATE_TEMPLATE(id,rank,dims...)

DVM_DISTRIBUTE(id,rank,distr-mode...)

(Function mk_templ.) Uses distribution from declaration.

Node LX_PAR

Create operators for parallel loop:

[remote_access environment if necessary]

[DVM_REDUCTION(...)] -- for REDUCTION sub-directive

{

DVM_PARALLEL(loopid, looprank); // define loop handler

[other sub-directives make

DVM_PAR_SHADOW_START(shadow_group)

DVM_PAR_SHADOW_WAIT(shadow_group)

DVM_SHADOW_RENEW(...)

]

DVM_DO_ON(loopid, rank, headers information,

base, loop mapping information);

<DVM_FORs and body created by function cPARbody>

DVM_END_PARALLEL(loopid);

}

[DVM_END_REDUCTION(...)] if necessary

(Function cPARloop.)

Node LX_CRSG

Create DVM_CREATE_SHADOW_GROUP macro.

Node LX_SS

Create DVM_SHADOW_START macro.

Node LX_SW

Create DVM_SHADOW_WAIT macro.

Node LX_CRRG

Create DVM_CREATE_REDUCTION_GROUP macro.

Node LX_RS

Create DVM_REDUCTION_START macro.

Node LX_RW

Create DVM_REDUCTION_WAIT macro.

Node LX_REGION

Create DVM_BINTER and DVM_EINTER macros before and after operator.

Node LX_REMOTE

See function mk_remote.

Node LXfun

If necessary convert free() to DVM_FREE.

3.6 Data tracing transformation

Purpose.

Change references to variables and array elements by macros STV, STVA and LDV to trace access to data. Insert tracing or loop iterations.

Note that generated code contains the same identifier, so downward application of this transformation leads to infinite recursion.

Upward direction actions (mDT)

Nodes LXI, LBK

Depending on type of object and mode of tracing (-d option) create macro. (Function cDT2.)

Node ASS

Create trace macro for assignment. (Function stv2stva.)

Nodes LX_FOR, LX_DO

Create loop iteration trace macro. (Function cSEQloop.) Trace sequential loop (if necessary), i.e. insert macros:

DVM_BSLOOP, DVM_ELOOP for performance analyzer,

DVM_SLOOP, DVM_ITER, DVM_ENDLOOP for data tracer.

DVM_ITER macro into a sequential loop.

3.7 DVM-types and I/O transformation

Purpose. Change types of DVM-objects and rename I/O functions.

This actions may be performed in any direction. Note that in other transformations an initial type of object should be known. So the type may be changed only after all other is done.

Node LX_DISTR

Change type to handler type, i.e. long [rank+1]. (Function cSYSHr). For template type (void*) should be changed to AMRef. (Function cSYSH.)

Node LX_ALIGN

Change type to handler type, i.e. long [rank+1]. (Function cSYSHr).

Node LX_SG

Change void* to ShadowGroupRef. (Function cSYSH.)

Node LX_RG

Change void* to RedGroupRef. (Function cSYSH.)

Node LXI

Find in the list and returns initial or changed code. (Function Rename.) Renaming list is prepared by the function Reninit. Now it contains the following identifiers:

exit DVM_EXIT

FILE DVMFILE

clearerr dvm_clearerr

fclose dvm_fclose

feof dvm_feof

ferror dvm_ferror

fflush dvm_fflush

fgetc dvm_fgetc

fgetpos dvm_fgetpos

fgets dvm_fgets

fopen dvm_fopen

fprintf dvm_void_fprintf

fputc dvm_fputc

fputs dvm_fputs

fread dvm_fread

freopen dvm_freopen

fscanf dvm_fscanf

fseek dvm_fseek

fsetpos dvm_fsetpos

ftell dvm_ftell

fwrite dvm_fwrite

getc dvm_getc

getchar dvm_getchar

gets dvm_gets

printf dvm_void_printf

putc dvm_putc

putchar dvm_putchar

puts dvm_puts

rewind dvm_rewind

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

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

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