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

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

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

*AMRefPtr

- a pointer to the abstract machine.

*RankPtr

- a rank of created representation.

SizeArray

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

*StaticSignPtr

- the flag of static representation creation

The function crtamv_ creates a representation of the assigned abstract machine as an array of abstract machines of the next hierarchy level. The function returns pointer to the created representation. The representation of the abstract machine as an array allows data arrays and parallel constructs to be mapped onto the abstract machine. An abstract machine can possess several representations, and each of them being an array of abstract machines of the next hierarchy level.

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

3.3. Requesting pointer to an element of abstract machine representation.

AMRef getvam_ (

AMViewRef
long

*AMViewRefPtr,
IndexArray[] );

*AMViewRefPtr

- a pointer to the abstract machine representation.

IndexArray

- array, which i-th element is a index value of requested element (that is abstract machine) along (i+1)-th dimension

The size of the array IndexArray must be equal to the rank of specified representation of the abstract machine.

3.4. Deleting abstract machine representation.

long delamv_(AMViewRef *AMViewRefPtr);

*AMViewRefPtr – the pointer to the abstract machine representation.

The function deletes an abstract machine representation, created by the function crtamv_. All distributed arrays mapped onto the deleted representation are also deleted.

After deleting the representation the pointer can be used by user program for its own goals.

Note, that non-static representation of abstract machine can be deleted by the function delamv_ only if it was created in the current program block.

To delete an abstract machine representation the function delobj_ can also be used (see section 17.5).

The function returns zero.

4. Processor systems.

4.1. Requesting pointer to the processor system.

PSRef getps_ (AMRef *AMRefPtr);

*AMRefPtr – a pointer to the abstract machine.

The function getps_ returns a pointer to the processor system the specified abstract machine is mapped onto. The parameters of the processor system (the rank and the size of each dimension) can be obtained through the functions getrnk_ and getsiz_ (see section 17).

4.2. Creating subsystem of specified processor system.

PSRef crtps_(

PSRef
long
long
long

*PSRefPtr,
InitIndexArray[],
LastIndexArray[],
*StaticSignPtr );

*PSRefPtr

- pointer to the (source) processor system whose subsystem will be created.

InitIndexArray

- array, which i-th element is an initial value of the index of the (i+1)-th dimension of the source processor system.

LastIndexArray

- array, which i-th element is last value of the index of the (i+1)-th dimension of the source processor system.

*StaticSignPtr

- the flag of the static subsystem creation.

The function crtps_ creates the subsystem of the same rank, as the rank of source processor system, and returns the pointer to the subsystem. The sizes of InitIndexArray and LastIndexArray arrays must be equal to the rank of the source (and to be created) processor systems.

If the pointer PSRefPtr is equal to NULL or *PSRefPtr has a zero value then the current processor system will be used as source one.

Internal values of element coordinates of any processor system are numbered from 0. Therefore element (P1, ..., Pj, ..., Pn) of the created processor subsystem is the element (P1+InitIndexArray[0], ... , Pj+InitIndexArray[j-1], ... , Pn+InitIndexArray[n-1]) of the source processor system (n is the rank of source and created systems). The size of i-th dimension of the created subsystem is equal to LastIndexArray[i-1]-InitIndexArray[i-1]+1.

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

4.3. Reconfiguring (changing shape of) processor system.

PSRef reconf_ (

PSRef
long
long
long

*PSRefPtr,
*RankPtr,
SizeArray[],
*StaticSignPtr );

*PSRefPtr

- pointer to the source (to be reconfigured) processor system.

*RankPtr

- rank of the target (reconfigured) processor system.

SizeArray

- array, which i-th element is the size of (i+1)-th dimension of the target processor system.

*StaticSignPtr

- flag of static target processor system.

The function reconf_ creates new processor system from the elements of the source processor system and returns pointer to the target system. A number of elements in the source and target systems must be the same.

If the pointer PSRefPtr is equal to NULL or *PSRefPtr has a zero value then the current processor system will be used as source one.

4.4. Deleting processor system.

long delps_ (PSRef *PSRefPtr);

PSRef *PSRefPtr - pointer to the processor system to be deleted.

