FDVM2 (1158347), страница 9

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

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

SUBROUTINE SUB2

CDVM$ DISTRIBUTE B2 ( BLOCK, BLOCK )

COMMON /COM1/ X, Y(12), B2(12,30)

Declaration in subroutine. The error is another configuration of the array.

SUBROUTINE SUB3

CDVM$ DISTRIBUTE B3 ( *, BLOCK )

COMMON /COM1/ X, Y, B(30,12)

Declaration in subroutine. There is no errors.

SUBROUTINE SUB4

CDVM$ DISTRIBUTE B4 ( *, BLOCK )

COMMON /COM1/ X, Y, B(12,30)

9.Procedures

  1. Procedure call inside distributed loop.

A procedure, called inside distributed loop, must not have side effects and contains processor exchanges (purest procedure). As a consequence, the purest procedure doesn't contain:

  • input/output statements;

  • FDVM directives;

  • assignment of values of COMMON block variables.

  1. Procedure call outside distributed loop.

If the actual argument is explicitly mapped array (distributed by DISTRIBUTE or ALIGN), it should be passed without shape changing. It means, that actual argument is the reference to the array beginning, and configurations of actual and corresponding formal arguments are the same.

  1. Formal arguments.

If the actual argument is a distributed array, then corresponding formal argument must have explicit or inherited distribution.

Explicit distribution is described by DISTRIBUTE and ALIGN directives with the following restriction: a formal argument can be aligned only with other formal argument. The explicit distribution of formal argument means, that before the procedure call a user must provide actual argument distribution in exact correspondence with formal argument distribution.

Inherited distribution is described by the directive

inherit-directive

is INHERIT dummy-array-name-list

Inherited distribution means that formal argument inherits a distribution of actual argument for each procedure call. Inherited distribution doesn't require from a user to distribute actual argument in correspondence with the formal argument.

REDISTRIBUTE and REALIGN directives can be applied to formal arguments, if actual and formal arguments have DYNAMIC attribute.

  1. Local arrays.

In the procedure local arrays can be distributed by DISTRIBUTE and ALIGN directives. A local array can be aligned with formal argument. The DISTRIBUTE directive distributes the local array on the processor subsystem, on which the procedure was called (current subsystem). If a processor arrangement section is specified in DISTRIBUTE directive, then the number of the processors must be equal to the number of processors of the current subsystem. The number of current subsystem processors is defined by intrinsic function ACTIVE_NUM_PROC( ).

The special case is distributed local array with SAVE attribute. The following conditions must be satisfied for the array:

  • DISTRIBUTE and ALIGN directives have the identical parameters in each procedure call.

  • The array cannot be used in REDISTRIBUTE and REALIGN directives.

Example 9.1. Distribution of the local arrays and formal arguments.

SUBROUTINE DIST( A, B, C, N )

CHPF$ PROCESSORS PA ( ACTIVE_NUM_PROC( ) )

DIMENSION A(N,N), B(N,N), C(N,N), X(N,N), Y(N,N)

C explicit distribution of formal argument

CDVM$ DISTRIBUTE A ( *, BLOCK )

C aligned formal argument

CDVM$ ALIGN B( I, J ) WITH A( I, J )

C inherited distribution of the formal argument

CDVM$ INHERIT C

C aligning local array with formal argument

CDVM$ ALIGN X( I, J ) WITH C( I, J )

C distribution of the local array

CDVM$ DISTRIBUTE Y ( *, BLOCK ) ONTO PA

. . .

END

10. Input/Output

The statements of standard Fortran77 are used for data input/output in FDVM.

FDVM allows only restricted form of input/output statements for distributed arrays:

  • An input/output list may contain only one name of distributed array and may not contain other input/output items.

  • Only «*» format specifier may be used in formatted I/O statement.

  • A control information list may not contain ERR, END and IOSTAT specifiers.

  • Any variable specified in a control information list must be replicated variable.

The statements of distributed array input/output cannot be used in distributed loop and in task region.

Input/output statements for replicated variables have the following restrictions:

  • A control information list may not contain ERR and END specifiers.

  • Only the following simplified form of the implicit loop is allowed

(A(i1,i2,...,I), I = n1,n2)

when inputting replicated assumed-size array.

Input statement, INQUIRE statement, and any other input/output statement with controlled parameter IOSTAT may not be used in a distributed loop.

Note that FDVM program performing unformatted I/O of distributed arrays is not compatible with serial Fortran 77 program in common case. Data written by one program may not be read by the other one because of difference in record length.

