LIBDVM2 (1158351), страница 6

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

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

Using the distributed array as a pattern is allowed only if this array has already been mapped on an abstract machine representation. Moreover, using an abstract machine representation as a pattern is allowed only if this representation has been mapped on a processor system. So the function align_ only distributes elements of the aligned distributed array among processors from this processor system.

Consider distributed array alignment in detail. Let F be a multifunctional with the domain of definition in a space of indexes of the aligned array and with the image in the space of indexes of the pattern:

F((I1, ... ,Ii, ... ,In) ) =

F1(I1, ... ,Ii, ... ,In) x
. . . . . . . . . . . . . . . . .
F
j(I1, ... ,Ii, ... ,In) x
. . . . . . . . . . . . . . . . .
F
m(I1, ... ,Ii, ... ,In)

where:

x

- is a symbol of the Cartesian product;

n

- rank of the distributed array;

m

- rank of the pattern;

Ii

- index variable of the i-th dimension of the aligned array;

Fj

- multifunction, which range of value is a range of index variable of pattern j-th dimension.

An alignment of the distributed array with the pattern is a defining the F multifunction. This defining designates that an element (I1, ... ,In) of an aligned array has to be located on the processor if and only if some pattern elements from F((I1, ... ,In)) set are mapped on this processor. The set F((I1, ... ,In)) is an image-set, and components of this set are vectors of space of indexes of the pattern.

The F1, ... , Fm functions are named «coordinate alignment rules». Run-Time Library provides the following set of alignment rules:

1. Fj(I1, ... ,In) = {Aj * Ik + Bj} , where:

k=f(j)

