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

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

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

*RedGroupRefPtr - pointer to the reduction group.

The function waitrd_ awaits the completion of the all reduction operations of the group. It is allowed to use all reduction variables from this group after completion of this function.

The function returns zero.

11.7. Deleting reduction group.

long delrg_ (RedGroupRef *RedGroupRefPtr);

*RedGroupRefPtr - pointer to the reduction group.

The function delrg_ deletes the reduction group created by the function crtrg_. After deleting the group the pointer to the group can be used by user program for any goals.

The function returns zero.

11.8. Deleting reduction.

long delred_ (RedGroupRef *RedGroupRefPtr);

*RedGroupRefPtr - pointer to the reduction group.

The function delred_ deletes the reduction descriptor created by the function crtred_. After deleting the descriptor the pointer to the descriptor can be used by user program for any goals.

The function returns zero.

12. Renewing shadow edges of distributed array.

Let the local part of the distributed array be represented as an aggregate of its elements defined as a set of the index tuples:

{I1 Î M1: I1,low  I1  I1,high} x
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
{Im Î Mm: Im,low  Im  Im,high} x
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
{In Î Mn: In,low  In  In,high}

where:

x

- symbol of Cartesian product;

n

- rank of the array;

Im

- index variable of the m-th dimension (1 m n);

Im,low

- the low value of the index variable of the m-th dimension;

Im,high

- the high value of the index variable of the m-th dimension;

Mm

- the range of values of the index variable of the m-th dimension.

Suppose that the local part is entirely inside the array (for simplicity). Then low shadow edge of the local part of distributed array of k-th dimension is a set of its elements, defined by a set of the index corteges:

LSBk =

{I1
{....
{Ik-1
{Ik
{Ik+1
{....
{In

M1
. . . . . . . . .
 Mk-1
 Mlow,k
 Mk+1
. . . . . . . . .
 Mn

: I1,low
. . . . . . . . .
:Ik-1,low
:Ik,low
:Ik+1,low
. . . . . . . . .
:In,low

- FS * LW1
. . . . . . . . . . .
– FS * LWk-1
– LWk
- FS *LWk+1
. . . . . . . . . . .
- FS * LWn

I1
. . . . . . . . .
 Ik-1
 Ik
 Ik+1
. . . . . . . . .
 In

I1,high
. . . . . . . . . . .
 Ik-1,high
 Ik,low
 Ik+1,high
. . . . . . . . . . .
 In,high

+ FS * HW1
. . . . . . . . . . . . . .
+ FS * HWk-1
–1
+ FS * HWk+1
. . . . . . . . . . . . . .
+ FS * HWn

}x
}x
}x
}x
}x
}x
}

Here:

Lwi

- width of the low part of the shadow edge of i-th dimension;

Hwi

- width of the high part of the shadow edge of i-th dimension (parameters LowShadowWidthArray and HiShadowWidthArray of the functions crtda_ , section 6, and inssh_ , section12.2);

FS

- flag of full edge (parameter *FullShadowSignPtr of the function inssh_, section 12.2).

Similarly high shadow edge of the local part of the distributed array of k-th dimension is defined by the set of index corteges:

HSBk =

{I1
{....
{Ik-1
{Ik
{Ik+1
{....
{In

M1
. . . . . . . . .
 Mk-1
 Mlow,k
 Mk+1
. . . . . . . . .
 Mn

: I1,low
. . . . . . . . .
:Ik-1,low
:Ik,high
:Ik+1,high
. . . . . . . . .
:In,low

- FS * LW1
. . . . . . . . . . . . .
– FS * LWk-1
+ 1
– FS *LWk+1
. . . . . . . . . . . . .
- FS * LWn

I1
. . . . . . . .
 Ik-1
 Ik
 Ik+1
. . . . . . . .
 In

I1,high
. . . . . . . . . . .
 Ik-1,high
 Ik,low
 Ik+1,high
. . . . . . . . . . .
 In,high

+ FS * HW1
. . . . . . . . . . . .
+ FS * HWk-1
+ HWk
+ FS * HWk+1
. . . . . . . . . . . .
+ FS * HWn

}x
}x
}x
}x
}x
}x
}

The low (high) shadow edge of k-th dimension is called full, if FS=1, and is called low (high) shadow bound, if FS=0. The union of full shadow edges of all dimensions is called full shadow edge of the local part of the distributed array.


FSB =

n
U(
k=1


U( LSBk, HSBk)) =

FS=1

n

