fdvmDDe (1158418), страница 5

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

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

DO label I1 = ...

. . .

DO label In = ...

loop-body

label CONTINUE

is translated into

[ ACROSS-block-1 ]

[ REDUCTION-block-1 ]

* creating parallel loop

ipl = crtpl(n)

[ SHADOW-RENEW-block-1 ]

[ SHADOW-START-block ]

[ SHADOW-WAIT-block ]

* mapping parallel loop (1)

it = mappl(ipl,A,...)

[ SHADOW-RENEW-block-2 ]

[ REDUCTION-block-2 ]

[ REMOTE-ACCESS-block ]

* inquiry of continuation of parallel loop execution

lab1 if(dopl(ipl) .eq. 0) go to lab2

DO label I1 = ...

. . .

DO label In = ...

loop-body

label CONTINUE

go to lab1

* terminating parallel loop

lab2 it = endpl(ipl)

[ ACROSS-block-2 ]

[ REDUCTION-block-3 ]

The function generates and inserts in procedure all the statements preceeding the DO nest. In addition, the initial, end and step value of do-variables in parallel DO-nest are changed. The statements following end statement of parallel loop:

label CONTINUE

are generated by TransFunc( ) when this statement is processing.

If compilation mode is set on debugging, the CALL statements:

call dbegpl(...)

call diter(...)

call dendl(...)

are created and inserted in block (1) before IF statement, before first statement of parallel loop body ,and after the statement

go to lab1

accordingly.

If compilation mode is set on performance analyzing, the CALL statements:

call bploop(...)

call eloop(...)

are created and inserted before the first and after the last statement of the block (1).

The following functions are called to create blocks implementing ACROSS, SHADOW_RENEW, REDUCTION, and REMOTE_ACCESS specifications:

DepList

ShadowList

doIfForReduction

ReductionList

RemoteVariableList

void ParallelLoop_Debug ( SgStatement *stmt )

stmt

- pointer to the PARALLEL directive

If compilation mode is set on debugging, the CALL statements:

call dbegpl(...)

call diter(...)

are created and inserted before the DO loop nest and before the first statement of parallel loop body accordingly. This function generates the REDUCTION-block-1 and REDUCTION-block-2 if need be.

If compilation mode is set on performance analyzing, the CALL statements:

call bploop(...)

call eloop(...)

is created and inserted before and after the DO loop nest.

void ReductionList (

SgExpression
SgExpression
SgStatement
SgStatement
SgStatement

*el,
*gref
*st
*stmt1
*stmt2 );

el

- reduction list

gref

- pointer to the reduction group reference expression

st

- pointer to the PARALLEL directive with REDUCTION clause

containing the reduction list el

stmt1

- pointer to the statement after which the new statements is inserted

stmt2

- pointer to the statement after which the new statements is inserted

Generates and inserts in procedure the statements:

* creating reduction

dvm000(irv) = crtrgf(reduction-function, red-var,…)

* including reduction in reduction group

dvm000(i) = insred(gref,dvm000(irv),…)

for each reduction in reduction list. The first statement is inserted after stmt1 and the second one after stmt2.

void ShadowList (

SgExpression
SgStatement
SgExpression

*el,
*st
*gref );

el

- renewee-list

st

- pointer to the PARALLEL directive with SHADOW_RENEW

clause or to the SHADOW_GROUP directive containing the

renewee-list el

gref

- pointer to the shadow group reference expression

Generates and inserts in procedure the statement:

* including shadow edge in the group

dvm000(i) = inssh(gref,array,...)

for each array in the renewee-list.

void RemoteVariableList (

SgSymbol
SgExpression
SgStatement

*group
*rml,
*stmt );

group

- pointer to the symbol of group

rml

- array reference list

stmt

- pointer to the PARALLEL directive with REMOTE_ACCESS

clause or to the REMOTE_ACCESS directive containing the

array reference list rml

The function generates and inserts in procedure the statements for reading remote data in buffer (REMOTE-ACCESS-block).

1) In case of synchronous REMOTE_ACCESS specification the following statements are generated:

{

* creating buffer array

it = crtrbl(array-header,buffer-header,…)

* starting load of buffer array

it = loadrb(buffer-header,0)

* waiting for completion of loading buffer array

it = waitrb(buffer-header)

* correcting coefficient CNB of buffer array elements addressing,

* where NB is rank of buffer array

buffer-header(NB+2) = buffer-header(NB+1)-

* buffer-header(NB)*buffer-header(NB+3) … -

* buffer-header(3)*buffer-header(2*NB+2)

}... for each remote-access reference

