fdvmUGe (1158424)
Текст из файла
17
Keldysh Institute of Applied Mathematics
Russian Academy of Sciences
Fortran DVM compiler
User’s guide
Mart 2000
Contents
1 Introduction 3
2 Compiler role 3
3 Invoking the compiler 3
4 Compiler options 4
5 Debugging mode of compilation 5
6 Compiling HPF-DVM program 8
7 Compiler messages 9
1Introduction
This document describes how to use the Fortran DVM (FDVM) compiler. It is part of set manuals describing DVM-system.
The following notations for syntax constructs are used in this guide:
::= is by definition
| an alternative construct
[x] encloses optional construct
y-list list of elements y [ , y ]…
2Compiler role
Fortran DVM (FDVM) language is an extension of the Fortran 77 language for parallel programming in DVM model. The extension is implemented as special comments (directives) that annotate sequential program in Fortran 77.
The input to the compiler is source code in Fortran DVM and HPF-DVM. The compiler produces the following output programs.
-
Parallel program in Fortran 77 language including runtime system function calls (Lib-DVM) for parallel execution. This program can be executed in the pseudo-parallel mode on a single processor (work station) and in parallel mode on a multiprocessor system.
-
Sequential program in Fortran 77 language which includes calls of functions accumulating information for debugging and performance analyzing. The program is executed on a single processor in sequential mode.
-
HPF program.
3Invoking the compiler
The following command line starts FDVM compiler up:
dvm fdv [ <options> ] <file-name>
where:
| <options> | - specify compilation modes. If some option is omitted, default value is used. If two options contradict each other, the last one in the command line takes precedence; |
| <file-name> | - name (without extension) of source FDVM program file. The file must have .fdv extension. The current directory is searched for the source file. |
4Compiler options
The compiler has some optional features that you select by including options on the command line of the compiler. The format of an option consists of a hyphen followed immediately by the option name. Some options require arguments. To describe option syntax following notations are used. Option names are typed in bold, and option arguments are typed in italics. The compiler options are listed and briefly described below.
| -o file | Place output in the file file. |
| -s | Produce sequential program; |
| -p | Produce parallel program; |
| -hpf1 | Produce HPF1 program; |
| -hpf2 | Produce HPF2 program; |
| -v | Display the invocations of compiler phases and version number; |
| -w | Display all the warning messages; |
| -Idir | Add directory dir to the list of directories searched for include files; |
| -bindk | Specifies the compatibility of data types between Fortan and C. |
| -dleveld[:fr-list] | Produce additional code for the program debugging; |
| -elevele[:fr-list] | Produce additional code for program performance analyzing. |
Output file. Name of output file, the compiler places output program in, is specified by the option
-o file
where file is the file name. If this option is omitted, the default name is <file-name>.f or <file-name>.hpf in mode of producing HPF program. Output file is placed to the current directory.
Produced program type. The type of produced program is specified by following options:
| -s | - sequential program |
Parallel program is produced by default.
Directories for include-files. If the source program has INCLUDE statements and not all include-files are in the current directory, it is necessary to use the option
-Idir
where dir is directory name. First, the compiler searches for an include-file in the directories and in the order specified in command line. Then the current directory is seached for file.
Additional information. To display the compiler version and invoking compilation phases, it is necessary to use the option
-v
Use the option
-w
to display all the warning messages.
Compatibility of data types. Compatibility of data types in Fortan and C compilers for the computer the produced program will be executed on is specified by the option
-bindk
where k is an integer pointing to compatibility table number.
| k = 0: | |||
| Fortran Type | C Type | Size (bytes) | |
| integer | long | 4 | |
| real | float | 4 | |
| double precision | double | 8 | |
| character | char | 1 | |
| logical | long | 4 | |
| k = 1: | |||
| Fortran Type | C Type | Size (bytes) | |
| integer | int | 4 | |
| real | float | 4 | |
| double precision | double | 8 | |
| character | char | 1 | |
| logical | int | 4 | |
| integer*8 | long | 8 | |
Compatibility of types is defined by standard C and Fortran compilers for the computer. By default, k = 0.
Attention. The –bind, –d, and –e options don’t affect HPF program generation (‑hpf1 and –hpf2 mode).
5Debugging mode of compilation
There are two ways to debug FDVM programs:
-
Functional debug, that allows to test correctness of program execution;
-
Program performance debug, that allows to test effectiveness of parallel execution.
Some debug levels are defined for each of them.
Functional debug levels. Functional debug level (leveld) is an integer (from 0 to 4) specifying the events, of which the Debugger is informed:
0 - no events;
1 - modification of distributed arrays,
2 - modification and usage of distributed arrays,
3 - modification of all the variables,
4 - modification and usage of all the variables.
Performance debug levels. The performance debug level (levele) is an integer (from 0 to 4) specifying which program segments are examined as execution intervals. The performance characteristics may be estimated for each of these intervals.
0 - no intervals;
1 - parallel loops and surrounding sequential loops;
2 - statement intervals, specified in the program by INTERVAL and END INTERVAL directives;
3 - combination of the level 1 and 2;
4 - all the loops and intervals specified by INTERVAL and END INTERVAL directives.
A sequence of statements is declared as interval by the following directives:
CDVM$ INTERVAL [<integer-expression>]
<statement-sequence>
CDVM$ END INTERVAL
Each interval must satisfy statement block conditions:
-
interval execution always starts with first statement,
-
interval execution always ends with last statement.
In other words transfer of control from outside the interval into it and from within the interval to a statement outside it is prohibited.
Program fragments. A program may be devied into separate statement fragments to be debugged. The fragment is specified by the folowing directives:
CDVM$ DEBUG <fragment-number> [( <parameter> )]
<statement-fragment>
CDVM$ END DEBUG <fragment-number>
| <fragment-number> | ::= | <integer> |
| <parameter> | ::= | D = levele |
| | | E = leveld | |
| | | D = leveld , E = levele |
where
parameter D specifies the greatest allowed level of functional debug for the fragment,
parameter E specifies the greatest allowed level of performance debug for the fragment,
leveld – an integer number (from 0 to 4),
levele – an integer number (from 0 to 4).
Each fragment must satisfy statement block conditions.
The enclosed fragments are permitted. Let f1 denotes the set of statements that are composed surrounded fragment, l1 denotes the debug level that is specified in DEBUG directive, and f2 , l2 denote the set of statements and debug level of enclosed fragment. Then the greatest allowed level for set f1 – f2 is l1 and for set f2 is l2.
By default, whole program is the fragment of number 0 and the greatest allowed level for it is D = 4 , E = 4.
Let the following structure of fragments in program unit is specified:
SUBROUTINE SUB(…)
S1
CDVM$ DEBUG 1 (D = 4 , E = 1)
S2
CDVM$ DEBUG 2 (D = 1 , E = 3)
Характеристики
Тип файла документ
Документы такого типа открываются такими программами, как Microsoft Office Word на компьютерах Windows, Apple Pages на компьютерах Mac, Open Office - бесплатная альтернатива на различных платформах, в том числе Linux. Наиболее простым и современным решением будут Google документы, так как открываются онлайн без скачивания прямо в браузере на любой платформе. Существуют российские качественные аналоги, например от Яндекса.
Будьте внимательны на мобильных устройствах, так как там используются упрощённый функционал даже в официальном приложении от Microsoft, поэтому для просмотра скачивайте PDF-версию. А если нужно редактировать файл, то используйте оригинальный файл.
Файлы такого типа обычно разбиты на страницы, а текст может быть форматированным (жирный, курсив, выбор шрифта, таблицы и т.п.), а также в него можно добавлять изображения. Формат идеально подходит для рефератов, докладов и РПЗ курсовых проектов, которые необходимо распечатать. Кстати перед печатью также сохраняйте файл в PDF, так как принтер может начудить со шрифтами.















