PPPA_DD (1158359)
Текст из файла
Parallel Program Performance Analyzer
Detailed design
April 17, 1999
Keldysh Institute of Applied Mathematics
Russia Academy of Sciences
Contents
1 Introduction 2
2 Subsystem for statistics collection. 2
2.1 Module statevnt.c. 2
2.2 Module interval.c. 3
2.3 Module statist.c. 3
2.4 Definition of functions used for representation of interval information, general information of support system and times of collective operations. 4
3 Processing subsystem. 5
3.1 Class Cinter, module inter.cpp. 5
3.2 Class CtreeInter, module treeinter.cpp. 6
3.3 Класс Csynchro, module synchro.cpp. 7
3.4 Class CstatRead, module statread.cpp. 8
3.5 Module statfile.cpp, function main. 10
1Introduction
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.
2Subsystem for statistics collection.
Subsystem of statistics collection consists of the following modules:
statevnt.c, statist.c, interval.c,strall.h, statist.h,interval.h.
These modules are intended for collection 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.1Module 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.2Module 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.3Module 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:
Stat_init, stat_done, stat_event.
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.4Definition 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[SZL] information was collected not at workstation.
rank[SZSH], - matrix rank
maxnlev[SZSH], - maximal nesting level
szsh[SZSH], - size of short
szl[SZSH], - size of long
szv[SZSH], size of void*
szd[SZSH], - size of double
proccount[SZL], - number of processors
mpstype[SZL], - type of message passing
ioproc[SZL], - input/output processor number
qfrag[SZL], - number of intervals
pbuffer[SZV], - pointer to the buffer
lbuf[SZL], - buffer size
linter[SZL], - size in byte of all interval records
lsynchro[SZL]; - size in byte of synchronization time records
} *pvms_ch;
Interval structure .
At the end of each interval source file name is written.
typedef struct tinter_ch {
unsigned char type[SZSH], - interval type
nlev[SZSH], - nesting level number
nenter[SZD], - number of interval entries
nline[SZL], - user program line number
valvar[SZL], - expression value
qproc[SZL], - number of processors, on which interval was executed
ninter[SZL], interval number
up[SZV], - pointer to an interval of higher level
next[SZV], - pointer to next interval of the same level
down[SZV], - pointer to an interval of lower level
ptimes[SZV], - pointer to time array, saved by system
times[3*StatGrpCount*StatGrpCount][SZD]; - time array
}*pinter_ch;
Structure of time of collective operation.
typedef struct tsyn_ch {
unsigned char nitem[SZSH], - collective operation number
ninter[SZL], - current interval number
time[SZD]; - time when situation happen.
}*psyn_ch;
3Processing 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.1Class Cinter, module inter.cpp.
This class contains member functions and member data for processing interval time characteristics.
enum typegrp {COM,RCOM,SYN,VAR,CALL};
enum typecom {IO,SR,WR,SSH,WSH,RACC,RED};
enum typetime {LOST,INSUFUSR,INSUF,IDLE,SUMCOM,SUMRCOM,SUMSYN,SUMVAR,
REDOVERLAP,SHADOVERLAP,EXEC,CPUUSR,CPU,IOTIME,IMB,PROC,ITER};
typedef struct tident {
char *pname; - name of source file where interval is defined,
unsigned long nline, - line number in the source file,
unsigned long proc; - the number of processors where interval was executed,
short nlev; - nesting level number,
long expr; - expression value,
double nenter; - number of interval entries,
typefrag t; - interval type.
}ident;
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 mcall[RED+1]; - number of collective operation calls,
ident idint; - interval identifier information.
3.1.1Constructor.
CInter (s_GRPTIMES (*pt)[StatGrpCount],ident p,unsigned long nint);
s_GRPTIMES (*pt)[StatGrpCount] – pointer to time array read from file,
ident p – interval identifier,
unsigned long nint – interval number.
Serve for writing interval identifier values and some characteristics which values are in file.
3.1.2Destructor.
3.1.3~CInter(void);
Free source file name memory.
3.1.4void AddTime(typetime t2,double val);
3.1.5void WriteTime(typetime t2,double val);
3.1.6void 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.7void ReadTime(typegrp t1,typecom t2,double &val);
3.1.8void 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.9void ReadIdent(ident **p);
Set pointer equal to interval identifier address.
3.1.10int 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.11void 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,next,down; - interval numbers,
Характеристики
Тип файла документ
Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.
Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.
Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.















