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

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

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

When mdistr_ function is called, abstract machine (parental), which representation is specified by *AMViewRefPtr reference, must be already mapped.

If PSRefPtr is NULL or *PSRefPtr is zero, then the subsystem, whose reference is in the map, will be used as the processor subsystem.

All processors of the system, specified by *PSRefPtr reference or by a reference, contained in the map, must belong to elementary intersection of the current processor system and the processor system, the parental abstract machine is mapped on.

The ranks of the abstract machine representation and the processor subsystem must be equal to the corresponding ranks in the map.

It is impossible to map the abstract machine representation, already mapped by distr_ (redis_, mdistr_, mredis_) function or the representation, where at least one element is mapped on some processor system by mapam_ function (see section 10).

The function returns non-zero, if remapped representation has a local part on the current processor, and zero in the other case.

5.5Remapping abstract machine representation according to the map

long mredis_ (

AMViewRef
PSRef
AMViewMapRef
long

AMViewRefPtr,
*PSRefPtr,
*AMViewMapRefPtr,
*NewSignPtr );

*AMViewRefPtr

reference to abstract machine representation to be remapped.

*PSRefPtr

reference to the processor system, determining resource structure for new mapping.

*AMViewMapRefPtr

reference to map of the abstract machine representation.

*NewSignPtr

flag of renewing all redistributed arrays (if it is equal to 1).

The function mredis_ cancels resource distribution of the abstract machine, implemented earlier by the function mdistr_ (or distr_, see section 5.1) for descendant abstract machines, included to the representation, specified by reference *AMViewRefPtr, and redistributes the given representation according to specified map. All distributed arrays, aligned earlier with the considered representation by the functions align_ and malign_ (as explicitly as implicitly) will be remapped according to the old aligning rules (see section 7). If *NewSignPtr is not equal to zero, then the arrays will be updated (cleared) and kept in other case. When the arrays are remapped the contents of their shadow edges (see section 12) is not kept.

All elements of specified representation must be terminals of abstract machine tree (must not have descendants).

If PSRefPtr is NULL or *PSRefPtr is zero, then the subsystem, whose reference is in the map, will be used as the processor subsystem.

All processors of the system, specified by *PSRefPtr reference or by a reference, contained in the map, must belong to elementary intersection of the current processor system and the processor system, the parental processor system is mapped on.

The ranks of the abstract machine representation and the processor subsystem must be equal to corresponding ranks in map.

Remapped representation may be specified indirectly, if the header of the distributed array, created by function crtda_ with parameter *ReDistrParPtr is equal to1 or 3, is uses as parameter *AMViewRefPtr (see section 6).

The abstract machine representation, specified in the function call, can be not mapped earlier. In this case mredis_ function is executed as distr_ function, and *NewSignPtr parameter value is irrelevant.

The function returns non-zero, if remapped representation has a local part on the current processor, and zero in the other case.

5.6Deleting map

long delmvm_(AMViewMapRef *AMViewMapRefPtr);

*AMViewMapRefPtr  reference to the map of the abstract machine representation.

The function deletes map of the abstract machine representation created by function amvmap_. After deleting map the reference may be used by the user program for its own goals.

The map can be deleted by delmvm_ function only if it was created in the current subtask and in the current ðrogram block (or its sub-block) (see sections 8 and 10).

To delete the map the function delobj_ can also be used (see section 17.5).

The function returns zero.

Note. One of possible usage of the abstract machine representation mapping functions according to the map is keeping and restoring the abstract machine mapping and therefore the allocation of the arrays, aligned with the mapping, in the procedures, dealing with external distributed arrays with their redistribution.

Note, that when map is used for mapping and remapping, the abstract machine representation, being the source of the map, may not exist.

5.7Imbalanced block distribution

All notations, used in this section, except of newly introduced is assumed to be coincided with the notations from section 5.1.

Considered in section 5.1 the abstract machine representation mapping onto the processor system is the balanced distribution of the parental abstract machine resources onto the representation elements. In this case for k-th dimension of abstract machine representation the size of BLSIZEk block is assumed to be independent of a value of j-th coordinate of the processor system element. Such uniformity for each dimension is a result of supposed in section 5.1 equal weights of all its elements: the optimal weights of all processor coordinates are equal and equal to 1(see section 4.5).

Let us consider now a case of imbalanced elements of the processor system. Let the block BLSIZEk has a fixed size for k-th dimension (as in section 5.1), but a "number" of blocks per the processor system element with coordinate Pj for j-th dimension is equal to optimal weight of the coordinate. Then the first of the mapping rules, considered in section 5.1, (i.e. function Fj(I1, ... ,In)) is determined by inequalities

Fj(I1,...,In)-1
WEIGHTopt,j(Pj) < [Ik/BLSIZEk]
Pj=0

Fj(I1,...,In)
WEIGHTopt,j(Pj)
Pj=0

where WEIGHTopt,j(Pj) is optimal weight of the coordinate Pj.

The value BLSIZEk is determined as follows:

BLSIZEk ={

min( DistrParamArray[j-1], AMSIZEk )

if DistrParamArray[j-1] ≠ 0 ,

[AMSIZEk / PSWEIGHTopt,j]

if DistrParamArray[j-1] = 0 ,

where:


PSWEIGHTopt,j
=

PSSIZEj-1
WEIGHTopt,j(Pj)
Pj=0

(optimal weight of j-th dimension of the

processor system).

Since maximal allowed value Ik is

min( ([PSWEIGHTopt,j * BLSIZEk] - 1) , AMSIZEk - 1 ) ,

for full coverage of k-th dimension of the abstract machine representation by the mapping rule the following inequality must be satisfied:

AMSIZEk  PSWEIGHTopt,j * BLSIZEk ,

It is achieved if

DistrParamArray[j-1]  AMSIZEk / PSWEIGHTopt,j

or if

DistrParamArray[j-1] = 0 .

6Distributed array creating and deleting

6.1Creating distributed array

long crtda_ (

long
long
void
long
long
long
long
long
long
long

ArrayHeader[],
*ExtHdrSignPtr,
*BasePtr,
*RankPtr,
*TypeSizePtr,
SizeArray[],
*StaticSignPtr,
*ReDistrParPtr,
LowShdWidthArray[],
HiShdWidthArray[] );

ArrayHeader

header of the array to be created.

*ExtHdrSignPtr

flag of extended header.

BasePtr

base pointer, used to access to the distributed array elements.

*RankPtr

rank of the created array.

*TypeSizePtr

size of the array element (in bytes).

SizeArray

array, which i-th element is a size of the (i+1)-th dimension of the created (0 i *RankPtr-1).

*StaticSignPtr

the flag of the static array creation.

*ReDistrParPtr

the permission flag of using of created distributed array as a parameter in the function redis_ and realn_ (see sections 5.2 and 7.3).

LowShdWidthArray

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

HiShdWidthArray

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

The creation of a distributed array using function crtda_ means only an initialization of the internal system structures describing the array. The memory for the distributed array elements is allocated only after mapping this array on an abstract machine by the function align_. (In another words, memory is allocated after evaluating for each processor abstract machine it is mapped onto, a local part of distributed array according to its distribution, see section 7.1). An access to array elements is performed through Run-Time System functions (see section 13).

A header of the created array is an array of *RankPtr+1 (if *ExtHdrSignPtr = 0) or *RankPtr*2+2 (if *ExtHdrSignPtr = 1) elements of "long" type. The user program has to allocate this header in memory (whether statically or dynamically). Run-Time System only initializes this header. The main purpose of this header is to provide an effective access to the elements of the local part of the distributed array.

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

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

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