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

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

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

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

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

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

5.6. Deleting map.

long delmvm_(AMViewMapRef *AMViewMapRefPtr);

*AMViewMapRefPtr - pointer 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 pointer may be used by the user program for its own goals.

Note, that non-static map can be deleted by the function delmvm_ only if it was created in the current program block.

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.7. Imbalanced 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-1)/PSWEIGHTopt,j]+1

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.

6. Distributed array creating and deleting.

6.1. Creating distributed array.

long crtda_ (

long
void
long
long
long
long
long
long
long

ArrayHeader[],
*BasePtr,
*RankPtr,
*TypeSizePtr,
SizeArray[],
*StaticSignPtr,
*ReDistrParPtr,
LowShadowWidthArray[],
HiShadowWidthArray[]);

ArrayHeader

- header of the array to be created.

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).

LowShadowWidthArray

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

HiShadowWidthArray

- 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 Library functions (see section 13).

A header of the created array is an array of *RankPtr+1 elements of «long» type. The user program has to allocate this header in memory (whether statically or dynamically). Run-Time Library 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.

The base pointer BasePtr has to point to any variable of the same type as that of distributed array element. The value of this variable is not essential because the base pointer is only used to access to the elements from the local part of the distributed array.

See section 13.4 for more detail information about dealing with the header of the distributed array and the base pointer.

If the flag *StaticSignPtr of the static array creation is not equal to zero, then the created distributed array is not deleted automatically when the control exits from the current program block (see Section 8). Such array has to be deleted explicitly using the function delda_.

The parameter *ReDistrParPtr may have the following values:

0

- the array can not be an argument of the function redis_ and can not be redistributed by the function realn_;

1

- the array can be an argument of the function redis_, but can not be redistributed by the function realn_;

2

- the array can be redistributed by the function realn_, but this array can not be used in defining the abstract machine representation using the function redis_;

3

- the array can be used as a pointer to the abstract machine representation in the function redis_, and the array can be redistributed by the function realn_.

The number of the parameters defined in the arrays LowShadowWidthArray and HiShadowWidthArray (that is the width of low and high shadow edges) has to be equal to the created array rank. See section 12 for more detail description of the shadow edges of the distributed array local parts. Note, that the shadow edge width can be equal to zero.

The function returns zero.

6.2. Deleting distributed array.

long delda_(long ArrayHeader[]);

ArrayHeader – the header of the array to be deleted.

The function deletes the distributed array created by the function crtda_. After array deleting the user program can use distributed array header for any goal.

Note, that non-static distributed array can be deleted by the function delda_ only, if it was created in the current program block.

A distributed array can be deleted also by the function delobj_ (see section 17.5).

The function returns zero.

6.3. Creating additional header of distributed array.

long addhdr_ (

long
long

NewArrayHeader[],
ArrayHeader[] );

NewArrayHeader

- header to be created.

ArrayHeader

- one of the existing headers.

The function creates the distributed array header, which further will be used equitably with existing headers. In particular it can be used to create other additional headers.

When the distributed array is aligned by functions align_ and malign_ (see section 7) all its headers are initialized. The array realigning by the functions realn_, mrealn_, redis_ and mredis_ (see sections 5 and 7) also causes all its headers updating.

The function returns zero.

6.4. Deleting distributed array header.

long delhdr_ (long ArrayHeader[]);

ArrayHeader - header to be deleted.

The function deletes the header, created by the function addhdr_. The header, specified as parameter of the array creation by the function crtda_ (the main header) cannot be deleted.

The function returns zero.

7. Mapping distributed array.

7.1. Aligning distributed array.

long align_ (

long
PatternRef
long
long
long

ArrayHeader[],
*PatternRefPtr,
AxisArray[],
CoeffArray[],
ConstArray[]);

ArrayHeader

- the header of the distributed array to be aligned.

*PatternRefPtr

- pointer to the alignment pattern.

AxisArray

- array, which j-th element is a dimension number of the distributed array used in the linear alignment rule for the pattern (j+1)-th dimension.

CoeffArray

- array, which j-th element is a coefficient for distributed array index variable used in the linear alignment rule for the pattern (j+1)-th dimension.

ConstArray

- array, which j-th element is a constant used in the linear alignment rule for the pattern (j+1)-th dimension.

The function align_ defines the location of the specified distributed array in the assigned abstract machine representation space (in other words the function aligns the distributed array). Besides, the elements of the array are distributed among the child abstract machines incorporating in the representation. The abstract machine representation is defined by means of the pattern, which can be as the representation itself, or a distributed array (this is called «indirect mapping»). In the last case the pointer to the pattern is a first word of distributed array header.

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

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

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