cdvmPDe (1158403), страница 3

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

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

if(rg==0) rg=crtrg_(1,1);

(void)rvs;

Macro DVM_REDUCTION(loopid,rvs) is expanded to

{ RedGroupRef DVM_RG;

LoopRef DVM_LP0=0;

PSSpaceRef DVM_PSSpace=DVM_LP##loopid;

DVM_RG=crtrg_(1, 1);

(void)rvs;

DVM_INSERT_RV();

Macro DVM_REDUCTION20(loopid, rg) is expanded to

{ RedGroupRef DVM_RG=rg;

LoopRef DVM_LP0=0;

PSSpaceRef DVM_PSSpace=DVM_LP##loopid;

DVM_INSERT_RV();

rg=DVM_RG;}

Macro DVM_INSERT_RV() is expanded to

while(CDVM_TOP!=CDVM_BOTTOM) {

insred_( &DVM_RG, (RedRef*)CDVM_TOP, &DVM_PSSpace, 1);

}

Macro DVM_END_REDUCTION() is expanded to

{strtrd_(&DVM_RG);

waitrd_(&DVM_RG);

delrg_(&DVM_RG);}

}

3.5.3Reduction variables and operations

Context and syntax.

DVM(...; REDUCTION ... MAX(red-var) ... )

DVM(...; REDUCTION ... MIN(red-var) ... )

DVM(...; REDUCTION ... SUM(red-var) ... )

DVM(...; REDUCTION ... PROD(red-var) ... )

DVM(...; REDUCTION ... AND(red-var) ... )

DVM(...; REDUCTION ... OR(red-var) ... )

DVM(...; REDUCTION ... MAXLOC(red-var,loc-var) ... )

DVM(...; REDUCTION ... MINLOC(red-var,loc-var) ... )

Proposed compiler output.

DVM_RVAR(rf_MAX,var,t,l)

DVM_RVAR(rf_MIN,var,t,l)

DVM_RVAR(rf_SUM,var,t,l)

DVM_RVAR(rf_PROD,var,t,l)

DVM_RVAR(rf_AND,var,t,l)

DVM_RVAR(rf_OR,var,t,l)

DVM_RLOC(rf_MAX,var,t,l,loc-var)

DVM_RLOC(rf_MIN,var,t,l,loc-var)

Note. The parameter t is a code of type of variable (rt_INT, rt_LONG, rt_FLOAT, rt_DOUBLE). Parameter l is the number of elements in red-var (if it is an array) or 1. Macro DVM_RVAR(f,v,t,l) is expanded to

crtred_(f, &(v), t, l, 0, 0, 1)

Macro DVM_RLOC(f,v,t,l,loc) is expanded to

crtred_(f, &(v), t, l, &(loc), sizeof(loc), 1)

3.5.4REDUCTION_START directive

Context and syntax.

DVM(REDUCTION_START red-group-id);

Proposed compiler output.

DVM_REDUCTION_START(red-group-id);

Note. The executable directive is converted to a statement. Macro DVM_REDUCTION_START(rg) is expanded to

strtrd_((RedGroupRef*) &rg)

3.5.5REDUCTION_WAIT directive

Context and syntax.

DVM(REDUCTION_WAIT red-group-id);

Proposed compiler output.

DVM_REDUCTION_WAIT(red-group-id);

Note. The executable directive is converted to a statement. Macro DVM_REDUCTION_WAIT(rg) is expanded to

waitrd_((RedGroupRef*) &rg);

delrg_((RedGroupRef*) &rg);

rg=0;

3.6Implicit constructions

3.6.1Creation and deletion of distributed arrays

Context and syntax.

array = malloc(dim1 *...* dimr * elem-size);

free( array );

Proposed compiler output. It includes all or part of the following statements depending on array declaration.

