rtsIDe (1158448), страница 20

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

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

2  "SHADOW" type access;

3  "FULL SHADOW" type access;

4  "REMOTE" type access (remote access).

Access type is defined in the following way. Let PS be the processor system, specified parallel loop is mapped on. Then

  1. The access is local one, if at each processor of PS system all distributed array elements, required for the loop execution, belong to the array local part;

  2. The access is "SHADOW" type access if at each processor of PS system all required elements of distributed array belong to the array local part, extended by shadow edges;

  3. The access is "FULL SHADOW" type access if at each processor of PS system all required elements of the array belong to the array local part, extended by full shadow edge;

  4. The access is remote ("REMOTE") if at least one processor of PS at least one required element of the array doesn't belong to the array local part, extended by full shadow edge;

If access has "SHADOW" or "FULL SHADOW" type, distributed array shadow edge widths, specified when the array was created, are written to LowShdWidthArray and HiShdWidthArray arrays.

In the case of remote access rmkind_ function calls crtrbl_ function to create remote element buffer with BufferHeader header.

15Non-regular access to remote data

A scheme of non-regular access to the remote elements of distributed array is similar to scheme of the regular access, considered in section 14. But its application area is restricted by the arrays, having the only distributed dimension (all other dimensions are replicated). The remote elements, required in the current processor buffer, are specified by a set of the index vectors of the form:

{C1} ... {Ck-1}

U{ ME[Vk,J+1] M: 0 ≤ J < ME[Vk,0] }
Vk,init ≤ Vk ≤ Vk,last

{Ck+1} {Cn}

,

where:

N

rank of distributed array;

K

number of its distributed dimension;

Ck, ... ,Ck-1,Ck+1, … ,Cn

integer non-negative numbers (constant sampling rules for replicated dimensions);

ME

matrix of global indexes (or index matrix);

Vk , J

index variables of sampling rule of distributed dimension;

Vk,init , Vk,last

initial and last values of index variable Vk for the current processor.

The index matrix ME is the distributed array, with the first distributed dimension and the second replicated one (the segment [Vk,init, Vk,last] is the local part of the index matrix by the first dimension for the current processor). The size Size2 of the second dimension of the matrix ME is equal to

MAX(ME[Vk,0]) + 1 , where Size1 the size of its first dimension. 0 Vk < Size1

The meaning of the index matrix elements are:

ME[Vk,0]

for each Vk: the number of corresponding to it coordinates of the distributed dimension of the array;

ME[Vk,J]

for each Vk and J: the value of the coordinate of the distributed dimension of the array (0 J < ME[Vk,0]).

15.1Creating remote element buffer of non-regular access

long crtib_ (

long
long
void
long
long
long

ArrayHeader[],
BufferHeader[],
*BasePtr,
*StaticSignPtr,
MEHeader[],
ConstArray[] );

ArrayHeader

header of the distributed array.

BufferHeader

header of the remote element buffer to be created.

BasePtr

base pointer for an access to remote element buffer.

*StaticSignPtr

flag of static buffer creation.

MEHeader

header of the index matrix.

ConstArray

array, which i-th element is the constant of the remote element sampling for (I+1)-th dimension of the distributed array (Ci+1).

The function crtib_ creates a buffer to allocate the remote elements of the distributed array with the header ArrayHeader, satisfying to remote access conditions.

The header BufferHeader of the created buffer is the array of 3 elements of "long" type. The buffer header allocation in memory (static or dynamic) is performed by a user program, but its initialization is performed by Run-Time System when executing the function crtib_.

The base pointer BasePtr must refer to any variable of the same type as the type of the distributed array elements (the variable value is irrelevant).

In detail dealing with the header of remote elements buffer and the base pointer is considered in section 15.5.

If the flag *StaticSignPtr is not equal to zero, then the created buffer will not be deleted, when the control exits the a program block (see section 8). Such buffer can be deleted only explicitly using the function delib_ considered below.

The index matrix header MEHeader is the array of 3 elements of "long" type. When the function crtib_ is called, the index matrix and the distributed array must be allocated in the memory (mapped).

A value of ConstArray[k-1] is irrelevant (k is a number of the distributed dimension of the array with header ArrayHeader).

The function returns zero.

15.2Starting loading remote element buffer of non-regular access

long loadib_ (long BufferHeader[]);

BufferHeader  header of the remote element buffer of non-regular access.

