pppaDDe (1158440), страница 2

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

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

These member functions write or add up new time characteristic values. The first function AddTime and function WriteTime are intended for processing ‘mgen’ array, the first parameter is index number and the second parameters is value itself. The second function AddTime is working with the rest of arrays, parameter ‘t1’ indicates array, parameter ‘t2’ is array index value, parameter ‘val’ is value.

3.1.4Functions to read characteristics

void ReadTime(typegrp t1,typecom t2,double &val);
void ReadTime(typetime t2,double &val);

These member functions read time characteristic values. Parameters are the same as for writing but last parameter is passed as reference.

3.1.5Interval identification information reading

void ReadIdent(ident **p);

Set pointer equal to interval identifier address.

3.1.6Comparison of identification information

int CompIdent(ident *p);

Compare current interval identifier with interval identifier from other processor, parameter ‘p’ is pointer to interval identifier. If identifiers are fully matching (all structure elements are equal ) the function returns 1, otherwise it returns 0.

3.1.7Summing time characteristics

void SumInter(CInter *p);

This member function sum up interval characteristic values with characteristic values of interval of higher level. Parameter ‘p’ – pointer to higher level interval.

3.2Class CtreeInter, module treeinter.cpp

This class is intended for working with intervals collected on one processor. It contains the following member data: ‘nproc’ – processor number; ‘qinter’ – number of intervals; ‘curninter’ – current interval number; ‘maxnlev’ – maximal nesting level number; pointer to dynamic structure array containing interval numbers of lower level, higher level or the same level.

typedef struct ttree{




} ptree;

unsigned long


int
Cinter

up,
next,
down,
sign,
*pint

up, next, down
sign
*pint
ptree (*pt)

- interval numbers,
- a sign that interval has been already passed during interval walking,
- pointer to class Cinter,
- pointer to structure array.

3.2.1Constructor

CtreeInter(

FILE
int
char*
unsigned int
unsigned long
short

*stream,
lint,
pbuffer,
n,
qfrag,
maxn);

stream
lint
pbuffer
n
qfrag
maxn

- file descriptor pointer,
- information length in bytes,
- beginning of the buffer at the collection stage,
- processor number,
- number of intervals,
- maximal nesting level.

This member function allocates array of structures of the given interval tree, fills it and calls class constructor Cinter with interval characteristics read from file.

3.2.2Destructor

CTreeInter(); - free structure array memory.

3.2.3Getting constructor result

bool Valid();

The member function analyzes result of constructor execution. It returns TRUE if constructor execution completed successfully, otherwise it returns FALSE.

3.2.4Error message

void TextErr(char *t);

The member function receives error messages if function Valid() returned FALSE.

3.2.5Interval tree walking

void BeginInter(void);
void NextInter(ident **id);
CInter *FindInter(ident *id);

The member functions are intended for interval walking. Parameter *id is pointer to interval identifier. Interval walking is made in the same order as interval filling at the stage of collection. Function FindInter finds interval with identification values given in parameter, if interval is not found the function returns NULL.

3.2.6Summing characteristics of all interval tree

void SumLevel(void);

The member function sums up temporal characteristics of low level intervals with high level intervals for all interval tree.

3.3Class Csynchro, module synchro.cpp

The class is intended for saving dissynchronization time values and time variation values.

typedef struct tsyn {



}psyn*ps;

short
unsigned long
void
double

nitem,
ninter,
*pgrp,
time

nitem
ninter
pgrp
time
psyn

- collective operation number, set in module statevnt.c,
- current interval number, at the moment when situation arise,
- reference to operation group,
- time when situation arise,
- pointer to dissynchronization structure array.

Member functions:

3.3.1Constructor

CSynchro(

FILE
int

*stream,
l);

stream
l

- pointer to the file written during DVM-program execution,
- length of written information.

Reading times of collective operations from file.

3.3.2Destructor

~CSynchro(); - free requested memory.

3.3.3Getting constructor result

bool Valid();

The member function returns TRUE if constructor finished successfully, otherwise it returns FALSE.

3.3.4Error message

void TextErr(char *t);

The member function output error message.

