debugUGe (1158415)
Текст из файла
37
Keldysh Institute of Applied Mathematics
Russian Academy of Sciences
Debugging DVM-programs
User's guide
April, 2000
Contents
1 Introduction 4
2 What is DVM-program? 4
3 Error kinds in DVM-program 4
4 Dynamic control of DVM-directives 5
5 Comparison of execution results 6
6 System trace accumulation tools and its examining 6
7 DVM-system tuning 7
8 Options of converters 8
8.1 Converter options controlling program execution modes 8
8.2 Options of converters for dynamic debugger 8
8.3 Options of converters for performance analysis 8
9 DVM-system commands 9
9.1 Programs, using libraries of sequential programs 12
10 Methods of debugging DVM-programs 12
10.1 Debugging ordinary sequential program 13
10.2 Obtaining debug versions of DVM-program for sequential and parallel execution 13
10.3 Program execution in mode of dynamic control of DVM-directives 13
10.4 Accumulation of DVM-program reference trace file 13
10.5 Comparing reference trace with results of parallel program execution on single processor 14
10.6 Comparing parallel execution trace with reference one 15
10.7 Accumulating parallel program trace 16
10.8 Parallel execution with real data 16
10.9 Estimating trace size 17
10.10 Controlling size of trace file 17
10.11 Program startup with non-standard parameter set 19
11 Parameters of DVM-system 19
11.1 The parameters of dynamic control 20
11.2 Parameters of trace accumulation and comparison 21
11.3 Parameters of standard data streams redirection and Run-Time Library informational messages output control 23
11.4 Parameters controlling system tracing 24
11.4.1 Enabling and disabling tracing 24
11.4.2 Specifying opened (enabled) trace streams 25
11.4.3 Specifying trace modes 25
11.4.4 Controlling form of accumulated information 26
11.4.5 Controlling internal self-checking Run-Time Library mechanisms, functioning during trace accumulation 26
11.4.6 Controlling output of additional information when tracing some Run-Time Library functions in extended mode 27
12 Diagnostics messages of dynamic debugger 28
12.1 Dynamic control 28
12.2 Trace accumulation and comparison 29
13 Structure of trace configuration file 30
14 Execution trace structure 30
15 Error messages of Run-Time Library 32
15.1 Start and completion errors 32
15.2 Errors of the type «... is not a DVM object» 33
15.3 Errors of the type «[the object] is not a/the …» 33
15.4 Errors of the type «… is not a subsystem of the current/parental PS» 34
15.5 Errors of the type «…was not created by the current subtask» and «…was not started by the current subtask» 34
15.6 Errors of the type «…has not been aligned/mapped» and…has already been aligned/mapped»; «…does not exist» and…already exists» 34
15.7 Errors of the type «… has already been started»; «… has not been started/completed»; «… the reduction group is empty» 35
15.8 Index and value errors 35
15.9 Other semantic errors 36
15.10 Memory allocation and the number of objects errors 36
15.11 Errors of low level message passing 37
15.12 Errors of low level usage of RTL 37
16 Structure of system trace file 37
1Introduction
C-DVM and Fortran-DVM languages (F-DVM below) are intended for the development of portable and efficient parallel computational applications for different architecture computers. They are extensions of standard C and Fortran 77 languages. A parallel program is a usual sequential program, expanded by DVM-directives, defining its parallel execution. DVM-directives are transparent for usual compilers, so the compilers process DVM-program as usual sequential program.
The following approach is used to debug DVM-programs.
First, the program is debugged on a workstation as a sequential program (in the mode of ignoring DVM-directives) using ordinary debugging methods and tools. Then the program is executed at the workstation in the special mode of dynamic control of DVM-directives that allows verifying the correctness and fullness of the DVM-directives. At the next step the program can be executed at a parallel computer of a cluster of workstations (or on the workstation with simulation of parallel execution) in the mode of comparison its intermediate results with the reference ones obtained, for example, as a result of its sequential execution. Moreover, to localize errors during parallel program execution the tools for an accumulation of the trace information are provided.
2What is DVM-program?
DVM-program is one or several source files in C-DVM or F-DVM languages having .cdv and .fdv extensions respectively.
Ready-to-run program (executable file) is obtained in three steps:
-
converting C-DVM or F-DVM program to C or Fortran program and obtaining as a result the same named file (files) having extensions .c or .f respectively;
-
compiling obtained on the previous step file (files) using standard C or Fortran compilers;
-
linking obtained object module (modules) with program libraries (if it is required) and Lib-DVM library, that is Run-Time Library for parallel DVM-program execution.
3Error kinds in DVM-program
DVM-program can contain errors of different kinds. The errors can be subdivided on several classes by degree of their influencing on program robustness, by the easiness to detect and so on.
Generally, the following five classes of errors can be distinguished in DVM-program:
-
Errors in sequential program.
-
Syntax errors in DVM directives (incorrect usage of a statement, missing of brackets and so on) and violation of static semantics also.
-
Incorrect order of DVM directives execution or invalid parameters of DVM directives.
-
Wrong computation due to DVM directive incorrectness and errors, not detected when program was executed in sequential mode.
-
Abnormal termination of parallel program (abend, infinite loops, hanging up) due to DVM directive incorrectness and errors, not detected when program was executed in sequential mode.
The errors of the first class are detected by:
-
standard C or Fortran compilers when a program is compiled in the mode of ignoring DVM-directives;
-
debugging tools used for ordinary sequential programs.
The errors of the second class are detected while converting C-DVM or F-DVM programs (see sections 8 and 9). A list of diagnostics messages is presented in the C-DVM and F-DVM compiler (converter) user guides respectively.
The errors of the third class are detected by Lib-DVM library when the program is executed in parallel mode. Lib-DVM functions check the correctness of DVM-directives order and passed parameters (the errors, detected by Lib-DVM functions, are considered in section 15).
The errors of fourth class are detected by DVM-debugger when
-
DVM-program is executed on a single processor in dynamic control mode (see section 4),
-
DVM-program is executed on a single or several processors in the mode of comparison of results of its parallel execution with reference ones, obtained as a result of its sequential execution (see section 5).
The errors of the fifth class can be detected by:
-
examining the execution trace when the program is executed in parallel mode (see section 5);
-
examining accumulated system trace, that is the trace of Lib-DVM function calls (see section 6).
4Dynamic control of DVM-directives
Dynamic control of DVM-directives allows verifying correctness of the program parallization by DVM-directives. The dynamic control is based on simulation of DVM-program parallel execution during its sequential execution on a single processor.
For dynamic control a program should be compiled in a mode of obtaining debug version of the parallel program (see sections 8 and 9).
However using this method essentially degrades the program execution and requires considerable additional memory resources. Therefore the program is recommended to debug using test data.
The dynamic control allows detecting the following kinds of errors:
-
Undeclared cross-iteration data dependencies in a parallel loop.
-
Using non-initialized private variables inside or outside of a parallel loop.
-
Modification of read-only variables.
-
Using reduction variables after an asynchronous reduction start but before its completion.
-
Undeclared access to non-local elements of a distributed array.
-
Writing to shadow edges of a distributed array.
-
Reading shadow elements before their update completion.
-
Modifying non-local element of a distributed array in sequential part of the program.
-
Violation of a distributed array bounds.
-
Writing to remote access buffer.
5Comparison of execution results
Lack of dynamic control errors does not guarantee correct execution of parallel program due to following reasons:
-
Dynamic control does not check correctness of reduction operation descriptions.
-
Errors can occur in called from DVM-program procedures, written in other languages and not dynamically controlled.
-
The tested sequential program can contain errors not appeared during sequential execution, but these errors could occur during the parallel execution.
To find such errors the mode of the accumulation and the comparison of execution traces is used. It allows localizing the program point and moment, when the results are beginning to differ.
When tracing execution, the information is accumulated about all variables reads and updates, entering each loop iteration, entering and exiting parallel loop, entering each parallel task, entering and exiting task region.
Tracing as well as dynamic control results in considerable overhead. Therefore the program is recommended to debug using test data at first and only then real data. However when executing the program with real data, it is not always possible to accumulate full trace due to its large volume. In such a case it is necessary to estimate the trace size as for whole program as for its parts.
The detailed level (and therefore the size) of the trace can be controlled by:
-
options of C-DVM and F-DVM compilers while converting a program (see section 8);
-
trace parameters when the program is executed (see section 11.2);
-
trace configuration file, when the program is executed (see section 10.10).
6System trace accumulation tools and its examining
A system trace (the trace of Lib-DVM function calls) allows tracing a sequence of function calls, their parameters and execution times. There are two main ways of the system trace accumulation (see section 11.4):
-
buffering in each processor memory and then writing to a file in the case of successful program completion (writing to the file is performed on input/output processor);
-
writing to the files on each processor without buffering (with possibility to upload each event information from operation system buffers).
Trace detailed level is controlled by the parameters (see section 11.4). It is necessary to remember that to trace some frequently used Lib-DVM functions the library must be compiled in special mode, specified by computation variables. The full list of traced events is presented in file events.def in DVM-system directory dvm_sys/rts/src. In this file the event number is corresponded to the event name.
All Lib-DVM informational messages and all messages about errors, detected by Lib-DVM, are also traced.
System trace files have text format (see section ) and can be examined using ordinary editors and visualizers.
7DVM-system tuning
DVM-system is tuned to a user environment in two steps:
-
before installation the file, starting DVM-system installation, is tuned (see Technical manual of DVM-system installation);
-
after installation, but before beginning dealing with the user tasks, the dvm-command startup file is tuned. The user previously copies this file to his working directory from DVM-system dvm_sys/user directory.
The following environment variables that can be modified by a user are defined in the DVM-command startup file.
| dvmdir | - full name (with the path) of DVM-system directory (it is tuned automatically when the system is installed). |
| dvmpar | - directory and extensions of base parameter files of DVM-system; |
| usrpar | - directories and names (with extensions) of DVM-system parameter files, in which a user can modify base parameter set (a variable can have several values, separated by spaces); |
| optcconv | - options of C-DVM converter; |
| optfconv | - options of F-DVM converter; |
| optccomp | - invocation and options of standard C-compiler; |
| optfcomp | - invocation and options of standard Fortran-compiler; |
| optclink | - C program linker options; |
| optflink | - Fortran program linker options; |
| dvmlib | - Run-Time Librarys of DVM-programs; |
| usrlib | - libraries, used by the user program; |
| Pred_sys | - name of configuration file, describing target machine (for predictor); |
| Pred_vis | - name of html-file (predictor results) visualizer |
| Doc_vis | - name of documentation visualizer |
| dvmout | - enable (on) or disable (off) message output of:
|
| dvmoutfile | - file name to output the user task messages (if it is not specified, the messages will be output to the screen); |
| dvmlog | - enable (1) or disable (0) the user session protocol (if dvmoutfile is not specified, the protocol is output into the file dvm.log); |
| dvmshow | - enable (1) or disable (0) output of all executed DVM-commands to the screen; |
| dvmsave | - enable (1) or disable (0) keeping intermediate files (of conversion, compilation and so on). |
In own working directory (where a task is started) the user can have several DVM-command startup files with different names, containing different values of the environment variables. Then when starting dvm-commands the corresponding prefix is used (see section 9).
8Options of converters
C-DVM and F-DVM converter options control:
-
DVM-program execution modes (sequential or parallel);
-
target file name (.c or .f).
-
output of the converter version number and some other information;
-
detailed level of data, traced by dynamic debugger (see section 10);
-
partitioning a program by intervals to analyze program performance.
Brief description of main options of the converters is presented below. Full description of all options is presented in C-DVM and Fortran-DVM user's guides.
8.1Converter options controlling program execution modes
| -p | - obtaining parallel version of the program (by default): all DVM-directives are processed, |
| -s | - obtaining sequential version of the program: only DVM-directives required for execution tracing and performance analysis are processed. The data processing is not changed, that allows debugging such program using ordinary tools. |
| -o<file> | - name of target .c or .f file |
| -v | - output of version number, source file name and so on. |
8.2Options of converters for dynamic debugger
| -d1 | - tracing only distributed array updates |
| -d2 | - tracing distributed array reading and updates |
| -d3 | - tracing all data updates |
| -d4 | - tracing all data reading and updates |
8.3Options of converters for performance analysis
| -e1 | - all parallel loops and nesting sequential loops are intervals; |
| -e2 | - all statement sequences, declared (INTERVAL) by the user, are intervals; |
| -e3 | = e1 + e2; |
| -e4 | = e3+ all sequential loops are intervals |
9DVM-system commands
DVM-system commands have the following form:
Характеристики
Тип файла документ
Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.
Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.
Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.