The function loadib_ initializes loading specified buffer by the distributed array elements, for which the buffer was created by the function crtib_.

The function returns zero.

15.3Waiting for completion of loading remote element buffer of non-regular access

long waitib_ (long BufferHeader[]);

BufferHeader  header of the remote element buffer of non-regular access.

The function returns zero.

15.4Deleting råmote element buffer of non-òegular access

long delib_ (long BufferHeader[]);

BufferHeader  header of the remote element buffer to be deleted.

The remote element buffer can be deleted by delib_ function only if it was created in the current subtask and in the current program block (or its sub-block (see sections 8 and 10).

To delete remote element buffer the function delobj_ can also be (see section 17.5).

The function returns zero.

15.5Access to remote elements, allocated in the buffer

At any processor the remote element buffer of non-regular access is similar to a local part of two-dimensional distributed array. Therefore its header may be declared, for example, as

long BufferHeader[3];

The access to allocated in the buffer remote element, is implemented by index variables of sampling rule of the array distributed dimension (by the index variables of the matrix of global indexes):

BasePtr[ BufferHeader[1]*Vk + J + BufferHeader[2] ] ,

where:

BasePtr

base pointer, corresponding to the element type of the distributed array;

Vk , J

the index variables of 1-th и 2-th dimensions of global index matrix.

For C language the value of the base pointer can be specified equal to NULL in the function crtib_ call. Then the access to the allocated in the buffer remote element can be performed as follows:

( (Type *)BufferHeader[2] )[ BufferHeader[1]*Vk + J ] ,

where Type is the type of the distributed array elements.

The coefficient BufferHeader[1] and the address constant BufferHeader[2] are calculated by Run-Time System when executing the function crtrb_ in the following way.

Let:

BufferPtr

address of remote element buffer;

TypeSize

size in bytes of distributed array element.

Then:

BufferHeader[1] =

MAX( ME[Vk,0] );
Vk,init ≤ Vk ≤ Vk,last

BufferHeader[2] = BufferHeader[1] * Vk,init;


BufferHeader[2] =

{

BufferHeader[2]  ((long)BufferPtr  (long)BasePtr) / TypeSize

if BasePtr  NULL;

BufferHeader[2]*TypeSize  (long)BufferPtr

if BasePtr = NULL.

Note. To access to the råmote elements, allocated in the buffer, the functions and macros, considered in section 13, can be used. When they are used:

  • the buffer header is necessary to use instead of the distributed array header;

  • the array rank is equal to 2;

  • the vector of the index variables values (Vk and J) of the distributed dimension sampling rule is used as the index vector of the element.

15.6Creating group of remote element buffers of non-regular access

IndirectAccessGroupRef crtig_ (

long
long

*StaticSignPtr,
*DelBufSignPtr );

*StaticSignPtr

flag of creating static group of buffers.

*DelBufSignPtr

flag of deleting all buffers, included in the group, when deleting the group.

The function crtbg_ creates an empty buffer group (not containing buffers) and returns a reference to the group.

If the flag *StaticSignPtr of static group is not equal to zero, then the created group will not be deleted, when the control exits the program block (see section 8). Such group can be deleted only explicitly using the function delig_, considered below.

If *DelBufSignPtr is not equal to zero, then all included in the group buffers will be deleted when the group is deleted. If deleting is explicit, all included buffers are deleted explicitly , and if deleting is implicit, the ones are deleted implicitly.

15.7Including remote element buffer of non-regular access in the group

long insib_ (

IndirectAccessGroupRef
long

*IndirectAccessGroupRefPtr,
BufferHeader[] );

*IndirectAccessGroupRefPtr

reference to the buffer group.

BufferHeader

header of the buffer to be included.

The function returns zero.

15.8Starting loading remote element buffers of specified group

long loadig_ (IndirectAccessGroupRef *IndirectAccessGroupRefPtr);

*IndirectAccessGroupRefPtr  reference to the buffer group.

The function returns zero.

15.9Waiting for completion of loading remote element buffers of specified group

long waitig_ (IndirectAccessGroupRef *IndirectAccessGroupRefPtr);

*IndirectAccessGroupRefPtr  reference to the buffer group.

The function returns zero.

15.10Deleting group of remote element buffers of non-regular access

long delig_ (IndirectAccessGroupRef *IndirectAccessGroupRefPtr);

*IndirectAccessGroupRefPtr  reference to the buffer group to be deleted.

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

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

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