cdvm_guid-e (1158369)

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

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

10


CDVM compiler

(User’s guide)

October 1999

Keldysh Institute of Applied Mathematics

Russian Academy of Sciences

Table of contents

1 Functions of the Compiler 3

2 Invoking the Compiler 3

3 Compiler diagnostics 4

3.1 Fatal errors 4

3.2 Scanner and parser diagnostics 4

3.3 File level and operator errors 4

3.4 Declarations 5

3.5 Declaration and usage of DVM-objects 6

3.6 DISTRIBUTE, ALIGN, TEMPLATE 6

3.7 malloc & access to distributed data 7

3.8 PARALLEL loop 8

3.9 SHADOW 8

3.10 REDUCTION 9

3.11 Procedures 9

3.12 Data tracing 9

3.13 Miscellaneous 9

1Functions of the Compiler

C-DVM is the C language extended by special annotations for specifying parallel execution of the program. These annotations are called DVM-directives.

C-DVM compiler is DVM-system tool to translate an annotated CDVM program to a SPMD stile program in C language containing Run-Time library (Lib-DVM) calls. Then the resulted program (with INCLUDE-file cdvm_c.h) must be translated by any C-compiler and linked with Lib-DVM library.

Besides "pure" parallel code the compiler can produce an "extended" debugging code to use features of the performance analyzer (PPPA) and the data tracer, and "sequential" program (i.e. without Lib-DVM calls) with debugging extensions used to obtain performance characteristics of source program and so called "reference" trace for trace comparison.

2Invoking the Compiler

The following command line starts the C-DVM compiler up:

dvm сdv [<options>] <infile>

where

<infile>

- represents source file to be compiled. The compiler processes the file named by <infile>.cdv. The current directory is searched for the source file. It is assumed that the file was compiled by standard C compiler and is correct with respect to C syntax. C-DVM compiler does not perform standard C syntax and semantics checking.

-o <outfile>

- output file name for converted program (optional; by default it is <infile>.c). If C-DVM compiler detected errors, the file is not created. Error messages are output to the file cdvm_msg.

<options> - one or more options from the following list:

-s – generate sequential program (no Lib-DVM calls, debugging extensions only); by default, parallel program is generated;

-p –generate parallel program;

Trace modes:

-d1 – tracing only DVM-array updates,

-d2 – tracing DVM-arrays reading and updates,

-d3 – tracing all data updates,

-d4 – tracing all data reading and updates;

Note1. Loop iteration execution is traced in any mode.

Performance analyzer modes:

-e1 – measuring parallel loops and enclosing sequential loops,

-e2 – measuring parallel loops and user defined INTERVALs,

-e3 = e1 + e2,

-e4 = e3 + all other sequential loops;

Note 2. Only sequential loops, specified by DO and FOR macros are taken into account. Standard C loops (for, while, do) are not measured.

Others:

-v – verbose mode, output informational messages to the screen,

-w – all warnings are enabled,

-w- – no warnings are enabled,

-xN – system table size (-x16 – by default),

3Compiler diagnostics

3.1Fatal errors

Fatal errors terminate execution. They include:

  • command line parameters (option syntax) errors;

  • open errors of required files – check whether file exists and is accessible;

  • system table overflow – try to increase their size by –xN option (by default: –x16)

3.2Scanner and parser diagnostics

The scanner stops and outputs a message in the case of:

  • unclosed char or string constant;

  • unclosed comment;