2) In case of asynchronous REMOTE_ACCESS specification (with group RMG) the following statements are generated:

IF (RMG(2) .EQ. 0) THEN

{

* creating buffer array

it = crtrbl(array-header,buffer-header,…)

* correcting coefficient CNB of buffer array elements addressing

buffer-header(NB+2) = buffer-header(NB+1)-

* buffer-header(NB)*buffer-header(NB+3) … -

* buffer-header(3)*buffer-header(2*NB+2)

* starting load of buffer array

it = loadrb(buffer-header,0)

* waiting for completion of loading buffer array

it = waitrb(buffer-header)

* including buffer array in group RMG

it = insrb(RMG(1),buffer-header)

}... for each remote-access reference

ELSE

IF (RMG(3) .EQ. 1) THEN

* waiting for completion of loading all the buffer arrays of group

it = waitbg(RMG(1))

RMG(3) = 0

ENDIF

ENDIF

5.2Translating input/output statements (module io.cpp)

The compiler module io.cpp involves the functions for translating input/output statements.

In DVM model, input, output and other operations with external files are executed by single processor ( I/O processor ), which is determined by run-time system. I/O of a replicated variable deals with variable copy allocated on I/O processor. I/O of a distributed array deals with buffer array allocated on I/O processor. Inputted data are sent to all other processors owing the variables of input list. When the distributed array is outputted, data are transferred into the buffer from other processors owing elements of the array.

int TestIOList (

SgExpression
SgStatement

*iol,
*stmt );

iol

- I/O item list

stmt

- pointer to the I/O statement

The function analyzes input/output item list. If there are not any distributed array references in the list, this function returns 1, else it returns 0.

Calls ImplicitLoopTest( ) , IOitemTest( ).

int ImplicitLoopTest(

SgExpression
SgStatement

*eim,
*stmt );

eim

- pointer to the implicit loop

stmt

- pointer to the I/O statement

The function analyzes item list of implicit loop. If there are not any distributed array references in the list, this function returns 1, else it returns 0.

int IOitemTest (

SgExpression
SgStatement

*e,
*stmt );

e

- pointer to item of I/O list

stmt

- pointer to the I/O statement

If the I/O item is not a distributed array reference this function returns 1, else it returns 0.

int IOcontrol (

SgExpression
SgExpression
int

*e,
*ioc[]
type );

e

- control information list

ioc

- array of I/O control parameters

type

- variant tag of I/O statement(PRINT_STAT, WRITE_STAT,

READ_STAT)

The function analyzes the control information list of the data transfer statement and assigns the value of control parameters (UNIT,FMT,ERR, and so on) to the elements of array ioc[]. If there are some syntax errors it returns 0, else 1.

int control_list1 (

SgExpression
SgExpression

*e,
*ioc[] );

e

- control information list

ioc

- array of I/O control parameters

The function analyzes the control information list of the BACKSPACE, REWIND and ENDFILE statement and assigns the value of control parameters (UNIT,ERR, and so on) to the elements of array ioc[]. If there are some syntax errors it returns 0, else 1.

int control_list_open (

SgExpression
SgExpression

*e,
*ioc[] );

e

- control information list

ioc

- array of I/O control parameters

The function analyzes the control information list of the OPEN, CLOSE and INQUIRE statement and assigns the value of control parameters (UNIT,ERR, and so on) to the elements of array ioc[]. If there are some syntax errors it returns 0, else 1.

void IO_ThroughBuffer(

SgSymbol
SgStatement

*ar,
*stmt );

e

- pointer to the symbol of distributed array

stmt

- pointer to the I/O statement

In case of I/O of distributed array the memory is allocated in user program for buffer I/O.

Let A(N1,N2,...,Nk) is distributed array of rank k, BUF(L) - vector of the same type as array A (named i000io if A is of type integer, or r000io if A is of type real,...).

The function replaces a statement I/O of A with the sequence of statements according to the following scheme:

s0 = L

si = [si-1 / Ni] i  {1 : k}

n = max(i)

si 0, i{0 : k}

m = 1 (if n = k)

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

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

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