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

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

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

The function getrnk_ returns the rank of the object, defined by the reference *ObjectRefPtr.

The following entities can be used as objects:

  • a distributed array (in that case the reference is the first word of the array header);

  • a representation of the abstract machine;

  • a processor system;

  • map of the abstract machine representation;

  • map of the distributed array;

  • a parallel loop.

If the reference *ObjectRefPtr is not a reference to any of the mentioned above objects, then the function returns zero.

For the map (of array or abstract machine representation) the rank of the object, that is the source for the map, is returned.

17.2Requesting size of object dimension

long getsiz_(

ObjectRef
long

*ObjectRefPtr,
*AxisPtr );

The function returns the size of the dimension *AxisPtr of the object, defined by the reference *ObjectRefPtr.

The following entities can be used as objects:

  • distributed array (in that case the reference to the object is the first word of the array header);

  • the representation of the abstract machine;

  • the processor system;

  • parallel loop.

The size of the distributed array dimension is equal to

ceil( (LastIndex - InitIndex + 1) / Step ) ,

where:

InitIndex

initial value of the index variable of the parallel loop for the dimension *AxisPtr;

LastIndex

last value of the index variable of the parallel loop for the dimension *AxisPtr;

Step

step of the index variable of the parallel loop for the dimension *AxisPtr;

ceil

a function to get the least integer, not less than value of its argument.

If *AxisPtr = 0, the size of the object (product of sizes of all dimensions) is returned.

If the reference *ObjectRefPtr is not a reference to any of the mentioned above objects, then the function returns zero.

long locsiz_(

ObjectRef
long

*ObjectRefPtr,
*AxisPtr );

The function locsiz_ is similar to the function getsiz_, but it returns the local size of dimension *AxisPtr (or the local size of the object), i.e. the size of the object part, mapped on the current processor. If the object is a processor system, then the values, returned by the functions getsiz_ and locsiz_ are the same.

Note, that a local size of the object, having no a local part on the current processor, is equal to zero.

17.3Requesting if object is distributed array

long tstda_ (ObjectRef *ObjectRefPtr);

The function tstda_ allowes to determine whether the object, specified by the reference *ObjectRefPtr, is a distributed array.

The following values are returned:

0  the object is not a distributed array;

1  the object is a distributed array;

2  the object is a fully replicated distributed array.

17.4Requesting size of distributed array element

long getlen_ (long ArrayHeader[]);

ArrayHeader  header of the distributed array.

The function getlen_ returns the size in bytes of element of specified distributed array in bytes.

17.5Deleting object

long delobj_(ObjectRef *ObjectRefPtr);

*ObjectRefPtr  reference to the deleted object.

It is possible to use the followings as an object:

  • distributed array (in that case the reference is the first word of the header of the array);

  • the representation of the abstract machine;

  • the processor system;

  • map of abstract machine representation;

  • map of distributed array;

  • reduction variable;

  • reduction group;

  • shadow edge group;

  • remote element buffer of regular access;

  • group of remote element buffers of regular access;

  • remote element buffer of non-regular access;

  • group of remote element buffers of non-regular access.

The object can be deleted by delobj_ function only if it was created in the current subtask and in the current program block (or its sub-block) (see sections 8 and 10).

The function returns zero.

17.6Requesting whether current processor is I/O processor

long tstio_(void);

The function returns 1 if the current processor is the I/O processor, and returns zero in another case.

17.7Sending memory areas of I/O processor

long srmem_(

long
AddrType
long

*MemoryCountPtr,
StartAddrArray[],
LengthArray[] );

*MemoryCountPtr

the number of the sent areas of the memory.

StartAddrArray

array, which i-th element is the start address of (i+1)-th area (adjusted to AddrType type).

LengthArray

array, which i-th element is the size of the (i+1)-th area (in bytes).

The function srmem_ sends the memory areas of the I/O processor to another processors. During this operation the I/O processor sends the data, and the other processors receive the data. The number of the parameters in the arrays LenghtArray and StartAddrArray has to be equal to *MemoryCountPtr. The length of the each sent area has not to exceed the maximum of the positive integer (LengthArray[i] (unsigned int)-1 >> 1).

The function returns zero.

To transform an address acceptable for the function srmem_, Run-Time System has the function

AddrType dvmadr_(void *VarPtr);

This function is intended for usage in Fortran.

The following functions can be also used for Fortran variables of different types:

AddrType

getash_

(void *VarPtr);

AddrType

getai_

(void *VarPtr);

AddrType

getal_

(void *VarPtr);

AddrType

getaf_

(void *VarPtr);

AddrType

getad_

(void *VarPtr);

AddrType

getac_

(void *VarPtr);

AddrType

getach_

(void *VarPtr, long StrLength);

These functions are similar to the function dvmadr_ (parameter VarPtr is the address of text string, and StrLength is its size, formed by Fortran compiler).

The functions srmem_ and dvmadr_ (getash_, getai_, getal_, getaf_, getad_, getac_, getach_) can be used for implementation of input/output operations.

18Using Run-Time System in Fortran language

To coordinate allocation of the arrays in the memory, (along the columns in the Fortran , and along the rows in the C) inverse order of specifying the array indexes (in comparison with the order in the C ) is required. In addition, in this document it is supposed that the initial array index value is equal to zero, that is conformed to the C language. In the Fortran language this index is equal to 1.

Data types (except C base types, DVMFILE* and DVMHANDLE*) used in Run-Time System functions are defined as "unsigned long". They can be used only in assignment operators and as actual parameters in function and subroutine calls.

Each C base type, used in Run-Time System function calls, must have equivalent representation as some construction of Fortran language. Checking correctness of C base data type in Fortran is implemented by the representation size using the function

void tpcntr_(

long
AddrType AddrType
long
long

*ElmNumberPtr,
FirstAddrArray[],
NextAddrArray[],
TypeLengthArray[],
TypeCodeArray[] );

*ElmNumberPtr

a number of elements, specified in FirstAddrArray, NextAddrArray, TypeLengthArray and TypeCodeArray arrays.

FirstAddrArray, NextAddrArray


arrays, which i-th elements contain addresses of two adjacent elements of the type with TypeCodeArray[i] number (in Fortran representation).

TypeLengthArray

array, which i-th element contains supposed size of the type with TypeCodeArray[i] number.

TypeCodeArray

array, which contains numbers (codes) of C data types to be checked.

The function tpcntr_ assumes the following numeration of C types:

  1. "int";

  2. "long";

  3. "float";

  4. "double";

  5. "char";

  6. "short".

If while executing tpcntr_ function it will be detected, that the length of data of the type with TypeCodeArray[i] number is not equal to the difference (NextAddrArray[i] – FirstAddrArray[i]) or TypeLengthArray[i] value, the user program is terminated with diagnostics, which contains:

  • i value;

  • actual and assumed sizes of TypeCodeArray[i]-th type data;

  • difference (NextAddrArray[i] – FirstAddrArray[i]).

The tpcntr_ function call must precede Run-Time System initialization from Fortran program by linit_ function (see section 2).

Example.

integer getac, getash, getai, getal, getaf, getad, linit

integer dvm

integer faddr(8), naddr(8), tlen(8), tcode(8)

integer tint(2)

logical tlog(2)

character*1 tchar (2)

real tfloat (2)

double precision tdouble (2)

integer*2 tint2 (2)

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

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

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