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

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

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

The described alignment F is equivalent to the sequence of the alignments P and G. Consider the case, when the pattern Pattern is not an abstract machine representation. Then it is aligned by some function Q with another pattern. In this case, the alignment functions F and Q may be substituted by their superposition Q*F. So, the resulting alignment of the array DA with the abstract machine representation can be built substituting sequential alignment functions by their superposition. (Run-Time Library does it to align the array DA by the pattern PatternDA when the function align_ is called.)

7.3. Realigning distributed array.

long realn_ (

long
PatternRef
long
long
long
long

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

ArrayHeader

- the header of the distributed array to be realigned.

*PatternRefPtr

- pointer to the alignment pattern.

AxisArray

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

CoeffArray

- array, which j-th element is a coefficient for the distributed array index variable used in 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.

*NewSignPtr

- the flag of updating of the distributed array (to be equal to 1).

The function realn_ cancels the allocation of the distributed array with header *ArrayHeaderPtr, defined previously by the function align_(or malign_, see section 7.5). The function sets a new allocation for this array according to the parameters AxisArray, CoefArray and ConstArray. If this array has been used as pattern of alignment of some arrays, nevertheless the allocations of these arrays are not changed.

The contents of realigned array will be updated (cleared), if the value *NewSignPtr is not equal zero and will be kept in other case. When contents of the array is kept its shadow edges (see section 12) are not kept; when the array is updated the shadow edges are cleared.

The array can be realigned by function realn_ only, if it was created by the function crtda_ with parameter *ReDistrParPtr equal to 2 or 3 (see section 6).

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

7.4. Requesting map

ArrayMapRef arrmap_ (

long
long

ArrayHeader[],
*StaticSignPtr);

ArrayHeader

- header of the distributed array

*StaticSignPtr

- flag of static map creation

The function arrmap_ creates an object (a map), describing current mapping of the distributed array onto the processor system representation, and returns a pointer to the created object.

The map contains in particular the following information:

  • a pointer to the processor system representation, distributed array is mapped on;

  • alligning rules for all dimensions of the representation;

  • the ranks of the distributed array and the abstract machine representation (for checking).

If flag of static map *StaticSignPtr is not equal to zero, then the map will not be deleted when control exits a program block (see section 8). Such map can be deleted only explicitly by function delarm_ considered in section 7.7.

7.5. Specifying distributed array mapping according to map.

long malign_ (

long
AMViewRef
ArrayMapRef

ArrayHeader[],
*AMViewRefPtr,
*ArrayMapRefPtr );

ArrayHeader

  • header of the distributed array

*AMViewRefPtr

  • pointer to the abstract machine representation, being alignment pattern

*ArrayMapRefPtr

  • pointer to map of the distributed array

The function malign_ performs distributed array mapping onto abstract machine representation according to map.

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

If AMViewRefPtr is equal to NULL or *AMViewRefPtr is equal to zero, then abstract machine representation, whose pointer is in the map, will be used as alignment pattern.

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

7.6. Realigning distributed array according to map.

long mrealn_ (

long
AMViewRef
ArrayMapRef
long

ArrayHeader[],
*AMViewRefPtr,
*ArrayMapRefPtr,
*NewSignPtr);

ArrayHeader

  • header of realigned distributed array.

*AMViewRefPtr

  • pointer to abstract machine representation, being alignment pattern

*ArrayMapRefPtr

  • pointer to the map of distributed array

*NewSignPtr

  • the flag of the distributed array updating (if it is equal to 1).

Function mrealn_ cancels allocation defined earlier by the function. malign_ (or align_ , see section 7.1) for the distributed array with header *ArrayHeaderPtr, and defines for the array new allocation according to specified map. The allocation of all distributed arrays, for whose alignment considered array was used as pattern, will not be changed.

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

If AMViewRefPtr is NULL or *AMViewRefPtr is zero, then abstract machine representation, whose pointer is in the map, will be used as alignment pattern.

The contents of realigned array will be updated (cleared), if the value *NewSignPtr is not equal zero and will be kept in other case. When contents of the array is kept its shadow edges (see section 12) are not kept; when the array is updated the shadow edges are cleared.

The array can be realigned by function mrealn_ only in the case, if it was created by the function crtda_ with parameter *ReDistrParPtr equal to 2 or 3 (see section 6).

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

7.7. Deleting map.

long delarm_ (ArrayMapRef *ArrayMapRefPtr);

*ArrayMapRefPtr - pointer to the map of the distributed array.

The function deletes the map of the distributed array created by function arrmap_. After deleting the map the pointer can be used by user program for its own goals.

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

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

The function returns zero.

Note. One of the possible usage of the functions, aligning the distributed arrays according to the map is keeping and restoring the array allocation in procedures, dealing with external distributed arrays with their redistribution.

Note that at the moment of using the map for mapping and remapping arrays, the array, being source for the map, may not exist.

8. PROGRAM BLOCK DEFINITION.

8.1. Block beginning

long begbl_(void);

The function begbl_ defines the beginning of the localization block for the following system objects:

  • distributed array;

  • abstract machine representation;

  • processor system;

  • reduction;

  • reduction group;

  • shadow edge group of the distributed arrays;

All these objects, being created in the localization block, are local ones. This means that these objects will be automatically deleted, when the control exits from this block. The exception is the static objects, which have to be deleted explicitly. The localization blocks can be nested.

Note, when abstract machine representation is deleted, all distributed arrays, mapped on the representation, are also deleted.

The function returns zero.

8.2. Block end

long endbl_(void);

The function endbl_ marks the end of the localization block. The function returns zero.

9. Parallel loop defining.

9.1. Creating parallel loop.

LoopRef crtpl_ (long *RankPtr);

*RankPtr - rank of the parallel loop.

The function crtpl_ creates the parallel loop (and so, defines its beginning). The function returns pointer to the created object.

9.2. Mapping parallel loop.

long mappl_ (

LoopRef
PatternRef
long
long
long
AddrType
long
long
long
long
long
long

*LoopRefPtr,
*PatternRefPtr,
AxisArray[],
CoeffArray[],
ConstArray[],
LoopVarAddrArray[],
InInitIndexArray[],
InLastIndexArray[],
InStepArray[],
OutInitIndexArray[],
OutLastIndexArray[],
OutStepArray[]);

*LoopRefPtr

- pointer to the parallel loop.

*PatternRefPtr

- pointer to the pattern of the parallel loop mapping.

AxisArray

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

CoeffArray

- array, which j-th element is a coefficient for the parallel loop index variable used in 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.

LoopVarAddrArray

- array, which j-th element is an address (cast to ‘AddrType’) of the index variable of the parallel loop (i+1)-th dimension.

InInitIndexArray

- input array, which j-th element is an initial value for the index variable of the parallel loop (i+1)-th dimension.

InLastIndexArray

- input array, which j-th element is a last value for the index variable of the parallel loop (i+1)-th dimension.

InStepArray

- input array, which j-th element is a step value for the index variable of the parallel loop (i+1)-th dimension.

OutInitIndexArray

Output array, which j-th element is calculated initial value for the index variable of the parallel loop (i+1)-th dimension.

OutLastIndexArray

- output array, which j-th element is calculated last value for the index variable of the parallel loop (i+1)-th dimension.

OutStepArray

- output array, which j-th element is calculated step value for the index variable of the parallel loop (i+1)-th dimension.

The function mappl_ creates regular mapping of the parallel loop onto the abstract machine representation, according to the defined mapping rules and the descriptions of the loop dimensions. The function distributes iterations of the loop among child abstract machines from this representation. The pattern defines the abstract machine representation. This pattern can be either the representation by itself, or the distributed array («indirect mapping»). In the last case, the pointer to the pattern is the first word of the distributed array header.

Using distributed array as a pattern is allowed only if this array has been mapped on a abstract machine representation; and using an abstract machine representation as a pattern is allowed only if this representation has been mapped on a processor system. So the function mappl_ only distributes iterations of the parallel loop among processors from this processor system.

Conceptually, when the control enters in the parallel branch, the current abstract machine has to be changed. Indeed, the current abstract machine is changed when it is requested only. That is, the Run-Time Library changes the current abstract machine only for necessity to reduce overheads.

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

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

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