rtsDDe (1158446), страница 2

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

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

void dvm_FreeStruct (void *StructPtr);

The macrodefinition returns to the free memory the memory block, specified by StructPtr pointer, and assigns NULL to StructPtr pointer. The macrodefinition can be invoked with NULL value of StructPtr pointer.

3Requesting program execution time in the form, independent from hardware and software environment

double dvm_time (void);

The function returns program execution time in seconds. Note that a sense of execution time notion can be different for different environments.

4Requesting internal numbers of functionally provided processors

A user program startup on the processor system requires specifying (as startup parameters) the following characteristics of the processor system as multidimensional array: the processor system rank and sizes of all its dimensions. Let the rank of the processor system be n, and size of k-th dimension be PSSizek (1 k n). Then when Run-Time System is initialized an internal number ProcNumberint will be assigned to the each processor:


ProcNumberint(I1, ... ,In) =

n
(Ik *
k=1

n
PSSizej)
,
j=k+1

where:

Ik

processor index value of k-th dimension of the processor system index space (0 Ik PSSizek 1).

So the internal number is the linear index of the processor in index space of the processor system.

Each processor has also external number ProcNumberext (a processor number in hardware-software environment, where Run-Time System operates). When Run-Time System is initialized, it requests the external number using environment-dependent tools.

In interprocessor exchanges a processor identifier ProcIdent is used as the processor address. The correspondence

ProcNumberint  ProcIdent

is defined by Message Passing System and returned to Run-Time System when it is initialized.

There are three functionally special processors: main processor, input/output processor and central processor among processors, assigned to a task.

The main processor is the first processor, where the parallel program was initialized (a subtask, executed on the processor, is considered as initiator of all other subtasks). The main processor has zero internal number.

Input/output processor is intended to deal with the file system directly and its internal number is zero.

The central processor computes the reduction functions and is defined by an index vector ([PSSize1/2], ... ,[PSSizen/2]).

int rtl_GetCurrentProc(void);

The function returns internal number of the current processor.

int rtl_GetMasterProc(void);

The function returns internal number of the main processor.

int rtl_GetIOProc(void);

The function returns internal number of the input/output processor.

int rtl_GetCentralProc(void);

The function returns internal number of the central processor.

5Message passing tools, independent from base system of message passing

A set of presented below functions serves as interface between Run-Time System itself and used message passing system (MPI, PVM and so on). This set is not belongs to the tools, provided by Run-Time System for user program. Nevertheless, minimal environment-independent set of message passing functions may be useful for test and environment-experimental programs, accompanied with Run-Time System.

The internal processor number is used as processor address in the functions, considered below. This number is substituted for processor identifier (see section 4) when the functions of message passing system are called. It is assumed that the logic of main message passing schemes (synchronous, asynchronous and “NO WAIT scheme) is known.

Memory area for sent or received message should be allocate dynamically by the functions, considered in section 2.

5.1Synchronous message exchange

5.1.1Synchronous sending

int rtl_Send (

void
int
int
int

*MesPtr,
Count,
Size,
ProcNum );

MesPtr

pointer to the message to be sent.

Count

a number of elements in the message.

Size

sent message element size in bytes.

ProcNum

internal number of the processor, the message is sent to.

The function returns non-negative value in the case of success and negative value otherwise.

5.1.2Synchronous receiving

int rtl_Recv (

void
int
int
int

*MesPtr,
Count,
Size,
ProcNum );

MesPtr

pointer to memory area to write received message.

Count

a number of elements in received message.

Size

received message element size in bytes.

ProcNum

internal number of the processor, whose message should be received.

The function returns non-negative value in the case of success and negative value otherwise.

5.2Asynchronous message exchange

5.2.1Asynchronous sending

int rtl_SendA (

void
int
int
int
int

*MesPtr,
Count,
Size,
ProcNum
Tag );

MesPtr

pointer to the message to be sent.

Count

a number of elements in the message.

Size

sent message element size in bytes.

ProcNum

internal number of the processor, the message is sent to.

Tag

class number of sent message (message classification is in a competence of message passing system user).

The function returns non-negative value in the case of success and negative value otherwise.

5.2.2Asynchronous receiving

int rtl_RecvA (

void
int
int
int
int

*MesPtr,
Count,
Size,
ProcNum
Tag );

MesPtr

pointer to memory area to write received message.

Count

number of elements in received message.

Size

received message element size in bytes.

ProcNum

internal number of the processor, whose message should be received.

Tag

class number of received message.

The function returns non-negative value in the case of success and negative value otherwise.

5.3Message exchange in "NO-WAIT" mode

5.3.1Sending in "NO-WAIT" mode

int rtl_Sendnowait (

void
int
int
int
int
RTL_Request

*MesPtr,
Count,
Size,
ProcNum
Tag
*ReqPtr );

MesPtr

pointer to the message to be sent.

Count

number of elements in sent message.

Size

sent message element size in bytes.

ProcNum

internal number of the processor, the message is sent to.

Tag

class number of sent message (message classification is in a competence of message passing system user).

*ReqPtr

structure-flag, that is set in state "request has been performed", when addressee received the message.

The function returns non-negative value in the case of success and negative value otherwise.

5.3.2Receiving in "NO-WAIT" mode

int rtl_Recvnowait (

void
int
int
int
int
RTL_Request

*MesPtr,
Count,
Size,
ProcNum,
Tag,
*ReqPtr );

MesPtr

pointer to memory area to write received message.

Count

number of elements in received message.

Size

received message element size in bytes.

ProcNum

internal number of the processor, whose message should be received.

Tag

class number of received message.

*ReqPtr

structure-flag, which is set in state "request has been performed", when the message will be written by MesPtr address.

The function returns non-negative value in the case of success and negative value otherwise.

5.3.3Waiting for sending or receiving completion

void rtl_Waitrequest(RTL_Request *ReqPtr);

ReqPtr  structure-flag, from which state "request has been performed" is awaited.

5.3.4Requesting sending or receiving completion

int rtl_Testrequest(RTL_Request *ReqPtr);

ReqPtr structure-flag, from which state "request has been performed" is awaited.

The following values are returned:

0

message passing is not completed (*ReqPtr is not set in state "request has been performed");

1

message passing is completed (*ReqPtr is set in state "request has been performed").

5.4Passing message from specified processor to all other processors (broadcast passing)

int rtl_BroadCast (

void
int
int
int
PSRef

*MesPtr,
Count,
Size,
SenderProcNum,
*PSRefPtr );

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

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

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