References

  1. N.A.Konovalov, V.A.Krukov, S.N.Mihailov and A.A.Pogrebtsov, «Fortran-DVM language for portable parallel programs development», Proceedings of Software For Multiprocessors & Supercomputers: Theory, Practice, Experience (SMS-TPE 94),Inst. for System Programming RAS, Moscow, Sept. 1994.

  2. ANSI X3.9-1978 Programming Language Fortran. New York 1978.

  3. High Performance Fortran Forum. High Performance Fortran Language Specification. Version 2.0, January 31, 1997.

  4. Y.Hu, S.L.Johnsson, S.-H.Teng. High Performance Fortran for Highly Irregular Problems. CACM, v.32, N.7, 1997, pp.13-24.

Annex 1. Syntax

2.4. Syntax of FDVM Directives

directive-line

is CHPF$ hpf-directive

or *HPF$ hpf-directive

or CDVM$ dvm-directive

or *DVM$ dvm-directive

dvm-directive

is specification-directive

or executable-directive

specification-directive

is processors-directive

or align-directive

or distribute-directive

or template-directive

or pointer-directive

or shadow-directive

or dynamic-directive

or inherit-directive

or remote-group-directive

or indirect-group-directive

executable-directive

is realign-directive

or redistribute-directive

or parallel-directive

or remote-access-directive

or indirect-access-directive

or shadow-group-directive

or shadow-start-directive

or shadow-wait-directive

or reduction-group-directive

or reduction-start-directive

or reduction-wait-directive

or own-directive

or prefetch-directive

or reset-directive

or task-directive

or map-directive

or task-region-directive

or end-task-region-directive

or on-directive

or end-on-directive

Constraints:

  • A directive-line follows the rules of fixed form comment lines.

  • A specification-directive may appear only where a specification statement may appear.

  • An executable-directive may appear only where executable statement may appear.

  • Any expression, included in specification directive, must be the specification expression.

3. Virtual Processor Arrangements. PROCESSORS Directive

processors-directive

is PROCESSORS processors-decl-list

processors-decl

is processors-name [ ( explicit-shape-spec-list ) ]

4.1. DISTRIBUTE and REDISTRIBUTE Directives

distribute-directive

is dist-action distributee dist-directive-stuff

or dist-action [ dist-directive-stuff ] :: distributee-list

dist-action

is DISTRIBUTE

or REDISTRIBUTE

dist-directive-stuff

is dist-format-list [ dist-onto-clause ]

[, NEW_VALUE [( dist-array-name-list)] ]

distributee

is array-name

or pointer-name

dist-format

is BLOCK

or GEN_BLOCK ( block-array-name )

or *

dist-onto-clause

is ONTO dist-target

dist-target

is processors-name [( section-subscript-list )]

or task-name ( task-index )

Constraints:

  • A length of list dist-format-list must be equal to the array rank. That is, distribution format must be specified for every dimension.

  • A number of distributed dimensions of the array (format is not specified as *) has to be equal to the number of dimensions of dist-target.

  • The array block-array-name in GEN_BLOCK specification must be one-dimensional integer array, with size equal to the size of corresponding dimension of processor arrangement, and a sum of its element values is equal to the size of distributed dimension.

  • NEW_VALUE specification can not be used in DISTRIBUTE directive.

  • dist-format-list can be omitted in DISTRIBUTE directive only. In that case distributed array can be used after REDISTRIBUTE directive only.

dynamic-directive

is DYNAMIC dist-array-name-list

4.2.2. Dynamic Arrays in FDVM Model. POINTER Directive

pointer-directive

is type , POINTER ( dimension-list ) :: pointer-name-list

dimension

is :

pointer-name

is scalar-int-variable-name

or int-array-name

Constraints:

  • Only value of function ALLOCATE or a value of other variable with attribute POINTER can be assigned to the variable with POINTER attribute.

  • A number of dimensions in left and right sides of the statement assigning value to the variable with POINTER attribute must be the same.

4.3.1. ALIGN and REALIGN Directives

align-directive

is align-action alignee align-directive-stuff

or align-action [ align-directive-stuff ] :: alignee‑list

align-action

is ALIGN

or REALIGN

align-directive-stuff

is ( align-source-list ) align-with-clause

[, NEW_VALUE [( dist-array-name-list)] ]

alignee

is array-name

or pointer-name

align-source

is *

or align-dummy

align-dummy

is scalar-int-variable

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

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

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