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

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

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

Following reduction function numbers are supported (C language named constants are specified in brackets):

  1. sum (rf_SUM);

  2. multiplication (rf_MULT);

  3. maximum (rf_MAX);

  4. minimum (rf_MIN);

  5. binary logical "and" (rf_AND);

  6. binary logical "or" (rf_OR);

  7. binary logical excluding "or" (rf_XOR);

  8. binary equivalence (binary addition by module 2 with the following inversion of all its, rf_EQU);

  9. inequality (rf_NE);

  10. equality (rf_EQ).

The operations with 5, 6, 7 and 8 numbers can be applied to reduction variables of int and long type only (see below).

The result of the operation with number 9 (rf_NE) is non-zero ("TRUE"), if at the moment of the operation start the values of reduction variable are differ at least on two processors and zero ("FALSE") otherwise.

The result of the operation with number 10 (rf_EQ) is non-zero ("TRUE"), if at the moment of the operation start the values of reduction variable are same on all the processors and zero ("FALSE") otherwise.

Additional information (also called localization information), associated with the reduction function, depends on the user task algorithm and is formed by the user program. The additional information can be used only in the functions rf_MAX and rf_MIN and turns them into positional reduction functions MAXLOC and MINLOC. Admittedly the additional information in this case is the specified positions of the maximum or minimum. Run-Time System only sends this information from the processor, where the maximum or minimum was evaluated, to all another processors. If LocArrayPtr = NULL, or if *LocElmLengthPtr = 0 than localizaôion information is omitted.

Following types of reduction array-variable are supported (the name constants of the C language are in brackets):

  1. int (rt_INT);

  2. long (rt_LONG);

  3. float (rt_FLOAT);

  4. double (rt_DOUBLE).

If the flag *StaticSignPtr of the static reduction declaration is not equal to zero, then the created (or declared) reduction is not deleted automatically when the control exits from the current program block (see section 8). Such reduction has to be deleted explicitly using the function delred_.

Note. To avoid warnings from Fortran-compiler when the function crtred_ is called with different types of the reduction variables, Run-Time System ðrovides the function

RedRef crtrdf_ (

long
AddrType
long
long
void
long
long

*RedFuncNumbPtr,
*RedArrayAddrPtr,
*RedArrayTypePtr,
*RedArrayLengthPtr,
*LocArrayPtr,
*LocElmLengthPtr,
*StaticSignPtr );

differing from the function crtred_ in the second parameter:

*RedArrayAddrPtr

pointer to the reduction variable-array, cast to AddrType type by one of the functions, considered in section 17.7.

Other parameters of the function crtrdf_ are similar to corresponding ones of the function crtred_.

11.2Задание типа индексных переменных, значения которых определяют координаты локального максимума или минимума редукционной переменной

long lindtp_ (

RedRef
long

*RedRefPtr,
*LocIndTypePtr );

*RedRefPtr

reference to the reduction variable.

*LocIndTypePtr

код типа индексных переменных.

Функция сообщает системе поддержки тип индексных переменных, значения которых определяют координаты локальных максимумов или минимумов редукционных переменных, составляющих массив, заданный при обращении к функции crtred_ (crtrdf_) параметром RedArrayPtr (RedArrayAddrPtr) (см. п. 11.1). Значения этих индексных переменных содержатся в каждом элементе массива с информацией локализации, задаваемого при обращении к функциям crtred_ и crtrdf_ указателем LocArrayPtr.

Параметр *LocIndTypePtr может принимать значения:

0 – индексные переменные типа long,

1int,

2short,

3char.

Редукционная переменная, заданная ссылкой *RedRefPtr, должна быть создана в текущей подзадаче и не может быть уже включена в какую-либо редукционную группу.

The function returns zero.

Сразу после создания редукционной переменной функцией crtred_ (crtrdf_) тип индексных переменных, значения которых задают координаты локального максимума или минимума, считается равным integer (значение типа по умолчанию).

11.3Creating reduction group

RedGroupRef crtrg_ (

long
long

*StaticSignPtr,
*DelRedSignPtr );

*StaticSignPtr

the flag of the static reduction group creation.

*DelRedSignPtr

the flag of deleting of the all reduction descriptors while deleting the reduction group.

