debugDDe (1158408)

Файл №1158408 debugDDe (Раздаточные материалы)debugDDe (1158408)2019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла

66


Keldysh Institute of Applied Mathematics

Russia Academy of Sciences

DVM Debugger

Detailed design

March 2000

Contents

1 The Functions of DVM debugger 3

1.1 The “Dynamic control of DVM-directives” method 4

1.2 Kinds of detected errors 4

1.3 The “Comparing execution results” method 4

2 The Content of DVM debugger 5

3 Prototypes of debugger functions 5

4 Base modules realization 8

4.1 Table 8

4.2 Hash-table 10

4.3 Table of variables 14

4.4 Diagnostics output module 18

4.4.1 Processing diagnostics context 18

4.4.2 Diagnostics output functions 21

5 Dynamic control of DVM-directives 25

5.1 Checking initialization of variables and elements of distributed arrays 25

5.2 Checking access to elements of distributed arrays 25

5.3 Checking private and read-only variables 26

5.4 Checking reduction variables 26

5.5 Checking usage of remote access buffer 27

5.6 Dynamic control of DVM directive implementation 27

5.6.1 Use the table of variables by dynamic control module 27

5.6.2 Base functions of dynamic control module 28

5.6.3 The parameters of dynamic control 35

6 The “Comparing execution results” method 36

6.1 Trace accumulation 36

6.2 Trace comparing 37

6.3 Checking reduction operations 37

6.4 Formats of input and output files 38

6.4.1 Trace configuration file 38

6.4.2 Trace file 40

6.5 Realization of comparing execution results 41

6.5.1 Base structures of comparing execution results module 41

6.5.2 Trace writing module 52

6.5.3 Trace accumulation module 54

6.5.4 Trace reading module 57

6.5.5 Trace comparing module 58

6.5.6 Reduction processing module 61

6.5.7 Parameters of comparing execution results sub-system 63

7 Diagnostic messages of the dynamic debugger 64

1The Functions of DVM debugger

DVM debugger is used for debugging DVM-program (written in Fortran-DVM or C-DVM languages). The following approach is used to debug DVM-programs. First, the program is debugged on a workstation as a sequential program using ordinary debugging methods and tools. Then the program is executed at the same workstation in the special mode of checking DVM-directives. At the next step the program may be executed on a parallel computer in the special mode, when intermediate results of its execution are compared with reference results (for example, the results of its sequential execution).

The DVM-program can contain the errors of different kinds. The DVM-debugger is used to detect errors not appeared during a sequential execution. In the common case the following classes of errors can be considered:

  • Syntax errors in DVM-directives (incorrect usage of an operator, missing of brackets and so on). Violation of static semantics belongs to this class also.

  • Incorrect order of DVM-directives or invalid parameters of DVM-directives.

  • Wrong computation due to DVM-directive incorrectness and errors, not detected during program execution in sequential mode.

  • Abnormal parallel program termination (GPFs, infinite looping, hanging) due to errors that not appear during program execution in sequential mode.

A compiler detects the errors of the first class.

Only simple errors of second class such as wrong parameter type may be detected by static analysis. To detect the errors of this class each Lib-DVM function checks the correctness of DVM-directives order and parameters. The checks are done dynamically, during program execution.

It is impossible to detect errors of third class without special compilation mode and considerable overhead in the parallel program. Unspecified data dependence in loop is example of the error of the third class. To detect this error it is necessary to fix all data modifications and usage on different processors and to determine the cases, when a variable is modified on one processor and used on the other. This detection can be more effectively performed on a single processor by emulation of parallel execution of the program.

The DVM-debugger is intended to detect errors of third class. It is based on the following two methods.

The first method, method of dynamic control of DVM-directives, allows verifying the correctness of the program parallelization specified by DVM-directives. It is based on the analysis of sequence of Lib-DVM function calls and references to the variables during parallel program execution simulated on a single processor.

The second method is based on the comparison of parallel and sequential program execution trace results. It allows to localize the program point and moment, when the results are beginning to differ. Unlike the first method, only part of program can be compiled in the special debug mode.

The facilities of parallel program tracing that are included into DVM-debugger may be useful for detection of error of fourth class. Moreover the system tracing facilities are intended to detect these errors (the tracing of DVM support library calls).

1.1The “Dynamic control of DVM-directives” method

The dynamic control is based on simulation of DVM-program parallel execution on a single processor. This method using can slow down the program execution significantly and requires large volumes of additional memory. Therefore it can be applicable to a program with specially chosen test data only.

1.2Kinds of detected errors

The dynamic control allows to detect the following kinds of errors:

  1. Undeclared cross-iteration data dependencies in a parallel loop or task region.

  2. Using of non-initialized variables.

  3. Modification of non-distributed variables not specified as reduction or private.

  4. Using reduction variables after the asynchronous reduction startup but before its completion.

  5. Accessing to out of bound elements of distributed array.

  6. Undeclared access to non-local elements of the distributed array.

  7. Writing to shadow edges of the distributed array.

  8. Reading shadow elements before completion of their updating.

1.3The “Comparing execution results” method

The dynamic control is intended first of all for checking DVM-directives correctness. The control area is limited by DVM-programs compiled in the special debug mode only. However, the program can contain calls of procedures written in ordinary sequential languages (including assembler). The procedure execution is not controlled and can cause incorrect program execution. Besides, correctness of reduction operation descriptions is not checked. And finally, the program can have errors (not related with its parallelization) which appear only during a parallel execution.

There is another control method aimed to detect such errors. This method is based on an accumulation of trace results for different conditions of execution and these results comparison. With this method the program may be executed in two modes. In the first mode, trace results (intermediate variable values) are accumulated and written to a file as the reference trace results. In the second mode, execution results are compared with the reference ones. It is taken into account that values of some variables may differ (for example, reduction variables inside parallel construction).