Invalid characters and “/*” in comment are skipped with according message.

The parser stops if it found:

  • Unexpected <token>” – possible terminal symbol not found;

  • <construct> expected” – but not found;

  • <construct> syntax” – is incorrect.

3.3File level and operator errors

"The 'main' should get the command line parameters"

The command line parameters are necessary to initialize Lib-DVM.

"The 'main' should 'return <rc>;' for the Lib-DVM"

The user return code is passed to an operating system by the Lib-DVM.

"Implicitly created objects must precede 'main'"

Distributed arrays, templates, processors arrangements (and so on) with constant dimensions are created at the beginning of the main function, so all of them should be known at this point.

"'main' required for implicitly created objects"

Distributed arrays, templates, processors arrangements (and so on) with constant dimensions are created at the beginning of the main function, so the main function must exist in the file.

"DVM-operator outside function"

DVM-statement is placed outside function.

"Misplaced declarative DVM-directive"

Declarative directive after or in a statement.

"DVM-directive requires a non-empty operator"

This directive is a specification of a statement. It should not be followed by ‘;’.

"Should be followed by the ';'"

This directive is a statement itself. So it should be followed by ‘;’.

"TASK_REGION must be a sequence of ON-blocks or ON-loop"

TASK_REGION can not contain statements without ON directive.

"Not allowed in a PARALLEL loop"

Collective operation can not be performed on a separate processor.

3.4Declarations

"DVM-object should be defined as 'void * '"

DVM syntax convention.

"DVM-arrays may be int, long, float, or double only"

DVM-system limitation.

"Scalar can not be distributed"

Scalars are always implicitly replicated.

"DVM-pointer should be a C-pointer"

DVM(* …) requires <type> * <id>.

"'*' is valid only with DISTRIBUTE and ALIGN"

'*' can be used in DISTRIBUTE and ALIGN directives only.

"Only 1D-arrays of ptrs to DVM-arrays supported"

Compiler limitation. Only one-dimensional arrays of pointers to distributed arrays are allowable.

"Unsupported declarator for distributed data"

Unsupported declarator for distributed data.

"Can not initialize DVM-objects"

An initializer can't be specified for DVM objects and arrays.

"DVM declarator syntax error"

Other syntax error in declarator.

3.5Declaration and usage of DVM-objects

"Undefined"

Undefined identifier is used in DVM-directive. Sequential program may be compiled correctly if the identifier is used in DVM-directives only.

"This is not a DVM-object"

The object used in DVM-directive is not DVM-object.

"Rank error"

Rank in usage does not match with rank of definition.

"This is not a REDUCTION_GROUP"

DVM-directive requires parameters of definite class.

"This is not a SHADOW_GROUP"

DVM-directive requires parameters of definite class.

"This is not a REMOTE_GROUP"

DVM-directive requires parameters of definite class.

"This is not a TASK"

DVM-directive requires parameters of definite class.

"An array of void* required."

The array of (void *) pointers is required.

"MAP-target must be a processors section"

CDVM syntax.

"ON-target must be an element of task array"

CDVM syntax.

3.6DISTRIBUTE, ALIGN, TEMPLATE

"'[*]' is only allowed in DVM( * DISTRIBUTE...)"

CDVM syntax.

"Array should be defined as DVM(DISTRIBUTE...)"

DVM-array should be defined as DVM(DISTRIBUTE...)

"GENBLOCK requires non-distributed 1D integer array"

Semantic constrain.

"ONTO target must be a TASK or a PROCESSORS"

"ONTO target must be an element of task array"

"Align-expression syntax: [-][A*]var[+B|-B]"

Only linear expression are allowed.

"Already used align|do variable"

Two alignment expressions with the same variable are not allowed.

"The base of a static should be a (known) static"

All “static” DVM arrays are automatically malloc’ed at the beginning of the main function in order of declaration. The base of ALIGNed array must exist before creation of this array.

"The parameter should be a (non-static) TEMPLATE"

Wrong parameter of the CREATE_TEMPLATE directive.

3.7malloc & access to distributed data

"DVM-malloc requires (dim1*...*sizeof(...))"

Distributed array creation requires of all dimensions of this array

"Is it 'sizeof(<element type>)' ?"

The last multiplier of malloc is supposed to be the size of array element.

"Only DVM-arrays may be malloc'ed"

The DVM-pointer is used to create DVM array by malloc function.

"Static DVM-array can not be malloc'ed"

Static arrays can't be created by malloc function. They are created automatically at the beginning of main function.

"Only DVM-pointers may be assigned"

DVM arrays may be assigned only by malloc().

"REDISTRIBUTE|REALIGN must follow this malloc"

To properly create (malloc) DVM array that has been declared without distribution/alignment stuff, this information must be provided here.

"Can not assign to REMOTE"

REMOTE_ACCESS semantic constrain.

"Can not get REMOTE address"

REMOTE_ACCESS semantic constrain. The & operator can't be applied to remote-access data.

"Possible non-local assignment. Use DVM(OWN)"

Left hand side of assignment in sequential branch is element of distributed array.

"Only 1..4-D arrays may be distributed"

Syntax limitation. Distributed arrays of 1-4 rank are supported only.

"Too many distributed dimensions"

Special case of “Rank error”

"Not all distributed dimensions"

Special case of “Rank error”.

3.8PARALLEL loop

"Duplicated or incompatible sub-directive"

PARALLEL loop header constrain. (Incompatible subdirectives are SHADOW_RENEW, SHADOW_START and SHADOW_WAIT subdirectives and all subdirectives with ON <task>).

"Too many headers in the PARALLEL loop"

Use {} to separate distributed header and internal sequential one.

"Not enough headers in the PARALLEL loop"

DVM allows tightly nested parallel loops only.

"Not a PARALLEL loop variable"

The variable in a distributed DO/FOR header must be listed in the PARALLEL loop header.

"PARALLEL loop variables disordered"

Loop variable must be listed it the PARALLEL header in the same order they are used in DO/FOR loop headers.

"Variable already used"

Two alignment expressions with the same variable are not allowed.

"Loop variable required"

Empty ‘[ ]’ in PARALLEL loop header are not allowed.

"Only 'long' or 'int' scalar loop variables allowed"

Lib-DVM limitation.

3.9SHADOW

"Declared (or default) maximum width exceeded"

The width necessary for a shadow operation exceeds the width provided in array creation (declaration).

"1D-array's shadow has no CORNERs"

Warning. Keyword is useless in this context.

3.10REDUCTION

Reduction operation syntax or semantics violation:

"Undefined RVAR"
"Wrong type of RVAR"
"Undefined RLOC"
"Wrong type of RLOC"
"Unallowed RVAR-expression"
"Unallowed RLOC-expression"

3.11Procedures

"Parameter should be defined as DVM(*...)"

DVM arrays are passed by reference.

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

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

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

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

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

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

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