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

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

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

The function returns zero.

14.5Access to distributed array elements, allocated in remote element buffer

Let r be the buffer rank (a number of remote distributed array dimensions, having non-constant linear sampling rules or being free). Then remote element buffer header, specified in crtrbl_ (crtrba_, crtrbp_) function call can be declared, for example, as

long BufferHeader[2*r+2];

Let also a base pointer, corresponding to remote distributed array element type be BasePtr. Then a remote element, defined by index vector (I1, ... ,Im, ... ,Ir), and located in the buffer local part, is referred by linear index in the following way:

BasePtr[

r-1
∑BufferHeader[m]*Im + Ir + BufferHeader[r] ]
m=1

For C language the base pointer can be NULL in crtrbl_, crtrba_ and crtrbp_ function calls. Then the remote element, placed in the buffer local part, can be accessed as:


( (Type *)BufferHeader[r] )[

r-1
BufferHeader[m]*Im + Ir ] ,
m=1

where Type is the type of the element of the remote distributed array.

For remote element buffer, created by crtrbl_ function.

Let m dimension of the buffer correspons to linear sampling rule of remote elements (bounded dimension) and, therefore, to some dimension k of a parallel loop. Then when accessing the buffer element a value of Im coordinate can be replaced by a value of the loop index variable Vk: Im = Vk – min(Vk,init , Vk,last) (Vk,init and Vk,last are initial and last values of the loop index variable Vk). It means, that the crossing from the buffer index space to the parallel loop index space involves a transition to distributed array-buffer with non-zero low index boundaries. Therefore to support access to the buffer elements by the loop index variables, when executing crtrbl_ Run-Time System for all bounded dimensions saves in the buffer header min(Vk,init , Vk,last) values as low shadow edges of the array dimensions (see description of extended header of distributed arrays in section 13.4). Low shadow edges of free buffer dimensions are set to zero in its header.

In C language to access to the buffer elements by parallel loop index variables the following macrocomands can be used:

<DAElmType> RBElm<Rank> (

long

long
. . . .
long

BufferHeader[],
<RBElmType>,
Index1,
. . . . . . . . . .
Index<Rank> );

BufferHeader

header of the remote element buffer.

Rank

the buffer rank (1-7).

RBElmType

type of the elements in the buffer.

Indexi

index value of the requested element on the i-th dimension of the buffer.

Each of these macros is L-value in the C language.

It is assumed, that when the buffer was created by crtrbl_ function the base pointer was equal to NULL.

14.6Creating group of remote element buffers

RegularAccessGroupRef crtbg_ (

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 empty buffer group (containing no buffers) and returns 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 delbg_ 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, they are deleted implicitly.

14.7Including remote element buffer in the group

long insrb_ (

RegularAccessGroupRef
long

*RegularAccessGroupRefPtr,
BufferHeader[] );

*RegularAccessGroupRefPtr

reference to the buffer group.

BufferHeader

header of a buffer to be inserted.

As the buffer group as the buffer to be included in the group must be created in the current subtask and can't be in loading state. The buffer can be reincluded in the group, but the buffer can't be included in the group, if it was included in the other group.

The function returns zero.

14.8Starting loading remote element buffers of specified group

long loadbg_(

RegularAccessGroupRef
long

*RegularAccessGroupRefPtr,
*RenewSignPtr );

*RegularAccessGroupRefPtr

reference to the buffer group.

*RenewSignPtr

flag of repeated reloading of already loaded buffer group.

All buffers of the group, specified in the function call, must be mapped on the processor systems, which each element must belong to the current processor system.

The function loadbg_ can be used for already loaded buffer group. In this case actual reloading is performed if *RenewSignPtr is not equal to zero, and isn't performed otherwise. The buffer group reloading is prohibited (independently on *RenewSignPtr parameter value), if its previous loading (actual or dummy) was not completed by waitbg_ function (see section 14.9).

The function returns zero.

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

long waitbg_ (RegularAccessGroupRef *RegularAccessGroupRefPtr);

*RegularAccessGroupRefPtr  reference to the buffer group.

Loading the buffer group, specified in the function call, must be started by the current subtask. Waiting for completion of not initialized earlier buffer group loading is not allowed.

The function returns zero.

14.10Deleting group of remote element buffers

long delbg_ (RegularAccessGroupRef *RegularAccessGroupRefPtr);

*RegularAccessGroupRefPtr  a reference to the buffer group to be deleted.

The buffer group can be deleted by delbg_ 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 the buffer group the function delobj_ can also be used (see section 17.5).

The buffer group, which loading was not completed by waitbg_ function, can't be deleted.

If the buffer group was created by crtbg_ function with non-zero value of *DelBufSignPtr parameter, then when the group is deleted all remote elements buffers, included in the group, will be also deleted.

The function returns zero.

14.11Requesting type of distributed array element access

long rmkind_ (

long
long
void
long
LoopRef
long
long
long
long
long

ArrayHeader[],
BufferHeader[],
*BasePtr,
*StaticSignPtr,
*LoopRefPtr,
AxisArray[],
CoeffArray[],
ConstArray[],
LowShdWidthArray[],
HiShdWidthArray[] );

ArrayHeader

distributed array header.

BufferHeader

header of created remote element buffer (for "REMOTE" type access).

BasePtr

base pointer to access remote element buffer (for "REMOTE" type access).

*StaticSignPtr

flag to create static buffer (for "REMOTE" type access).

*LoopRefPtr

reference to parallel loop, requiring distributed array elements for its execution.

AxisArray

array, which i-th element is parallel loop dimension number, corresponding to (i+1)-th dimension of distributed array.

CoeffArray

array, which i-th element is index variable coefficient of linear sampling rule for (i+1)-th dimension of distributed array.

ConstArray

array, which i-th element is constant of linear sampling rule for (i+1)-th dimension of distributed array.

LowShdWidthArray

output array, in which i-th element low edge width of (i+1)-th dimension of distributed array will be written (for "SHADOW" or "FULL SHADOW" type access)

HiShdWidthArray

output array, in which i-th element high edge width of (i+1)-th dimension of distributed array will be written (for "SHADOW" or "FULL SHADOW" type access)

The function rmkind_ defines type of access to elements of distributed array with ArrayHeader header, which is required for execution of parallel loop, specified by *LoopRefPtr reference.

The array elements, required for the loop execution, are specified similarly to specifying remote array elements, required for parallel loop execution (see section 14.1). BufferHeader, BasePtr, StaticSignPtr, AxisArray, CoeffArray and ConstArray parameters are similarly to same named parameters of crtrbl_ function.

Distributed array must be mapped on processor system, which each element belongs to the current processor system. At the moment of the function call parallel loop must be current and mapped.

The function returns the following values, specifying access type:

1  local access;

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

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

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