2The Content of DVM debugger

The DVM-debugger consists of two parts: the dynamic control system and the trace comparison system.

Both systems use the following base subsystems: tables allowing storing large volumes of uniformed information, hash-tables for fast data lookup, and diagnostic output module.

The dynamic control system consists of the following components:

  • The table of variables. It provides means for saving information about usage of various variables and for fast retrieval of the information by the variable address.

  • The dynamic control module. It performs DVM-directives verification. The functions of the module are called from certain Lib-DVM functions each time when a variable or array is accessed. This module uses the table of variables as auxiliary module to accumulate and retrieve information about variables.

The trace comparison system consists of the following components:

  • Unit of accumulating the trace information in the memory. It accumulates and structures trace events during program execution.

  • Unit of writing the trace to a file. Accumulation unit uses it when program is running with trace writing mode specified.

  • Unit of reading the trace information from the files. It uses accumulation unit as auxiliary module.

  • Unit of comparing traces. It compares trace events of executing program with the reference trace previously formed in the memory.

  • Unit of checking reduction variables. It emulates execution of each iteration of parallel loop and each parallel task on the separate processor for checking of correctness of reduction operation descriptions. It works only in the special mode.

3Prototypes of debugger functions

The Lib-DVM system contains additional system functions relating to dynamic debugger that are responsible for dynamic control and comparing of execution results. The C-DVM and Fortran-DVM compilers insert an addressing to these functions in special debugging mode.

The prototypes of debugger functions is the following:

long dprstv_(long *TypePtr, AddrType *addr, long *Handle, char *Operand, long OperLength)

TypePtr

variable type (rt_INT, rt_LONG, rt_FLOAT or rt_DOUBLE). The function call is ignored for tracing if other type is specified

addr

address of the variable or array element

Handle

handle of DVM-array if array element is specified. Otherwise, the argument should be equal to NULL

Operand

operand name. This name is reported in the trace file and error messages

OperLength

length of the Operand. This parameter is required for Fortran compatibility. It should be equal to –1 if the C language is used

The function marks beginning of a variable or array element modification. The call should be inserted before a variable modification and up to an evaluation of expression to be assigned. The system call should be accompanied by dstv _ ().

long dstv_(void)

The function marks the completion of a variable or array element modification. The call should be inserted after a variable modification and should be conjugate with dprstv_().

long dldv_(long *TypePtr, AddrType *addr, long *Handle, char *Operand, long OperLength)

TypePtr

variable type (rt_INT, rt_LONG, rt_FLOAT or rt_DOUBLE). The function call is ignored for tracing if other type is specified

addr

address of the variable or array element

Handle

handle of DVM-array if array element is specified. Otherwise, the argument should be equal to NULL

Operand

operand name. This name is reported in the trace file and error messages

OperLength

length of the Operand. This parameter is required for Fortran compatibility. It should be equal to –1 if the C language is used

The function marks access to a variable or array element for reading.

long dbegpl_(long *Rank, long *No, long *Init, long *Last, long *Step)

Rank

rank of a parallel loop

No

the number of structure. It should be unique for all loops and all task regions inside the program.

Init

Rank-dimensional array of initial values of iteration variables

Last

Rank-dimensional array of last values of iteration variables.

Step

Rank-dimensional array of iteration variables steps

The function marks parallel loop beginning. The function should be called before mapping the parallel loop on the abstract machine.

long dbegsl_(long *No)

No

the number of structure. It should be unique for all loops and all task regions inside the program.

The function marks sequential loop beginning. The sequential loop rank is always equal to 1.

long dbegtr_(long *No)

No

the number of structure. It should be unique for all loops and all task regions inside the program.

The function marks task region beginning. The task region rank is always equal to 1.

long dendl_(long *No, unsigned long *Line)

No

number of structure to be completed

Line

the structure exit line number. It is used for checking a correctness of completion of parallel structure.

The function marks completion of a sequential or parallel loop or task region. The function should be called after completion of the last iteration of the loop or last parallel task in task region.

long diter_(AddrType *index)

index

array of pointers to iteration variables. The size the array should be equal to rank of the executed structure.

The function marks beginning of new iteration of a sequential or parallel loop or beginning of new parallel task. The function should be called after modification of all iteration variables of the loop (for multidimensional loops).

long drmbuf_(long* ArrSrc, AddrType* RmtBuff, long* Rank, long* Index)

ArrSrc

a handle of source array for which the remote access buffer is created

RmtBuff

an address of a scalar variable, if buffer is created for a single array element, or a handle of DVM-array to be used as a buffer, if the buffer is created for a sub-array

Rank

remote access buffer rank. It should be zero if buffer is created for a single array element.

Index

an array that contains indexes of the cut (selected) dimensions. If an element of this array is not equal to –1, the range appropriate to the given array element is used. Otherwise, the whole dimension of the array is used.

The function marks remote access buffer creation for dynamic control system. This call is necessary for correct monitoring of access to the elements of a DVM-array through the remote access buffer. The call should be used after creation of the buffer and initialization of its elements.

long dskpbl_(void)

The function marks the completion of self-calculation block in sequential branch of the program. The function should be called after execution of the statement group and independently of the checking results.

4Base modules realization

4.1Table

The table is intended to keep large volume of data. A peculiarity of the implementation is that the memory is allocated not for each element but by large blocks of fixed size. The size of the allocated block is defined by parameters of table initialization. The table is expanded automatically, when the current allocated memory block is exhausted.

Характеристики

Тип файла документ

Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.

Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.

Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.

Список файлов учебной работы

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
7021
Авторов
на СтудИзбе
260
Средний доход
с одного платного файла
Обучение Подробнее