pppaDDe (1158440), страница 2
Текст из файла (страница 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{ | unsigned long | up, |
| up, next, down | - interval numbers, |
3.2.1Constructor
| CtreeInter( | FILE | *stream, |
| stream | - file descriptor pointer, |
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 { | short | nitem, |
| nitem | - collective operation number, set in module statevnt.c, |
Member functions:
3.3.1Constructor
| CSynchro( | FILE | *stream, |
| stream | - pointer to the file written during DVM-program execution, |
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 | nint, |
| nint | – interval number, |
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 | t, |
| 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 | t, |
| 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.