- dimension number of an aligned array (1 k n, f(j1) # f(j2) when j1 # j2);

Aj

- integer;

Bj

- nonnegative integer.

This alignment rule means that for each element (I1,…, In) of index space of the aligned array the corresponding image-set contains one element – Aj*Ik+Bj. This element belongs to the value range of the index variable of the pattern j-th dimension.

Note, that Aj and Bj have to meet the following requirements:

0  Bj  MAXj; and 0  Aj *MAXk + Bj  MAXj , where:

MAXj

- maximum of the index variable of the j-th dimension;

MAXk

- maximum of the index variable of the aligned array k-th dimension.

2. Fj(I1, ... ,In) = {q Mj: 0 q MAXj} , where:

Mj

- range of values of the index value of the pattern j-th dimension;

MAXj

- maximum of the index variable of the pattern j-th.

This mapping rule means that for each element (I1,…, In) of index space of the aligned array a corresponding image-set, consists of whole range of values of index variable of the pattern j-th dimension. (In such a case, the symbol «*» («any of the admissible») is usually used).

Examples.

  1. Alignment rule F( (I1,I2) ) = {I1}x{I2} means that element of two-dimensional array has to be mapped onto any processor, an element of two-dimensional pattern is mapped on, if the indexes of both elements are equal.

  2. Alignment rule F( (I1,I2) ) = {*}x{I1+5}x{*} means that the element of two-dimensional array has to be mapped onto any processor, an element of three-dimensional pattern is mapped on, if the index of the pattern second dimension is equal to the index of the aligned array first dimension plus 5. The index of the aligned array second dimension and the indexes of the pattern first and third dimension are not considered.

  3. Alignment rule F( (I1,I2,I3) ) = {*}x{*} means, that each element of three-dimensional array has to be mapped onto each processor, any element of two-dimension pattern is mapped on. The indexes of the aligned array and of the pattern are not considered.

  4. Alignment rule F( (I1,I2) ) = {0}x{1}x{2} means, that an element of two-dimensional array has to be mapped onto each processor, the element (0,1,2) of three-dimensional pattern is mapped on. The indexes of aligned array are not considered.

Defining the aligned array distribution among pattern space (that is the defining F1, ... ,Fm functions) it is necessary to take into account that all elements of the distributed array have to be inside the pattern space. Observance of correct mapping on each stage of a chain of alignments guarantees the correct final distribution of array elements among the processors.

Note that if an array is used as a pattern, then after realignment of this array by the function realn_ (see section 7.3), the array aligned with this pattern keeps its location.

When the function align_ is called the parameters of the alignment rule Fj(I1,...,In)= {Aj*Ik+Bj} for the j-th pattern dimension have to be defined as follows:

AxisArray[j-1]

contains value k;

CoeffArray[j-1]

contains value Aj;

ConstArray[j-1]

contains value Bj.

To define alignment rule Fj(I1, ... ,In) with image in set of all values of the index variable of j-th dimension of template for any I1, ... ,In, the value AxisArray[j-1] (k value) has to be set to -1. The values CoeffArray[j-1] and ConstArray[j-1] are irrelevant in this case.

The number of the alignment rules has to be equal to the rank of the pattern, when the function align_ is called.

The function returns zero.

Note. The distributed array mapping, specified for function align_, may be implemented only in the case, if for all the processors, at least one array element is mapped onto, a local size of each array dimension, obtained as a result of mapping, is not less than widths of high and low shadow edges of the dimension.

7.2. Alignments superposition.

Let the function G defines the location of the n-dimensional array in the space of the r-dimensional pattern; and let the function P defines the location of the r-dimensional array in the space of the m-dimensional pattern:

G((I1, ... ,Ii, ... ,In)) =

G1(I1, ... ,Ii, ... ,In) x
. . . . . . . . . . . . . . . . . .
G
k(I1, ... ,Ii, ... ,In) x
. . . . . . . . . . . . . . . . . .
G
r(I1, ... ,Ii, ... ,In)

P((J1, ... ,Jj, ... ,Jr)) =

P1(J1, ... ,Jj, ... ,Jr) x
. . . . . . . . . . . . . . . . . .
P
s(J1, ... ,Jj, ... ,Jr) x
. . . . . . . . . . . . . . . . . .
P
m(J1, ... ,Jj, ... ,Jr)

Then the result of alignment P (by function align_) of r-dimensional array PatternDA in m-dimensional pattern Pattern space; and of next alignment G of n-dimensional array DA in r-dimensional array PatternDA space is alignment F of n-dimensional array DA in m-dimensional pattern Pattern space. F is a product (superposition) of P and G:


F((I
1, ... ,Ii, ... ,In)) = P * G =

U{P(v)} =
V G((I1, ... ,In))

F1(I1, ... ,Ii, ... ,In) x
. . . . . . . . . . . . . . . .
F
s(I1, ... ,Ii, ... ,In) x
. . . . . . . . . . . . . . . .
F
m(I1, ... ,Ii, ... ,In)

The coordinate alignment rules Fs (0 s m) from F mapping are a superposition of the coordinate alignment rules for P and G mappings:

1. Let Ps((J1, ... ,Jr)) = {q Ms: 0 q MAXs} , where:

MAXs

- maximum of the index variable of the s-th dimension of Pattern;

Ms

- range of values of the index variable of the pattern Pattern s-th dimension.

Then Fs(I1, ... ,In) ) = Ms,

that is the full replication of the array DA along the s-th dimension of the pattern Pattern.

2.

Let

Ps((J1, ... ,Jr)) = Cs * Jk + Ds and
Gk((I1, ... ,In)) = Qk *Il + Rk ,

where:

Jk

- index variable of the k-th dimension of the array PatternDA;

Il

- index variable of the l-th dimension of the array DA;

Cs, Qs

- integers;

Dk, Rk

- nonnegative integers.

Then Fs((I1, ... ,In)) = As * Il + Bs ,

where As = Cs * Qk и Bs = Cs * Rk + Ds.

3.

Let

Ps((J1, ... ,Jr)) = Cs * Jk + Ds and
Gk((I1, ... ,In)) = q Mk: 0  q  MAXk ,

where:

Jk

- index variable of the k-th dimension of the array PatternDA;

Cs

- integer;

Ds

- nonnegative integer;

MAXk

- maximum of the index variable of the k-th dimension of the array PatternDA;

Mk

- range of values of the index variable of the PatternDA array k-th dimension.

Then

Fs((I1, ... ,In)) =

U {Cs * Jk + Ds} ,
Jk  Mk

that is the partial replication (stretched by the linear function Ps) of the array DA along the s-th dimension of the pattern Pattern.

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

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

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