[ DVM_CREATE_TEMPLATE(am,t,r,di); // implicit template ]

[ DVM_ONTO(ps,k,ls,hs); // target system ]

[ DVM_DISTRIBUTE(amv,ps,k,axs); // distribute template ]

[ DVM_GENBLOCK(am,ps,k,gbs); // GENBLOCK parameters ]

DVM_MALLOC(arr,r,len,dim,lw,hw,redis) // initialize array handler

[ DVM_ALIGN(arr,base,k,i,a,b) // align with template ]

Note. Macro Macro DVM_MALLOC(arr,r,len,dim,lw,hw,redis) is expanded to

{crtda_( arr, 0, NULL, r, len, dim, 0, redis, lw, hw );

}

Macro DVM_ALIGN(arr,base,k,i,a,b) is expanded to

{align_( arr, &(base), i, a, b);

}

Macro DVM_FREE(arr) is expanded to

(delda_(arr));

3.6.2Static distributed arrays

Context and syntax.

DVM(DISTRIBUTE | ALIGN...)

element-type array-id "["const-dim"]"...;

Proposed compiler output. Standard array creation sequence as for malloc.

Note. For global declarations implicit malloc is inserted at the beginning of the main function. For local declarations it is inserted before the first statement of the block.

3.6.3References to distributed data

Context and syntax. Ordinary references to array elements array[ind1]...[indr] with distributed array. Special form array(ind1,...,indr) is allowed for macro simulation of dynamic arrays.

Proposed compiler output.

DAElm<r>(type,array-id,ind1,...indr)

Note. These are macros of RTL.

3.6.4Own computation references

Context and syntax. references

lhs=rhs; // assignment

Proposed compiler output.

if(DVM_ISLOCAL(lhs)) {

lhs = rhs ; }

DVM_ENDLOCAL();

Note. Own computation statement is an assignment to a distributed array in a non distributed branch of program. It should be guarded by the test of locality. Macro DVM_ISLOCAL(a,r,ind) is expanded to

tstelm_(a, ind)

Macro DVM_ENDLOCAL() is expanded to

dskpbl_()

3.6.5Initializing and finalizing of program execution

Context and syntax.

int main( int argc, char ** arg)

{

declarations...

first-statement

...

[ exit(rc); ]

...

return rc;

}

Proposed compiler output.

int main( int argn, char ** args)

{

declarations...

DVM_INIT(0,argn,args); // initialization of RTL

[ implicit static array creation ]

[ tracing of initialized variables ]

[ other implicit actions ]

first-statement

...

[ DVM_EXIT(rc); ] // exit through RTL

...

DVM_RETURN(rc); // exit through RTL

}

Note. For correct generation the main function must get a command-line parameters (which will be passed to RTL) and must have return or exit statement. Macro DVM_INIT(argn,args) is expanded to

{rtl_init(0L,argn,args);

}

Macro DVM_RETURN(r) is expanded to

{lexit_(r);}

Macro DVM_EXIT(r) is expanded to

{lexit_(r);}

3.6.6Input-output functions

Compilation of input-output functions is reduced to renaming of iofun to its RTL analog dvm_iofun. The only exception is fread() and fwrite() functions, when they are applied to a distributed array. In this case the array is read or written as a whole, i.e. size parameter of the function is ignored.

3.7Debugging extensions

3.7.1Performance analyzer. Loops

Context and syntax.

[ DVM(PARALLEL... ) ]

DO(var,first,last,step) // or

FOR(var,times)

loop-body

Proposed compiler output.

BPLOOP(n) // for parallel loop or

BSLOOP(n) // for sequential loop

code for loop

ELOOP(n)

Note. The argument n is a serial number of the loop used to identify paired commands. The set of loops for which the macros are generated depends on a command-line options (-e1...-e4). Macro DVM_BPLOOP(n) is expanded to

bploop_(n);

Macro DVM_BSLOOP(n) is expanded to

bsloop_(n);

Macro DVM_ELOOP(n) is expanded to

eloop_(n, line);

3.7.2Performance analyzer. INTERVAL directive

Context and syntax.

DVM(INTERVAL [ int-expr ] )

{ C-statements }

Proposed compiler output.

DVM_BINTER(n,v)

{ code for statements }

DVM_EINTER(n)

Note. The argument n is a serial number of the loop used to identify paired commands. If int-expr does not present, the argument v has some standard value. Macro DVM_BINTER(n,v) is expanded to

binter_(n, v)

Macro DVM_EINTER(n) is expanded to

einter_(n,line )

3.7.3Debugger. Data tracing

Context and syntax. Any reference to ordinary or distributed variable var in C-statements or variable initialization.

Proposed compiler output.

DVM_STVA(type,rt,var,base,rhs) // lh-side of assignment

DVM_LDV(type,rt,var,base) // for read access

DVM_STV(type,rt,var,base) // to register initialization

Note. The set of references, the macros are generated for, depends on a command-line options (-d1...-d4). Macro DVM_LDV(type,rt,var,base) is expanded to

*(type*) ( ( DVM2A((long)&(var),rt) &&

dldv_(&CDVM_TOP[1],

(AddrType *)&CDVM_TOP[0],

(long *) base, #var, -1) && 0) ? 0 :

)

Macro DVM_STV(type,rt,var,base) is expanded to

( DVM2A((long)&(var), rt),

dprstv_(&CDVM_TOP[1], (AddrType *)&CDVM_TOP[0],

(long *) base, #var, -1),

dstv_())

Macro DVM_STVA(type,rt,var,base,rhs) is expanded to

( DVM2A((long)&(var), rt),

dprstv_(&CDVM_TOP[1], (AddrType *)&CDVM_TOP[0],

(long *) base, #var, -1),

(*(type *)(CDVM_TOP[0]) = rhs),

dstv_())

Such an awful construction arised as a result of porting to MS Visual-C 5.0. -- Unusual order of calculation of comma-expression.

3.7.4Debugger. Computation tracing

Context and syntax. Any loop or task region construct.

Proposed compiler output.

parallel loop creation

DVM_PLOOP(n,r,ls,hs,ss) // or DVM_SLOOP(n)

loop-headers

DVM_ITER(r,vars)

code for loop body

DVM_ENDLOOP(n)

for loop or

DVM_BTASK(n) // in TASK_REGION header

...

DVM_ETASK(n)

ON-block or ON-loop body

...

DVM_NTASK(ind) // end of TASK_REGION construct

for task region.

Note. Macro DVM_PLOOP(n,r,ls,hs,ss) is expanded to

dbegpl_(r, n, ls, hs, ss);

Parameters are the same as for loop creation. Macro DVM_SLOOP(n) is expanded to

dbegsl_(n);

Macro DVM_ENDLOOP(n) is expanded to

dendl_(n, line);

Macro DVM_ITER(r,vars) is expanded to

diter_(vars, NULL );

Macro DVM_BTASK(n) is expanded to

dbegtr_(n);

Macro DVM_ETASK(n) is expanded to

dendl_(n, );

Macro DVM_NTASK(ind) is expanded to

diter_(ind, 0);

3.7.5Sequential code

Generation of sequential code is set by the command-line option -s. All DVM-directives ignored except for the following:

  • parallel loops and tasks;

  • reduction groups have to be created for the tracer work properly;

  • distribution directives are used to distinguish ordinarily from distributed data for selective tracing.

Note that preprocessor statements #define should be kept in place unlike the parallel code from which they moved to the beginning if the file.

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

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

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