U(

{I1

M1

: I1,low

- LW1

I1

I1,high

+ HW1

}x

k=1

{. . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . . .

. . . . . . . . .

}x

{Ik-1

Mk-1

:Ik-1,low

- LWk-1

Ik-1

Ik-1,high

+ HWk-1

}x

{Ik

Mk

:Ik,low

- LWk

Ik

Ik,high

- 1

}x

{Ik

Mk

:Ik,high

+ 1

Ik

Ik,high

+ HWk

}x

{Ik+1

Mk+1

:Ik+1,low

-LWk+1

Ik+1

Ik+1,high

+ HWk+1

}x

{. . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

}x

{In

Mn

:In,low

- LWn

In

In,high

+ HWn

}

Elements of the shadow edge of the local part of the distributed array are called shadow edge elements (or imported). These elements are allocated in the memory together with the local part. In the another side, each edge element belongs to some local part of the distributed array, and so it is allocated in the memory of the processor, this local part is mapped on. For this processor the element is called element-original (or exported element).

Renewing the shadow edges of the distributed array local parts is an asynchronous operation (that is operation executed in parallel with computations). During this operation each element-original (possibly updated) is copied to the corresponding shadow edge element (possibly obsolete). For optimization purpose, the shadow edges of the distributed arrays are combined in a group, and shadow edge exchange is implemented as a set of operations, executed over the specified group of the shadow edges.

12.1. Creating shadow edge group.

ShadowGroupRef crtshg_(long *StaticSignPtr);

*StaticSignPtr - the flag of the static shadow edge group creation.

The function crtshg_ creates empty shadow edge group (that is group that does not contain any shadow edge). The function returns pointer to the created group.

If the flag *StaticSignPtr of the static shadow edge group creation is not equal to zero, then the created group does not deleted automatically when the control exits from the current program block (see section 8). Such shadow edge group has to be deleted explicitly using the function delshg_.

12.2. Including shadow edge in the group.

long inssh_(

ShadowGroupRef
long
long
long
long

*ShadowGroupRefPtr,
ArrayHeader[],
LowShadowWidthArray[],
HiShadowWidthArray[],
*FullShadowSignPtr);

*ShadowGroupRefPtr

- pointer to the shadow edge group.

ArrayHeader

- the header of the distributed array.

LowShadowWidthArray

- array, which i-th element is the width of the low shadow edge of the (i+1)-th dimension of the array.

HiShadowWidthArray

- array, which i-th element is the width of the high shadow edge of the (i+1)-th dimension of the array.

*FullShadowSignPtr

the flag of the inclusion of the «corner» elements to the shadow edge.

Including distributed array shadow edge in the group means only registration of this shadow edge as a member of shadow edge group. Run-Time Library does not storage the values of this shadow edge in the system renewing buffer.

The widths of the array shadow edges defined by the LowShadowWidthArray and HiShadowWidthArray parameters should not fall outside the limits of the shadow edge widths defined in the function crtda_ when the array was created. If the shadow edge width is equal to -1, then the width defined in the function crtda_ is used.

If *FullShadowSignPtr = 0, then only low and high shadow edges of all dimensions of the distributed array participate in shadow edge exchange operations. If *FullShadowSignPtr = 1, then the full shadow edge of the distributed array participates.

The function returns zero.

The exchange of shadow edges, that is the union of shadow bounds, requires a communication of the current processor with 2*n neighbors (2*n is a number of shadow bounds), and exchange of the full shadow edges requires the communication with 3n-1 neighbors (n is the rank of the distributed array). So if the shadow edge as union of shadow bounds don't cover task needs and full shadow edge exchange is inadmissible because of overheads, Run-Time Library provides a possibility to choice sufficient and optimal scheme of shadow edges exchange. The scheme is based on a representation of the shadow edge as union of elementary shadow n-dimensional parallelepipeds.

Let Q = (q1, ... ,qk, ... ,qn) be n-combination with repetition from the elements of the set {0,1,2} (the combination (0, ... ,0) is not considered). Let n-dimensional parallelepiped PQ = M1 x ... x Mk x ... x Mn is corresponded to it, where:


Mk =

{

M0,k = {Ik  Mk: Ik,init

Ik  Ik,last

} if qk = 0,

M1,k = {Ik  Mk: Ik,init – LWk

Ik  Ik,last –1

} if qk = 1,

M2,k = {Ik  Mk: Ik,last + 1

Ik  Ik,last + HWk

} if qk = 2.

Here:

Ik

- index variable of k-th dimension of distributed array (1 k n);

Ik,init

- initial value of index variable of k-th dimension;

Ik,last

- last value of index variable of k-th dimension;

Mk

- range of index variable values of k-th dimension;

LWk

- width of low part of the edge of k-th dimension;

HWk

- width of high part of the edge of k-th dimension;

The parallelepiped PQ is called elementary shadow n-dimensional parallelepiped.

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

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

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