The function deletes the processor system, created by the function crtps_ (or reconf_). All the abstract machines, their representations and the distributed arrays, mapped onto the deleted processor system are also deleted.

Non-static processor system can be deleted by the function delps_ only if it was created in the current program block.

To delete a processor system the function delobj_ can also be used (see section 17.5).

The function returns zero.

4.5. Weights of processor system elements.

Let a processor system be n-dimension array, and a function WEIGHTi with the domain of definition in a space of values of i-th dimension index variable and with image in real numbers, more or equal to 1 be defined for every dimension. A value of function WEIGHTi(Pi) will be called the weight of Pi coordinate (1 i n, 0 Pi < PSSIZEi , PSSIZEi is a size of i-th dimension of processor system).

Then processor (P1, ... ,Pi, ... ,Pn) weight is by definition


WEIGHT(P1, ... ,Pi, ... ,Pn) =

n
 WEIGHTi(Pi)
i=1

The coordinate weights of the initial processor system elements (therefore and processor weights) are parameters of Run-Time Library startup. When a user program is running the coordinate weights of the processors of the processor system can be assigned (changed) by the function

long setpsw_ (

PSRef
AMViewRef
float

*PSRefPtr,
*AMViewRefPtr,
CoordWeightArray[] );

*PSRefPtr

  • pointer to the processor system, whose element coordinate weights will be assigned.

*AMViewRefPtr

  • pointer to representation of an abstract machine, to be mapped onto specified processor system with the assigned coordinate weights.

CoordWeightArray

  • array, containing processor coordinate weights.

If the pointer PSRefPtr is equal to NULL or *PSRefPtr has a zero value then the coordinate weights of the current processor system elements are specified.

If AMRefPtr = NULL or *AMRefPtr = 0, then assigned processor coordinate weights as well as weights, specified at Run-Time library startup, will be used for mapping or remapping all the representations of abstract machines onto specified processor system (except of the representations, for which the processor coordinate weights were assigned by the function setpsw_).

The weight of coordinate Pi is specified by a value of ((i-1)*PSSIZEi + Pi)-th element of the array CoordWeightArray. A number of elements of the array CoordWeightArray, containing processor coordinate weights, must be equal to sum of sizes of all processor system dimensions. The coordinate weights in the array CoordWeightArray may be any positive numbers. Executing function setpsw_, Run-Time Library updates every weight Pi dividing it by minimal weight of the coordinate of i-th dimension.

If CoordWeightArray = NULL or CoordWeightArray[0] < 0, then coordinate weights, specified in Run-Time Library startup parameters, are used as assigned coordinate weights.

If CoordWeightArray [0]= 0, then the weights of all coordinates will be set to 1.

The function returns zero.

The processor coordinate weights, considered above, are called computational weights. They determine distribution of data and computations over processors: computational processor loading is proportional to computational weight of the processor (equal to product of computational weights of its coordinates). The computational weights of the processor coordinates reflect calculation heterogeneity of the task being solved and are specified so that to provide balanced processor loading under condition, that they have the same performances.

A difference in processor performance is specified by performance weights: the processor performance is proportional to its performance weight. The performance weights (real numbers, equal to or more then 1) are Run-Time Library startup parameters and cannot be updated by a user program.

When Run-Time Library is initialized (and when the function setpsw_ is executed) computational weights of processor coordinates are updated according to the processor performance. The result of updating is optimal weights of the processor coordinates, reflecting as calculation heterogeneity of the task being solved as hardware heterogeneity of the processor system. The optimal weights provide the best balance of computations and are specified as follows. Let

WEIGHTcalc,i (Pi)

- computational weight of Pi coordinate of the processor system (specified under assumption that performance weights of all the processors are equal to 1.

WEIGHTperf (P1, ... ,Pi, ... ,Pn)

- performance weight of the processor element (P1, ... ,Pi, ... ,Pn);

WEIGHTopt,i (Pi)

- optimal weight of coordinate Pi of the processor system i-th dimension.

Let us suppose, that processor weight, determining the processor loading by data and computations is

  1. proportional to the processor performance weight;

  2. equal to the product of its coordinate weights for any processor performance.

Let us suppose also, that "contribution" of processor performance weight into its coordinate weights is the same.

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

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

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