Документ взят из кэша поисковой машины. Адрес оригинального документа : http://sp.cs.msu.ru/dvm/dvmhtm1107/eng/sys/perform/pppaDDe.html
Дата изменения: Mon Feb 13 12:59:14 2006
Дата индексирования: Mon Oct 1 23:24:57 2012
Кодировка: Windows-1251
Performance Analyzer. Detailed design

Parallel Program Performance Analyzer (PPPA)
Detailed design
* 21 June 2000 *


Contents

1 Introduction
2 Subsystem for statistics accumulation

2.1 Module statevnt.c
2.2 Module interval.c
2.3 Module statist.c
2.4 Definition of functions used for representation of interval information, general information of support system and times of collective operations

3 Processing subsystem

3.1 Class Cinter, module inter.cpp

3.1.1 Constructor
3.1.2 Destructor
3.1.3 Functions to save characteristics
3.1.4 Functions to read characteristics
3.1.5 Interval identification information reading
3.1.6 Comparison of identification information
3.1.7 Summing time characteristics

3.2 Class CtreeInter, module treeinter.cpp

3.2.1 Constructor
3.2.2 Destructor
3.2.3 Getting constructor result
3.2.4 Error message
3.2.5 Interval tree walking
3.2.6 Summing characteristics of all interval tree

3.3 Class Csynchro, module synchro.cpp

3.3.1 Constructor
3.3.2 Destructor
3.3.3 Getting constructor result
3.3.4 Error message
3.3.5 Calculation of dissynchronization and variation times in the interval
3.3.6 Getting the number of dissynchronization or variation times
3.3.7 Reading the value of dissynchronization or variation time
3.3.8 Reading the value of the nearest dissynchronization and variation time

3.4 Class CstatRead, module statread.cpp

3.4.1 Constructor
3.4.2 Destructor
3.4.3 Number of processors
3.4.4 Input/output processor number
3.4.5 Type of message passing
3.4.6 Tree walking
3.4.7 Getting constructor result
3.4.8 Error message
3.4.9 Read identifire information of interval
3.4.10 Reading time characteristics accorrding to defined processor numbers
3.4.11 Minimal, maxumal and sum time characteristics
3.4.12 Matrix rank
3.4.13 Number of collective operations

3.5 Module statfile.cpp, function main


1 Introduction

The performance analyzer consists of two subsystems - accumulation subsystem and subsystem of information processing.

The first subsystem provides accumulation of execution characteristics of parallel program on each processor. This subsystem is called from Lib-DVM during the parallel program execution. Besides Fortran DVM language have the features for description of intervals of the program execution, for which the user would like to get the performance characteristics. The compiler inserts accumulation subsystem calls at the beginning and the end of each interval. The information from every processor outputs into a file upon the termination of the program.

The second subsystem running on a workstation, processes the information gathered on parallel computer and outputs performance characteristics requested by user.

2 Subsystem for statistics accumulation

Subsystem of statistics accumulation consists of the following modules:

statevnt.c, statist.c, interval.c, strall.h, statist.h, interval.h

These modules are intended for accumulation of following information: DVM-function execution time, DVM-system interval execution time, dissynchronization times of collective operations and time variations. Statistics are written into file, name and length of the file are defined in parameter file. This file is used by performance analyzer to calculate performance characteristics.

2.1 Module statevnt.c

This module is intended for marking DVM-function, the beginning time and completion time of which are to be written into file. These times are used by performance analyzer to calculate dissynchronization characteristics and time variation for each interval.

2.2 Module interval.c

This module contains functions called by converter to create and delete intervals. These functions also provide writing trace of corresponding event into files.

void __callstd binter_(long *nfrag, long *val)
void __callstd bsloop_(long *nfrag)
void __callstd bploop_(long *nfrag)

nfrag - interval number,
nline - line number in the source file,
val - expression value in user interval.

These functions serve for creating intervals of three types: user intervals, parallel intervals and sequential intervals.

void __callstd einter_(long *nfrag, long *nline)
void __callstd eloop_(long *nfrag, long *nline)

These functions serve for closing current interval, the first function closes user interval, the second one closes sequential and parallel intervals. Function prototypes are in file interval.h.

2.3 Module statist.c

Functions of the module provide direct creation of intervals, searching them in buffer, deleting intervals and writing both interval information and synchronization times into file. External function definitions are in file statist.h.

The support system calls the following functions during task execution:

void stat_init(void) - the function fills buffer with zeros, initiates variables, writes support system information (for example the number of processors) at the beginning of the buffer and creates an interval for the whole program.
void stat_done(void) - the function closes the whole program interval. If there is no enough space in buffer for intervals or for times of collective operations then the function outputs error message.
void stat_event(int numbevent) - the function writes times of beginning and completion of collective operations at the end of the buffer. Parameters ‘numbevent’ is a situation number.

Interval is identified by line number, by the name of source file and by expression value in case of user interval. The line number and file name are saved in external variables DVM_LINE[0] and DVM_FILE[0], expression value is passed as parameters. References to higher level interval, to lower level interval and to the next interval of the same level are saved for the interval. Interval is considered as current in the following cases: if it has been created last; if it has been found in the list of intervals of corresponding level and its identifier values are equal to the given ones; in case interval is closed the interval of higher level becomes current.

The following functions serves for creating searching and deleting intervals.

