PPPA_DD (1158359), страница 2
Текст из файла (страница 2)
int sign; - a sign that interval has been already passed during interval walking,
CInter *pint;- pointer to class Cinter.
} ptree;
ptree (*pt); - pointer to structure array.
3.2.1Constructor
CTreeInter(FILE *stream,int lint,char* pbuffer,unsigned int n,
unsigned long qfrag,short maxn);
reads interval information collected on processors from the file written at the end of DVM-program execution.
Parameters:
FILE *stream, - file descriptor pointer,
int lint, - information length in bytes,
char* pbuffer,- beginning of the buffer at the collection stage,
unsigned int n, - processor number,
unsigned long qfrag,- number of intervals,
short maxn – 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
3.2.3~CTreeInter();
Free structure array memory.
3.2.4BOOL Valid();
The member function analyzes result of constructor execution. It returns TRUE if constructor execution completed successfully, otherwise it returns FALSE.
3.2.5void TextErr(char *t);
The member function receives error messages if function Valid() returned FALSE.
3.2.6void BeginInter(void);
3.2.7void NextInter(ident **id);
3.2.8CInter *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.9void SumLevel(void)
The member function sums up temporal characteristics of low level intervals with high level intervals for all interval tree.
3.3Класс Csynchro, module synchro.cpp.
The class is intended for saving dissynchronization time values and time variation values.
typedef struct tsyn {
short nitem;- collective operation number, set in module statevnt.c
unsigned long ninter; - current interval number, at the moment when situation arise,
double time; - time when situation arise,
}psyn;
psyn *ps; - pointer to dissynchronization structure array.
Member functions:
3.3.1CSynchro(FILE *stream,int l);
Reading times of collective operations from file.
FILE *stream, - pointer to the file written during DVM-program execution.
int l – length of written information.
3.3.2~CSynchro();
Free requested memory.
3.3.3BOOL Valid();
The member function returns TRUE if constructor finished successfully, otherwise it returns FALSE.
3.3.4void TextErr(char *t);
The member function output error message.
3.3.5void Count(unsigned long nint);
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.
unsigned long nint – interval number.
3.3.6int GetCount(short type);
The member function returns number of dissynchronizations for the given type of collective operations.
3.3.7double Find(short nitem);
double FindDel(short nitem);
The functions serves for getting dissynchronization time and time variation for collective operation. FindDel set also flag that the collective operation has been processed,
short nitem – collective operation number.
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.1CStatRead(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.2~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.3unsigned long QProc(void);
The member function returns number of processors on which the program has been executed.
3.4.4unsigned long IOProc(void);
The member function returns input/output processor number.
3.4.5tmps MPSType(void);
The function returns type of message passing.
3.4.6int 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.7BOOL Valid(void);
The member function returns TRUE if constructor completed successfully, otherwise it returns FALSE.
3.4.8void TextErr(char *t);
The function writes error message at pointer ‘t’.
3.4.9void ReadTitle(char * p);
char *p – pointer to a symbol string where interval identifying header is written.
3.4.10BOOL ReadProc(typeprint t,unsigned long *pnumb,int qnumb,double sum,char *str);
typeprint t, - type of information of characteristics for each processor,
unsigned long *pnumb, - pointer to array of processor numbers, for which characteristics are to be output,
int qnumb,- number of elements of processor number array,
double sum,- total characteristic value for each processor,
char *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.11void MinMaxSum(typeprint t,double *min,unsigned long *nprocmin,
double*max,unsigned long *nprocmax, double *sum);
typeprint t, - characteristic type,
double *min, - pointer to array of minimal characteristic values,
unsigned long *nprocmin,- pointer to processor number array, corresponding to minimal values,
double*max, - pointer to array of maximal characteristic values,
unsigned long *nprocmax, - pointer to processor number array, corresponding to maximal values,
double *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.12void VMSSize(char *p);
char *p – pointer to string where matrix rank is written for the matrix on which the program was executed.
3.4.13long 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.















