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

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

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

To use a full scope of the source or target array without requesting the size of the object by some dimension (see section 17.2), Run-Time System supposes that the value of the initial index value can be equal to -1. In that case, the initial index value is supposed to be equal to zero, the step be equal to 1, and the last index value be equal to the size of the dimension minus 1.

One of the arrays (but not the both) can be not distributed but rather a normal one replicated among all the processors (Run-Time System determines this case if the pointer of the array is not the pointer to the header of the distributed array). The types of the elements of replicated and distributed arrays must be the same. It is assumed that the replicated array is one-dimensional, and that the elements of this array are allocated in the memory consequently and continuously. Run-Time System ignores the parameters of the indexes of such array.

If the one of the arrays is not a distributed one, then the copy mode is determined by the value of the *CopyRegimPtr flag:

  • if *CopyRegimPtr is zero, "usual" ("normal") array is considered to be located on all the processors of the current processor system;

  • if the flag *CopyRegimPtr is positive, then Run-Time System assumes that the "normal" array is allocated on the I/O processor only;

  • if *CopyRegimPtr is negative (it is allowable only for "normal" array to be read), then the distributed array, specified by the parameter ToArrayHeader, will be filled by an element with address, specified by the parameter FromArrayHeader.

If both arrays are non-distributed ones, then the copying is not executed.

If both arrays are distributed ones, then these arrays can be different in the rank and in the size of each dimension, but the types of the element of the arrays have to be the same.

As read distributed array as written one must be mapped in the processor systems, which each element must belong to the current processor system.

The function returns the number of the copied elements.

13.3Asynchronous coping distributed arrays

long arwelm_ (

long
long
long
AddrType

FromArrayHeader[],
ToArrayHeader[],
IndexArráy[],
*CopyFlagPtr );

long arwelf_ (

long
AddrType
long
AddrType

FromArrayHeader[],
*ToArrayHeaderPtr,
IndexArray[],
*CopyFlagPtr );

long acopel_(

long
long
long
long
AddrType

FromArrayHeader[],
FromIndexArray[],
ToArrayHeader[],
ToIndexArray[],
*CopyFlagPtr );

long aelmcp_ (

long
long
long
long
long
AddrType

FromArrayHeader[],
FromIndexArray[],
ToArrayHeader[],
ToIndexArray[],
*CopyRegimPtr,
*CopyFlagPtr );

long aarrcp_ (

long
long
long
long
long
long
long
long
long
AddrType

FromArrayHeader[],
FromInitIndexArray[],
FromLastIndexArray[],
FromStepArray[],
ToArrayHeader[],
ToInitIndexArray[],
ToLastIndexArray[],
ToStepArray[],
*CopyRegimPtr,
*CopyFlagPtr );

Described above functions arwelm_, arwelf_, acopel_, aelmcp_ and aarrcp_ starts coping operations, executed by the functions rwelm_, rwelmf_, copelm_, elmcpy_, and arrcpy_. All parameters of considered functions, except of the last one, are similar to the same named parameters of their synchronous analogous. The last parameter CopyFlagPtr is the pointer to the flag of completion of the started coping operation.

Waiting for completion of coping is performed by the function

long waitcp_ (AddrType *CopyFlagPtr);

*CopyFlagPtr  flag of coping operation completion, specified when starting the operation.

The function returns zero.

13.4Access to elements of local part of distributed array

Let n be the rank of the distributed array. Then the header of this array in the function crtda_ call with zero value of *ExtHdrSignPtr parameter can be declared for example as:

long ArrayHeader[n+1]; /* standard header */

Let the base pointer corresponding to the type of the elements of the distributed array be BasePtr. Then the element (I1, ... , In) from the local part of the distributed array can be accessed through linear index in the following manner:


BasePtr[

n-1
ArrayHeader[k]*Ik + In + ArrayHeader[n] ]
k=1

For C the value of the base pointer in crtda_ function call may be NULL. In that case the element of the local part of the distributed array may be accessed in the following manner:


( (Type *)ArrayHeader[n] )[

n-1
ArrayHeader[k]*Ik + In ]
,
k=1

where Type is the type of the element of the distributed array.