void CreateInter(int typef,long val) - the function allocates record (fields are described below) in buffer. Parameter ‘typef’ is interval type, ‘val’ is the value of expression defined in interval created in program by means of language. Newly created interval becomes current, DVM-function execution times are written in the current interval. If there is no enough space in buffer interval is created in memory.
int FindInter(long val) - the function is intended for searching interval. This function is called before creating interval function. The function returns 1- interval is found, 0 - interval is not found.
void EndInter(long nline) - closing current interval, parameter ‘nline’- line number of the beginning of the interval - is passed for the control.
void FreeInter(void) - free memory function. The function is called at the end of execution when messages about lack of the buffer space are writing.

2.4 Definition of functions used for representation of interval information, general information of support system and times of collective operations

These definitions are in file strall.h. The file is used at the second stage by processing subsystem.

#define SZSH sizeof(short)
#define SZL sizeof(long)
#define SZINT sizeof(int)
#define SZD sizeof(double)
#define SZV sizeof(void*)

General information structure written at the beginning of each buffer.

typedef struct tvms_ch { unsigned char reverse[SZSH]
    rank[SZSH],
    maxnlev[SZSH],
    szsh[SZSH],
    szl[SZSH],
    szv[SZSH],
    szd[SZSH],
    smallbuff[SZSH]
    proccount[SZL],
    mpstype[SZL],
    ioproc[SZL],
    qfrag[SZL],
    pbuffer[SZV],
    lbuf[SZL],
    linter[SZL],
    lsynchro[SZL]
} *pvms_ch;    
   
reverse - information was collected not at workstation,
rank - matrix rank,
maxnlev - maximal nesting level,
szsh - size of short,
szl - size of long,
szv - size of void*,
szd - size of double,
smallbuff - no space in file,
proccount - number of processors,
mpstype - type of message passing,
ioproc - input/output processor number,
qfrag - number of intervals,
pbuffer - pointer to the buffer,
lbuf - buffer size,
linter - size in bytes of all interval records,
lsynchro - size in bytes of synchronization time records.

Interval structure.

At the end of each interval source file name is written.

typedef struct tinter_ch {











}*pinter_ch;
unsigned char
type[SZSH],
nlev[SZSH],
nenter[SZD],
nline[SZL],
valvar[SZL],
qproc[SZL],
ninter[SZL],
up[SZV],
next[SZV],
down[SZV],
ptimes[SZV],
times[3*StatGrpCount*StatGrpCount][SZD];
   
type - interval type,
nlev - nesting level number,
enter - number of interval entries,
nline - user program line number,
alvar - expression value,
qproc - number of processors, on which interval was executed,
ninter - interval number,
up - pointer to an interval of higher level,
next - pointer to next interval of the same level,
down - pointer to an interval of lower level,
ptimes - pointer to time array, saved by system,
times - time array.

Structure of time of collective operation.

typedef struct tsyn_ch {



}*psyn_ch;
unsigned char
nitem[SZSH],
ninter[SZL],
pgrp[SZV],
time [SZD]
   
nitem - collective operation number,
ninter - current interval number,
pgrp - reference to operation group,
time - time when situation happen.

3 Processing subsystem

This tool consists of the following modules: inter.cpp, treeinter.cpp, synchro.cpp, statread.cpp, statfile.cpp. Header files: inter.h, treeinter.h, synchro.h, statread.h, strall.h, bool.h, sysstat.h. Function main is in statfile.cpp module and may have seven parameters (the first two parameters are required). Parameters: name of file where information has been saved during program execution; name of file for processing information; three symbols y/n indicating output of general, comparative and basic characteristics; maximal level of nesting intervals; list of processor numbers for which basic characteristics are to be output.

3.1 Class Cinter, module inter.cpp

This class contains member functions and member data for processing interval time characteristics.

enum typegrp {COM,RCOM,SYN,VAR,OVERLAP,CALL};
enum typecom {IO,RD,SH,RA,RED};
enum typetime {LOST, INSUFUSR, INSUF, IDLE, SUMCOM, SUMRCOM, SUMSYN, SUMVAR, SUMOVERLAP, IMB, EXEC, CPUUSR, CPU, IOTIME, START, PROC, ITER};
   
typedef struct tident {





}ident;
char
unsigned long
unsigned long
short
long
double
typefrag
*pname,
nline,
proc;
nlev,
expr,
nenter,
t
   
pname - name of source file where interval is defined,
nline - line number in the source file,
proc - the number of processors where interval was executed,
nlev - nesting level number,
expr - expression value,
nenter - number of interval entries,
t - interval type.
   
double mgen[ITER+1] - time array, to output characteristics for processors,
double mcom[RED+1] - array of passing message times in collective operations,
double mrcom[RED+1] - array of times of real dissynchronization,
double msyn[RED+1] - array of dissynchronization times,
double mvar[RED+1] - time variation array,
double moverlap[RED+1] - array of operation overlapping,
double mcall[RED+1] - number of collective operation calls,
Ident idint - interval identifier information.

3.1.1 Constructor

Cinter ( S_GRPTIMES
ident
unsigned long
(*pt)[StatGrpCount],
p,
nint);
   
(*pt)StatGrpCount - pointer to time array read from file,
p - interval identifier,
nint - interval number.

Serve for writing interval identifier values and some characteristics which values are in file.

3.1.2 Destructor

~CInter(void); - Free source file name memory.

3.1.3 Functions to save characteristics

void AddTime(typetime t2,double val);
void WriteTime(typetime t2,double val);
void AddTime(typegrp t1,typecom t2,double val);

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.4 Functions 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.5 Interval identification information reading

void ReadIdent(ident **p);

Set pointer equal to interval identifier address.

3.1.6 Comparison 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.7 Summing 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.2 Class CtreeInter, module treeinter.cpp

This class is intended for working with intervals collected on one processor. It contains the following member