FDVM_DD (1158349), страница 5

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

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

* creating distributed array

dvm000(i+1) = crtda(dvm000(j),i0000m,n,...)

. . .

* aligning distributed array

dvm000(i+2) = align(dvm000(j),dvm000(iamv),n,...)

* copying distributed arrays

dvm000(i+3) = arrcpy(array-header,...,dvm000(j),...)

4.4 Input/Output (io.cpp module)

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

*iol,

SgStatement

*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

*eim,

SgStatement

*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

*e,

SgStatement

*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

*e,

SgExpression

*ioc[],

int

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

*e,

SgExpression

*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

*e,

SgExpression

*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

*ar,

SgStatement

*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)

}

DO label In+2 = 0, Nn+2-1

. . . n+2  k

DO label Ik = 0, Nk-1

}

DO label In+1 = 0, Nn+1-1, sn

if (In+1 .LE. Nn+1) then

m = sn n+1  k

else

m = Nn+1 - In+1

endif

input:

IF(tstio( ) .eq. 0 ) READ (...) (BUF(j), j = 1, N1 * ...*Nn * m)

n  1

copying-arrray-section (BUF(1 : N1 * ...*Nl* m),

n  1

A(1: N1,...,1:Nn , In+1 +1: In+1 +m , In+2 +1, ..., Ik +1) )

n  1

n+1  k

n+2  k

output:

copying-arrray-section (BUF(1 : N1 * ...*Nl* m),

n  1

A(1: N1,...,1:Nn , In+1 +1: In+1 +m , In+2 +1, ..., Ik +1) )

n  1

n+1  k

n+2  k

IF(tstio( ) .eq. 0 ) WRITE (...) (BUF(j), j = 1, N1 * ...*Nn * m)

n  1

label CONTINUE

(An operation of copying-arrray-section is implemented by function arrcpy( ).)

4.5 Inserting new statements in parse tree (stmt.cpp module)

void

InsertNewStatementAfter

(

SgStatement

*stat,

SgStatement

*current,

SgStatement

*cp

)

stat

- pointer to the inserted statement

current

- pointer to the statement stat is inserted after

cp

- pointer to the control parent

The statement stat is inserted in the parse tree (program) after statement current and its control parent is cp.

void

InsertNewStatementBefore

(

SgStatement

*stat,

SgStatement

*current

)

stat

- pointer to the inserted statement

current

- pointer to the statement stat is inserted before

The statement stat is inserted in the parse tree (program) before statement current.

void

doAssignStmt

(

SgExpression

*re

)

re

- pointer to the expression that is the right part of the assignment

statement

Creates the assign statement with right part re :

dvm000(i) = re

and inserts it before the statement where (global variable).

SgExpression

*LeftPart_AssignStmt

(

SgExpression

*re

)

re

- pointer to the expression that is the right part of the assignment

statement

Creates the assign statement with right part re :

dvm000(i) = re

and inserts it before the statement where (global variable). The function returns left part of this statement.

void

doAssignTo

(

SgExpression

*le,

SgExpression

*re

)

le

- pointer to the expression that is the left part of the assignment

statement

re

- pointer to the expression that is the right part of the assignment

statement

Creates the assign statement:

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

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

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