Run-Time System calculates the coefficients ArrayHeader[1], ... ,ArrayHeader[n-1] and the address constant ArrayHeader[n] in the functions of the array alignment align_ and realn_ in the following manner.

Let:

Ii,init

the initial index value of the local part of the distributed array on the i-th dimension;

Ii,last

the last index value of the local part of the distributed array on the i-th dimension;

LWi

the width of the low shadow edge of the distributed array on the i-th dimension;

HWi

the width of the high shadow edge of the distributed array on the i-th dimension;

ArrayPtr

pointer to the local part of the array (that is the part allocated in the memory together with the shadow edges);

TypeSize

the size of the element of the distributed array (in bytes).

Then:


ArrayHeader[m] =

n
(Ik,last - Ik,init + LWk + HWk + 1)
, 1 m n-1;
k=m+1


ArrayHeader[n] = LWn – In,init +

n-1
( ArrayHeader[m]*(LWm - Im,init) )
;
m=1

ArrayHeader[n] =

ArrayHeader[n]  ( (long)ArrayPtr  (long)BasePtr )/TypeSize


ArrayHeader[n]*TypeSize(long)ArrayPtr

if BasePtr ≠ NULL,

if BasePtr = NULL.

In crtda_ function call with non-zero *ExtHdrSignPtr parameter the distributed array header can be statically specified as

long ArrayHeader[2*n+2]; /* extended header */

Fist (n+1) words of extended header coincide with standard header, considered above. The words from (n+2) to (2*n+1) must be specified by user's program before the array allocating in the memory by align_ (malign) function (it is assumed, that these words will contain low values of distributed array indexes, used in Fortran). When mapping or remapping the array on processor system Run-Time System calculates (n+1)-th word of extended header as


ArrayHeader[n]  ArrayHeader[n+2] 

n
ArrayHeader[n-i+1]*ArrayHeader[n+1+i]

i=2

Note, that Run-Time System allocates (during the execution of the functions align_ and realn_) the local part of the distributed array in the memory in so manner that the difference (ArrayPtr – BasePtr) must be multiple of the TypeSize.

The access to the elements of the local part of the distributed array is performed either directly by its header and the base pointer, or by the functions rlocel_, wlocel_ and clocel_ (that is less effective) described below.

13.4.1Requesting if array element is allocated in local part of distributed array

long tstelm_(

long
long

ArrayHeader[],
IndexArray[] );

ArrayHeader

header of distributed array.

IndexArray

IndexArray[i] is the index of the element of the distributed array by (i+1)-th dimension.

The number of specified indexes has to be equal to the rank of the distributed array.

The function returns non-zero value, if specified element is allocated in the local part of the specified distributed array, and zero in other case.

13.4.2Requesting initial and last index values of local part of distributed array

long locind_(

long
long
long

ArrayHeader[],
InitIndexArray[],
LastIndexArray[] );

ArrayHeader

header of distributed array.

InitIndexArray

array, which i-th element will be assigned by initial value of the index of the local part of distributed array on (i+1)-th dimension.

LastIndexArray

array, which i-th element will be assigned by last value of the index of the local part of the distributed array on (i+1)-th dimension.

The sizes of the arrays InitIndexArray and LastIndexArray must be equal to the distributed array rank.

The function returns non-zero value, if the specified array has a local part and zero in other case. If the array has no the local part, the arrays InitIndexArray and LastIndexArray are not updated.

13.4.3Reading element of local part of distributed array

long rlocel_(

long
long
void

ArrayHeader[],
IndexArray[],
*BufferPtr );

ArrayHeader

a header of the distributed array.

IndexArray

array, which i-th element is index value of read element of the distributed array on (i+1)-th dimension.

BufferPtr

pointer to the memory area, the element will be written in.

The function can be executed successfully only by the processor, in whose memory the specified element is allocated.

The size of distributed array element in bytes (a number of read bytes) is returned.

13.4.4Assigning value to element of local part of distributed array

long wlocel_(

void
long
long

*BufferPtr,
ArrayHeader[],
IndexArray[] );

ArrayHeader

a header of the distributed array.

IndexArray

array, which i-th element is index value of modified element of the distributed array on (i+1)-th dimension.

BufferPtr

pointer to the memory area, where the value is located.

The function can be executed successfully only by the processor, in whose memory the specified element is located.

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

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

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