The function crtrg_ creates empty reduction group (that is group that does not contain any reduction). The function returns reference to the created group.

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

If the flag *DelRedSignPtr is not equal to zero then all reduction variables of the reduction group (at the moment of deleting) will be also deleted while deleting the group. When the group is deleted explicitly, all its variables will be also deleted explicitly, and when the group is deleted implicitly all its variables will be also deleted implicitly.

11.4Including reduction in reduction group

long insred_ (

RedGroupRef
RedRef
PSSpaceRef
long

*RedGroupRefPtr,
*RedRefPtr,
*PSSpacePefPtr,
*RenewSignPtr );

*RedGroupRefPtr

reference to the reduction group.

*RedRefPtr

reference to the reduction variable.

*PSSpaceRefPtr

reference to specifier of processor system and reduction variable processor space.

*RenewSignPtr

flag to update saved value of reduction variable when it is reincluded in the group.

Including the reduction variable to the group means its registration as a member of the group reduction operation and its value keeping for the reduction execution.

As specified in the function call reduction group, as the reduction variable included in the group must be created in the current subtask. Moreover, the reduction group must not be started by strtrd_ function (see section 11.6), and the reduction variable must not be already included in other reduction group.

The parameter, specified by *PSSpaceRefPtr reference, defines processor space of reduction variable, that is a processor set, where reduction operation, binded with the variable, is executed. The parameter also binds with the reduction variable a processor system, which will become processor system of reduction group when first reduction variable is included in the group. Processor space of the reduction variable is not strict subset of the set of its processor system elements. Processor systems of all included in reduction group variables must be equivalent, i.e. the must have the same rank and all dimension sizes and consist of the same processors.

The following objects can be used as processor space specifiers:

  1. Processor system

The processor system, specified by PSSpaceRefPtr parameter, becomes the processor system and the processor space of the reduction variable. All its elements must belong to the current processor system.

  1. Distributed array.

A distributed array, defined by *PSSpaceRefPtr reference, must be mapped on processor system, considered by Run-Time System as the processor system and the processor space of the reduction variable. Each element of the processor system must belong to the current processor system.

  1. Parallel loop.

A parallel loop, specified by PSSpaceRefPtr reference, must be the current one and mapped (i.e. parallel loop can be used for specification of the reduction variable specification only after its mapping by mappl_ function, see section 9.2). Processor system, the parallel loop is mapped on, is considered as the processor system of the reduction variable. The processor space of the reduction variable is a subset of its processor system elements, which doesn't contain processors, duplicating the execution of replicated loop iterations.

  1. Abstract machine representation.

If abstract machine representation is mapped by distr_ (redis_, mdistr_, mredis_) function, the processor system, the mapping is done on, is considered as the processor system and the processor space of the reduction variable. In this case if the representation is not mapped by distr_ (redis_, mdistr_, mredis_) function, but at least one its abstract machine is mapped by mappl_ function, the current processor system is considered as the processor system of reduction variable, and the processor space is a set of central processors of subtasks, created while mapping representation elements (the reduction on parallel subtask group, which competed its execution; see section 10).

Abstract machine representation or its elements can be mapped on the current processor system or its direct or indirect subsystems.

If *PSSpaceRefPtr is zero or PSSpaceRefPtr is NULL, the current processor system is considered as processor system and processor space of the reduction variable.

The reduction variable can be reincluded in the reduction group. Specification of the variable processor space may differ, but its processor system must be equivalent to the processor system of the reduction group. When the reduction variable is reincluded in the group, its saved value is updated, if *RenewSignPtr parameter has non-zero value, and is not changed, if *RenewSignPtr is zero or RenewSignPtr is NULL.

The function returns zero.

11.5Storing values of reduction variables

The functions, considered below, allow to update values of reduction variables, saved while including the variables in the reduction group without indicating (and, hence, without changing) specifications of processor spaces.

long saverv_ (RedRef *RedRefPtr);

*RedRefPtr  reference to reduction variable.

The function saverv_ updates saved value of given reduction variable for following its usage for group reduction operation execution.

The reduction variable, specified by *RedRefPtr reference, must be created in the current subtask and its reduction group must not be started by strtrd_ function (see sections 11.6).

The function returns zero.

long saverg_ (RedGroupRef *RedGroupRefPtr);

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

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

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