3.3.5Calculation of dissynchronization and variation times in the interval

void Count(

unsigned long
short

nint,
waserr);

nint
waserr

– interval number,
– no space in file to save dissynchronization times.

The member function calculates the number of dissynchronizations and time variation for interval of given number for each type of collective operations. Interval of given number becomes current. The following member functions return values for the current interval.

3.3.6Getting the number of dissynchronization or variation times

int GetCount(typecollect nitem);

typecollect nitem – type of collective operation.

The member function returns number of dissynchronizations for the given type of collective operations.

3.3.7Reading the value of dissynchronization or variation time

double Find(typecollect nitem);
double GetCurr(void);

The functions serves for getting dissynchronization time and time variation for collective operation. Function Find() searches a new time value for the current interval and function GetCurr() reads this current value.

3.3.8Reading the value of the nearest dissynchronization and variation time

double FindNearest(typecollect nitem);

The function searches the dissynchronization time of the start of completing of the waiting operation nearest to the current time set by Find() function. The function is used for operation time overlapping calculation.

3.4Class CstatRead, module statread.cpp

The class serves for reading support system information from file, calls all class constructors listed above, provides interval walking for all interval collected on all processors, calculates some temporal characteristics and writes them into corresponding intervals, finds maximal, minimal and total values of those characteristics.

Member functions:

3.4.1Constructor

CStatRead(const char *name);

const char *name – file name.

The constructor serves for reading support system information from file and calls constructors of other classes to write information from the file into its own structures.

3.4.2Destructor

~CStatRead(void);

The member function calls destructors of other classes and free memory allocated for its dynamic arrays to store pointers to these classes.

3.4.3Number of processors

unsigned long QProc(void);

The member function returns number of processors on which the program has been executed.

3.4.4Input/output processor number

unsigned long IOProc(void);

The member function returns input/output processor number.

3.4.5Type of message passing

tmps MPSType(void);

The function returns type of message passing.

3.4.6Tree walking

int BeginTreeWalk(void);

int TreeWalk(void);

These member functions serve for interval tree walking and return the number of intervals which have the same identification values.

3.4.7Getting constructor result

bool Valid(void);

The member function returns TRUE if constructor completed successfully, otherwise it returns FALSE.

3.4.8Error message

void TextErr(char* t);

The function writes error message at pointer ‘t’.

3.4.9Read identifire information of interval

void ReadTitle(char* p);

char *p – pointer to a symbol string where interval identifying header is written.

3.4.10Reading time characteristics accorrding to defined processor numbers

bool ReadProc(

typeprint
unsigned long
int
double
char*

t,
*pnumb,
qnumb,
sum,
str);

t

- type of information of characteristics for each processor,

pnumb

- pointer to array of processor numbers, for which characteristics are to be output,

qnumb

- number of elements of processor number array,

sum

- total characteristic value for each processor,

str

- string where characteristic name and time values are written.

The member function serves for output of program execution characteristics on each processor, returns TRUE when there is no more characteristic of given type.

3.4.11Minimal, maxumal and sum time characteristics

void MinMaxSum(

typeprint
double*
unsigned long*
double*
unsigned long*
double*

t,
min,
nprocmin,
max,
nprocmax,
sum);

t

- characteristic type,

min

- pointer to array of minimal characteristic values,

nprocmin

- pointer to processor number array, corresponding to minimal values,

max

- pointer to array of maximal characteristic values,

nprocmax

- pointer to processor number array, corresponding to maximal values,

sum

- pointer to array of total characteristic values.

The member function is intended for calculation of minimal, maximal and total characteristics, it is used for output of comparative characteristics.

3.4.12Matrix rank

void VMSSize(char *p);

char *p – pointer to string where matrix rank is written for the matrix on which the program was executed.

3.4.13Number of collective operations

long ReadCall(typecom t);

typecom t – collective operation type.

It returns number of collective operation calls of the given operation type.

3.5Module statfile.cpp, function main

The function reads parameters, calls constructor CstatRead(…) to read saved times and intervals from the file, outputs requested characteristics into the file. Characteristics with zero value are not output.

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

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

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