DIGITAL Fortran 90
DIGITAL Fortran 90
Release Notes for DIGITAL UNIX Systems
December 1998
This document contains information about DIGITAL Fortran 90 for
DIGITALTM UNIX® Alpha Systems.
Software Version:
DIGITAL Fortran 90
Version 5.2
Digital Equipment Corporation
Maynard, Massachusetts
First release, June 1994
Revisions: September 1994, December 1994, March 1995, May 1995, March 1996,
December 1996, September 1997, March 1998, December 1998
The information in this document is subject to change without notice
and should not be construed as a commitment by Digital Equipment
Corporation. Digital Equipment Corporation assumes no responsibility
for any errors that may appear in this document.
The software described in this document is furnished under a license
and may be used or copied only in accordance with the terms of such
license.
Copyright © Digital Equipment Corporation 1998, All Rights Reserved
The following are trademarks of Digital Equipment Corporation, a
CompaqTM company:
AlphaGeneration, Bookreader, DEC, DECchip, DEC Fortran, DEC
FUSE, DIGITAL, OpenVMS, and the DIGITAL logo; Compaq is a trademark of
Compaq Computer Corporation.
CRAY is a trademark of Cray Research, Inc.
OpenMP is a trademark of the OpenMP Architecture Review Board.
PostScript is a trademark of Adobe Systems, Inc.
Microsoft, PowerStation, NT, and Windows are either trademarks or
registered trademarks of Microsoft Corporation.
Motif, OSF, and OSF/1 are trademarks of the Open Software Foundation,
Inc.
UNIX is a registered trademark in the United States and other countries
licensed exclusively through X/Open Company Ltd.
All other trademarks and registered trademarks are the property of
their respective holders.
Chapter 1
DIGITAL Fortran 90 Version 5.2 Release Notes
This chapter contains release notes for DIGITAL Fortran 90 Version
5.2 (changes for this release are described in Section 1.5).
This chapter contains the following sections:
1.1 Product Terminology Changes
This document uses the following new or changed product names:
- "DIGITAL Fortran 90" was previously called "DEC
Fortran 90".
- "DIGITAL Fortran 77" was previously called "DEC
Fortran".
- "DIGITAL Fortran" refers to the combined packaging of the
DIGITAL Fortran 90 and DIGITAL Fortran 77 products. It also refers to
the DIGITAL Fortran language.
- DIGITAL Fortran 90 and DIGITAL Fortran 77 version numbers are now
the same.
- The operating system name "DEC OSF/1" is now called
"DIGITAL UNIX".
1.2 Overview
DIGITAL Fortran 90 conforms to the Fortran 95 Standard, Fortran 90
Standard, and previous Fortran standards. It also includes support for
High Performance Fortran (HPF), and contains many but not all of
DIGITAL Fortran 77's extensions to the FORTRAN-77 standard. Except in
rare instances, a valid FORTRAN-77 program is also a valid Fortran 95
program.
DIGITAL Fortran fully supports the Fortran 95 Standard (ISO/IEC
1539:1998 (E)) and the multi-vendor OpenMPTM
Fortran Specification, including support for directed parallel processing
using OpenMP directives on shared memory multiprocessor systems.
The DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems contains a detailed description of DIGITAL Fortran 77
source language compatibility. Provided the types and shapes of the
actual and formal arguments agree, routines compiled with DIGITAL
Fortran 77 can call (or be called by) routines compiled with DIGITAL
Fortran 90.
1.3 Installation and Minimum Operating Systems Version
DIGITAL Fortran 90 Version 5.2 requires Version 4.0 (or
later) of the DIGITAL UNIX operating system. Use of parallel features
requires Version 4.0D (or later) of the DIGITAL UNIX system.
For a detailed description of the installation procedure, see the
DIGITAL Fortran Installation Guide for DIGITAL UNIX Systems.
You may also send comments, questions and suggestions about the DIGITAL
Fortran 90 product to the following mail address:
Please note that this address is for informational inquiries and is not
a formal support channel.
If you have Internet access and a World Wide Web (WWW) browser, you are
welcome to view the DIGITAL Fortran 90 home page, located at (click on
the following link to view this Internet URL):
1.4 Software Versions
The DIGITAL Fortran 90 Version 5.2 kit consists of the
following setld sets:
- DFABASE520 -- DIGITAL Fortran 90 and 77 v5.2 for DIGITAL UNIX Alpha
Systems
- DFADOC520 -- DIGITAL Fortran v5.2 Release Notes and Man Pages
- DFACOM520 -- DIGITAL Fortran v5.2 Tools and their Manpages
- DFARTL384 -- DIGITAL Fortran Runtime Support for DIGITAL UNIX
Systems
- HPFLIBS170-- High Performance Fortran Run-Time Libraries
- OTABASE204-- DIGITAL Compiled Code Support Library
- XMDLOA350 -- The serial DXML archive library and shared library
- XMDMAN350 -- The DXML manpages
- XMDSCI350 -- The SCIPORT Cray® compatibility library and manpages
- XMDPLL350 -- The parallel DXML shared library
The DIGITAL Fortran DFABASE and DFACOM subsets now include the DIGITAL
Fortran 90 and DIGITAL Fortran 77 compilers and associated
documentation.
The XMD subsets include the DXML routines, now included in the DIGITAL
Fortran kit as external routines. DXML is distributed as a Development
kit, that allows you to link an application program with the DXML
library and then run the executable image. No license is required. The
DXML subsets are independent from one another, except that the user
must link in the DXML library (either serial or parallel) after linking
with the SCIPORT library. The kit includes the following subsets:
- XMDLOA350 - this subset contains the serial DXML archive library
and shared library (libdxml.a, libdxml.so), along with example files,
IVP tests, release notes, and other supporting DXML utilities.
- XMDMAN350 - this subset contains the DXML manpages.
- XMDSCI350 - this subset contains the SCIPORT Cray compatibility
library (libsciport.a), and the SCIPORT manpages.
- XMDPLL350 - DXML parallel subset. This subset includes the shared
parallel library (libdxmlp.so) and IVP tests for the parallel library.
This subset should only be installed on SMP configurations running
DIGITAL UNIX Version 4.0 or later.
The HPFLIBS subset contains High Performance Fortran (HPF) support and
contains:
- Both the nonparallel (serial) and parallel versions of the High
Performance Fortran (HPF) run-time library
- Associated reference pages for HPF_LIBRARY and HPF_LOCAL_LIBRARY,
including intro(3hpf)
In order to use the HPF Scalar libraries, the HPFLIBS subset must be
installed.
As in DIGITAL Fortran 90 Version 5.1, the HPFLIBS subset replaces the
old PSESHPF subset. If you previously installed the PSESHPF subset you
do not need to delete it. If you choose to delete it, delete it before
you install the DIGITAL Fortran 90 Version 5.2 HPFLIBS170 subset. If
you delete the PSESHPF subset after you install the Fortran HPFLIBS170
subset, you need to delete the HPFLIBS170 subset and then reinstall it.
For information on using the setld
command to check for and delete subsets, see the DIGITAL Fortran
Installation Guide for DIGITAL UNIX Systems (available in
HTML form).
To execute HPF programs compiled with the
-wsf
switch you must have both PSE160 and DIGITAL Fortran 90 Version 5.2
with the HPFLIBS170 subset installed. For this release the order of the
installation is important. You must first install PSE160 and then
install DIGITAL Fortran 90 Version 5.2 with the HPFLIBS170 subset. The
HPFLIBS170 subset must be installed last. If you do this it will be
properly installed.
If you also need to use the latest versions of MPI and PVM, you must
install PSE180. PSE180 contains only MPI and PVM support. The support
for HPF programs compiled with the
-wsf
switch is only found in PSE160. Therefore you must install both
versions of PSE and you must install PSE180 after PSE160.
To install DIGITAL Fortran 90 with HPF and MPI and PVM, install them in
the following order. The order is very important.
- Delete any old versions that you wish to delete.
- Install PSE160.
- Install DIGITAL Fortran 90 Version 5.2 including the HPFLIBS170
subset.
- Install PSE180.
The HPF runtime libraries in DIGITAL Fortran 90 Version 5.2 are only
compatible with PSE Version 1.6. Programs compiled with this version
will not run correctly with older versions of PSE. In addition,
programs compiled with older compilers will no longer run correctly
when linked with programs compiled with this version. Relinking is not
sufficient; programs must be recompiled and relinked.
If you cannot install these in the order described, follow these
directions to correct the installation:
- If you have installed Fortran V5.2 but are missing PSE160, then
install PSE160. Delete the HPFLIBS170 subset of Fortran V5.2 and then
reinstall the HPFLIBS170 subset.
- If you installed Fortran V5.2 first and then PSE160, then delete
the HPFLIBS170 subset of Fortran V5.2. Next, reinstall the HPFLIBS170
subset.
- If you already have Fortran V5.2 and PSE160 installed but did not
install the HPFLIBS170 subset of Fortran V5.2, then simply install the
HPFLIBS170 subset.
- If you deleted any old PSESHPF subset after installing Fortran
V5.2, this will also cause problems. In this case delete the HPFLIBS170
subset of Fortran V5.2 and then reinstall the HPFLIBS170 subset.
- If you installed PSE180 before PSE160, then delete PSE180 and
reinstall it now.
For more information about installing PSE160, see the DIGITAL
Parallel Software Environment Release Notes, Version 1.6.
For more information about installing PSE180, see the DIGITAL
Parallel Software Environment Release Notes, Version 1.8.
For more information including disk space requirements, see
Section 3.1.1.
If you need to delete an older version of the DIGITAL Fortran Run-Time
Library, delete the older subset before you install a new version. If
you have installed multiple versions of the Run-Time Library and you
delete one, you must reinstall the desired Run-Time Library version
before you can correctly link Fortran programs.
The DIGITAL Fortran kit again includes the OTABASE subset (DIGITAL
Compiled Code Support Library). The new OTABASE subset supports the use
of parallel directives.
The following changes occurred to the OSFCMPLRS operating system subset
starting with DIGITAL UNIX Version 4.0:
- Beginning with DIGITAL UNIX Version 4.0, the OSFCMPLRS subset now
consists of multiple subsets: OSFCMPLRS (required for program
development), OSFSDE (profiling tools), OSFLIBA (archive libraries),
OSFINCLUDE (include files), OSFATOM (
atom
tools)
1.5 New Features, Corrections, and Known Problems in Version 5.2
Version 5.2 is a minor release that includes corrections to
problems discovered since Version 5.1 was released and certain new
features.
For the Version 5.2 subset numbers, see Section 1.4.
The following topics are discussed:
1.5.1 Version 5.2 New Features
The following new DIGITAL Fortran 90 features are now supported:
- The following new features are now supported:
- The f90 compiler now gives "uninitialized variable" warnings at
optimization levels lower than -O4.
- The RTL now has support for handling units *, 5 and 6 as separate
units. Use of this feature, requires both rtl and compiler support.
Programs must be compiled with a version of the compiler that
implements this support and linked with or use a shareable rtl that
implements the support. Older existing images will continue to work
with the newer rtl. As a consequence of separating the units: if you
were to connect unit 6 to a file, and then write to unit * - that write
would produce output to the console (or stdout device). Previous to
this, a write to unit * would go the same file connected to unit 6.
This new behavior is consistent to that of VMS and MS-FPS.
- For F90, a Namelist input group can start with either an ampersand
(&) or dollar sign ($) in any column and can be terminated by one
of a slash (/), an ampersand (&) or a dollar sign($) in any column.
- The DIGITAL Extended Math Library (DXML) routines are now included
in the DIGITAL Fortran kit.
- The following new
f90
command options are now supported:
-
-assume gfullpath
causes the full source file path to be included in the debug
information. The default is
-assume nogfullpath
.
-
-assume [no]pthreads_lock
allows the user to select the kind of locking used for an unnamed
critical section (when parallel processing is requested with
-mp
or
-omp
). Using the default,
-assume nopthreads_lock
, provides the fastest performance by providing a single lock for all
unnamed critical sections (but does not lock out other process
threads).
To request more restrictive locking, specify
-assume pthreads_lock
. This locks out all other process threads in addition to all critical
sections, which slows application performance.
When using
-assume nopthreads_lock
(default), enter critical is used with the _OtsGlobalLock argument. With
-assume pthreads_lock
, enter critical is used with the _OtsPthreadLock argument.
-
-arch ev6
generates instructions for ev6 processors (21264 chips). This option
permits the compiler to generate any EV6 instruction, including
instructions contained in the BWX (Byte/Word manipulation instructions)
or MAX (Multimedia instructions) extension, square root and
floating-point convert, and count extension. Applications compiled with
this option may incur emulation overhead on ev4, ev5, ev56, and pca56
processors, but will still run correctly.
1.5.2 Version 5.2 Important Information
Some important information to note about this release:
- UNIX Virtual Memory from the Digital UNIX docset
There is a new
manual in V4.0D of the docset: "System Configuration and Tuning".
Section 4.7.3 from that book is "Increasing the Available Address
Space".
- If your applications are memory-intensive, you may want to increase
the available address space. Increasing the address space will cause
only a small increase in the demand for memory. However, you may not
want to increase the address space if your applications use many forked
processes.
The following attributes determine the available
address space for processes:
This attribute controls the maximum amount of virtual address
space available to a process. The default value is 1 GB (1073741824).
For Internet servers, you may want to increase this value to 10 GB.
- per-proc-address-space
- max-per-proc-address-size
These attributes control the maximum amount of user process
address space, which is the maximum number of valid virtual regions.
The default value for both attributes is 1 GB.
- per-proc-stack-size
- max-per-proc-stack-size
These attributes control the maximum size of a user process stack.
The default value of the per-proc-stack-size attribute is 2097152
bytes. The default value of the max-per-proc-stack-size attribute is
33554432 bytes. You may need to increase these values if you receive
cannot grow stack messages.
- per-proc-data-size
- max-per-proc-data-size
These attributes control the maximum size of a user process data
segment. The default value of the per-proc-data-size attribute is
134217728 bytes. The default value of the max-per-proc-data-size is 1
GB. You can use the setrlimit function to control the consumption of
system resources by a parent process and its child processes. See
setrlimit(2) for information.
- If you try to link
-non_shared
a parallel application that uses
-mp
or
-omp
, you must explicitly add
-lpset
in addition to the libraries
f90
links in.
- The
-nod
command switch is now available to allow symbol definitions (using
-d
) to be passed to
fpp
but not to be passed to the conditional compilation facilty inside the
f90
compiler.
- When
-arch ev6
is used, the
f90
driver will add
-qlm_ev6
before
-lm
on the
cc
command so
ld
will look for the EV6-tuned math library.
- Please note the behavior of NOWAIT reductions: each thread
contributes its part, and proceeds without waiting for the final value
of the reduction variable. The reduction variable's value is undefined
until a synchronization operation has occurred, or the parallel region
is left.
- UNIX v4.0D contains ld switches to restrict library searches to
shared and archived libraries. See
-no_so
,
-no_archive
, and
-so_archive
in the
ld(1)
man page.
- Use the
setld -d
option to install the software to another root directory. Everything in
the installation then hangs off that root. Commands like f90 can be
pointed to by PATH, the DECF90 environment variable can point to where
the compiler is,
-l
can tell f90 where the RTL is, and the LD_LIBRARY_PATH environment
variable can be used to ensure that the desired version of shareable
libraries are picked up at run time.
1.5.3 Version 5.2 Corrections
From version V5.1-594-3882K to FT1 T5.2-682-4289P, the following
corrections have been made:
- Don't create stack temporary for character operands to ALL except
when absolutely necessary.
- Add -warn argument_checking warning for mismatch between INTEGER
kinds with explicit interface.
- Add -warn argument_checking warning for insufficent arguments.
- Improve display of various diagnostic messages so that the
"pointer" is more appropriate.
- Fix internal compiler error when compiling a -mp or -omp program
with any COMMON or EQUIVALENCED data declared in a PRIVATE,
LASTPRIVATE, FIRSTPRIVATE, or REDUCTION list.
- Fix problem with TRANSFER of CHARACTER items using non-1 substring
offset.
- Don't give use-before-defined warning for pointer structure
assignment.
- Allow LOC(intrinsic_name).
- Allow RECORDs of empty STRUCTUREs.
- Allow repeat counts in FORMATs to be up to 2147483647.
- Always quadword-align EQUIVALENCE groups.
- Prevent internal compiler error with very long list of -D
definitions.
- Correct problem relating to use of an AUTOMATIC array in a parallel
region.
- Allow contained function result to have dimension bounds depend
upon size of one of its array arguments.
- Eliminate inappropriate argument mismatch warning with record
structures when -wsf is specified. Add support for -assume gfullpath,
which causes the full source file path to be included in the debug
information.
- If -check bounds is in effect, don't optimize implied-DO in I/O as
this can prevent bounds checking from occurring.
- Eliminate inappropriate use-before-defined warnings when passing
array slices.
- Improve generated code when calling routines with INTENT(IN).
Prevent an output statement (WRITE, etc.) from inhibiting
use-before-defined warnings.
- Improve generated code when calling intrinsic functions.
- -fast or -math_library fast implies -check nopower
- Fortran 90 interpretation 100 - ASSOCIATED of two zero-sized arrays
always returns .FALSE..
- Eliminate internal compiler error for
LOC(character-parameter-constant)
- Eliminate "text handle table overflow" errors for certain programs
that had very large and complicated single statements (eg. DATA).
- Allow structure field names which are the same as relational
operators.
- In pointer assignment, where the right-hand-side is a structure
constructor, enforce the standard's requirement that the constructor
expression be an allowable target.
- Allow a module procedure as an actual argument.
- Eliminate inappropriate error about use of PRIVATE type declared
later in the module.
- Eliminate parsing error where a KIND specifier is continued across
multiple source lines.
- Eliminate parsing error involving an assignment to a variable whose
name begins with "PARAMETER".
- When passing an element of a named array constant as an actual
argument, make sure that sequence association works as if it had been a
variable.
- Correct problem with visibility of inherited identifier.
- Elmininate internal compiler error for PARAMETER declaration where
the constant value is an undefined identifier.
- Eliminate internal compiler error involving a statement function
having the same name as another routine in the same compilation.
- Make severity of -warnings declarations diagnostics warning instead
of error.
- Eliminate internal compiler error when all source is
conditionalized away.
- Eliminate internal compiler error for certain programs which use
TRANSFER in a PARAMETER declaration.
- Allow a tab character in a FORMAT.
- Assume INTEGER type for bit constants where required.
- Don't sign extend result of ICHAR in a PARAMETER definition.
- Eliminate internal compiler error for certain programs using
functions with mask arguments.
- Make !DEC$ATTRIBUTES (no space) work in any column in fixed-form.
- Give proper error instead of internal compiler error when QFLOAT
used on platforms that don't support REAL*16.
- Don't consider a DECODE to modify the buffer argument for purposes
of INTENT.
- Eliminate internal compiler error for certain programs when -assume
dummy_aliases is in effect.
- Correct problem with certain programs using STRUCTUREs with %FILL
fields.
- When -real_size 64 is in effect, intrinsics with explicitly REAL*4
or COMPLEX*8 arguments are no longer inappropriately promoted to
REAL*8/COMPLEX*16.
- Do not cause internal compiler error for reference to undefined
user operator.
- Allow use of an array-constructor's implied DO variable in a
specification expression.
- Allow SIZE argument to be omitted to IISHFTC, JISHFTC, KISHFTC.
- Make result type of IBSET, IBCLR, IBITS, etc. be type of the first
argument.
- Allow up to 256 arguments to an intrinsic function (eg. MAX, MIN)
in a specification expression - the previous limit was 8.
- Give error for passing an array section with vector subscript to
INTENT(INOUT) or INTENT(OUT) argument.
- Fix internal compiler error for use in the length specification
expression for a function LEN(concatenation) where one of the
concatenation arguments is a passed-length argument to the function
being declared.
- Fix internal compiler error for use in the length specification
expression for a function LEN(TRIM(arg)) where arg is a passed-length
argument to the function being declared.
- Treat a negative declared length for a CHARACTER variable as if it
were zero.
- Properly parse "ELSE IFCONSTRUCT" where CONSTRUCT is a construct
name.
- Give an error when an AUTOMATIC variable is DATA initialized.
- Properly propagate (or not) PRIVATE attribute for nested USE.
- Eliminate undeserved argument conformance error in certain cases
involving WHERE masks.
- Ensure that the return kind of ICHAR is "default integer", no
matter what kind that is (due to integer_size switch).
- Fix internal compiler error for type constructor with string
argument for numeric element.
- Fix internal compiler error when an INTERFACE TO block has certain
syntax errors.
- Correctly parse non-standard 'n syntax for REC= in I/O statement
when the I/O list contains a quoted literal.
- Fix problem relating to ONLY and nested USE.
- Make variables whose names begin with $ have implicit INTEGER type.
- Allow $ in the range for IMPLICIT (sorts after Z).
- If a program has multiple USE statements where the module files
cannot be found, give error messages for each of them.
- Allow SIZEOF in EQUIVALENCE array index.
- Fix internal compiler error with certain array initializers
containing an implied DO.
- Accept F95-style reference to MAXVAL, MINVAL, MAXLOC, MINLOC with a
mask as a second non-keyword argument.
- Accept F95-style reference to PRODUCT and SUM with a mask as a
second non-keyword argument.
- Don't give inappropriate alignment warnings for REAL*16 variables
in COMMON.
- Don't give error message for empty FORALL statement body.
- Allow FORALL to be nested 7 deep (previous limit was 3).
- Correctly parse certain complex instances of named FORALL.
- Allow RESULT of ENTRY to have same name as host FUNCTION.
- Demote diagnostic for not using all active combinations of FORALL
index names from error to warning.
- Eliminate inappropriate error for certain uses of intrinsic
functions in a specification expression.
- Eliminate internal compiler error for a peculiar (and erroneous)
case of a USE of a NAMELIST whose group contains a variable inherited
from another module but which isn't visible due to an ONLY list.
- Make OPTIONS /EXTEND_SOURCE persistent across an INCLUDE.
- Add support for defined assignment statement from within a WHERE
statement.
- Allow a function result length to be computed using a field of an
array element, where the array is a derived type passed as a dummy
argument.
- Fix problem with functions returning complex/doublecomplex.
From version FT1 T5.2-682-4289P to FT2 T5.2-695-428AU, the following
corrections have been made:
- Allow an ALLOCATABLE variable to be PRIVATE in a parallel scope.
- Support ISHC for INTEGER*8.
- Correct problem with overlapping CHARACTER assignment in FORALL.
- Correct debug information for CHARACTER POINTERs.
- Correct problems with ISHFTC which can cause alignment errors.
- Correct problem with FORALL and WHERE with non-default integer size.
- Don't issue spurious UNUSED warning for argument whose interface
comes from a MODULE.
- Fix internal compiler error for invalid IMPLICIT syntax.
- Eliminate inappropriate type mismatch error for certain cases of
references to a generic procedure with a procedure argument.
- Allow use of . field separator in addition to % in
ALLOCATE/DEALLOCATE.
- Give warning of unused variable in module procedure when
appropriate.
- Do not allow a non-integer/logical expression in a logical IF.
- Fix another case of recognizing a RECORD field that has the same
name as a relational operator.
- Correct compiler failure for CMPLX(R8,R8) when real_size=64 is in
effect.
- Allow gaps in keyword names in MAX/MIN, for example MAX(A1=x,A4=y).
- Correct compiler failure when a COMPLEX array is initialized with a
REAL array constructor.
- Correct compiler failure when the CHAR intrinsic is used in an
initialization expression.
- Correct compiler failure ("possible out of order or missing USE")
in certain uses of nested MODULEs and ONLY.
- Show correct source pointer for syntax error in declaration.
From version FT2 T5.2-695-428AU to V5.2-705-428BH, the following
corrections have been made:
- The compiler now accepts a new DEFAULT keyword on the !DEC$
ATTRIBUTES directive. This tells the compiler to ignore any compiler
switches that change external routine or COMMON block naming or
argument passing conventions, and uses just the other attributes
specified (if any). The switches which this affects are -names and
-assume underscore.
- Avoid giving a spurious "Inconsistent THREADPRIVATE declaration of
common block" error if one COMMON block has a name which is an initial
substring of another and one of them is named in a THREADPRIVATE
directive.
- Prevent FUSE XREF from dying when !DEC$ ATTRIBUTES is used.
- Add support for -source_listing switch. The listing file has the
extension .lis.
- The f66 switch now establishes OPEN defaults of STATUS='NEW' and
BLANK='ZERO'.
- Correct compiler failure with RESHAPE and SHAPE used in an
initialization expression.
- Eliminate spurious error when a defined operator is used in a
specification expression
- Correct compiler failure when undefined user-defined operator is
seen.
- Eliminate spurious error when component of derived type named
constant is used in a context where a constant is required.
- Correct problem with host association and contained procedure.
- Correct compiler failure with WHERE when non-default integer_size
is in effect.
1.5.4 Version 5.2 Known Problems
The following known problems exist with DIGITAL Fortran Version
5.2:
- The following is a list of known problems for
-omp
and
-mp
parallel support in Version 5.2:
- Global variables referenced by statement functions inside parallel
regions should not reference local instances of those variable names.
The following example should print 42.0 {10 times} not 0.0:
real x,y(10)
statement(a) = a + x
x = 41.0
!$par parallel local(x)
x = -1.0
!$par pdo local(i)
do i=1,10
y(i) = statement(1.0)
end do
!$par end parallel
type *,y
end
|
- Nested parallel regions are not supported by
-omp
. A program that contains nested parallel regions will cause the
compiler to fail with an internal error.
- Please note that
-warn decl
gives an error level message, not a warning level message.
- When using DIGITAL Ladebug with certain versions of the UNIX
operating system, be aware that a trailing underscore may be needed to
display module variables. For example, to display variable X in module
MOD, if typing
print $mod$x$
does not display the variable's value, type:
1.6 Known Limitations
The following limitations exist in Version 5.2:
- When using the
-omp
or
-mp
options, if you declare a parallel DO loop which accesses an INTEGER*1
array (one element at a time), the results may not be correct unless
the user also specifies
-granularity byte
. In general, if a parallel loop tries to store things of "small" size
into packed spaces, the granularity needs to be set to that size.
However, while this "fixes" the program to do the right thing, it is a
dreadful performance slowdown. It would be better to execute such code
serially.
- If you specify the
-wsf
option to request parallel processing, the following DIGITAL Fortran 90
language features are not supported:
- REAL (KIND=16) (same as REAL*16) data type
- DIGITAL Fortran 77 implementation of CRAY-style pointers
- Variable format expressions (VFEs). For example:
- Initialization of DIGITAL Fortran 77 structures. For example:
STRUCTURE /S/
INTEGER I / 100 /
END STRUCTURE
|
1.7 High Performance Fortran (HPF) Support in Version 5.2
Digital Fortran 90 Version 5.2 supports the entire High Performance
Fortran (HPF) Version 2.0 specification with the following exceptions:
- Nested FORALL statements
- WHERE statements within FORALL statements
- Passing CYCLIC(N) arguments to EXTRINSIC (HPF_LOCAL) routines. See
Section 1.7.5.3.
- Accessing non-local data (other than arguments) within PURE
functions in FORALL statements
- SORT_UP library procedure
- SORT_DOWN library procedure
In addition, the compiler supports many HPF Version 2.0 approved
extensions including:
- Extrinsic (HPF_LOCAL) routines
- Extrinsic (HPF_SERIAL) routines
- Mapping of derived type components
- Pointers to mapped objects
- Shadow-width declarations
- All HPF_LOCAL_LIBRARY routines (except LOCAL_BLKCNT, LOCAL_LINDEX,
and LOCAL_UINDEX). Other exceptions are the approved extensions to
HPF_LOCAL_LIBRARY routines.
- ON directive within INDEPENDENT loops
- RESIDENT directive used with INDEPENDENT loops
1.7.1 Optimization
This section contains release notes relevant to increasing code
performance. You should also refer to Chapter 7 of the DIGITAL High
Performance Fortran HPF and PSE Manual for more detail.
1.7.1.1 The -fast Compile-Time Option
To get optimal performance from the compiler, use the
-fast
option if possible.
Use of the
-fast
option is not permitted in certain cases, such as programs with
zero-sized data objects or with very small nearest-neighbor arrays.
For More Information:
- On the cases where use of
-fast
is not permitted, see the "Optimizing" and "Compiling" chapters of the
DIGITAL High Performance Fortran HPF and PSE Manual.
1.7.1.2 Non-Parallel Execution of Code
The following constructs are not handled in parallel:
- Reductions with non-constant DIM argument.
- CSHIFT, EOSHIFT and SPREAD with non-constant DIM argument.
- Some array-constructors
- PACK, UNPACK, RESHAPE
- xxx_PREFIX, xxx_SUFFIX, GRADE_UP, GRADE_DOWN
- In the current implementation of DIGITAL Fortran 90, all I/O
operations are serialized through a single processor; see Chapter 7 of
the DIGITAL High Performance Fortran HPF and PSE Manual for
more details
- Date and time intrinsics, including DATE_AND_TIME, SYSTEM_CLOCK,
DATE, IDATE, TIME, and SECNDS
If an expression contains a non-parallel construct, the entire
statement containing the expression is executed in a nonparallel
fashion. The use of such constructs can cause degradation of
performance. DIGITAL recommends avoiding the use of constructs to which
the above conditions apply in the computationally intensive kernel of a
routine or program.
1.7.1.3 INDEPENDENT DO Loops Currently Parallelized
Not all INDEPENDENT DO loops are currently parallelized. It is
important to use the
-show hpf
or
-show hpf_indep
compile-time option, which will give a message whenever a loop marked
INDEPENDENT is not parallelized.
Currently, a nest of INDEPENDENT DO loops is parallelized whenever the
following conditions are met:
- When INDEPENDENT DO loops are nested, the NEW keyword must be used
to assert that all loop variables (except the outer loop variable) are
NEW. It is recommended that the outer DO loop variable be in the NEW
list, as well.
- The loop does not contain any of the constructs listed in
Section 1.7.1.2 that cause non-parallel execution.
- Each subscript of each array reference must either
- contain no references to INDEPENDENT DO loop variables, or
- contain one reference to an INDEPENDENT DO loop variable and the
subscript expression is an affine function of that DO loop variable.
- At least one array reference must reference all the independent
loops in a nest of independent loops.
- The compiler must be able to prove that loop nest either
- requires no inter-processor communication, or
- can be made to require no inter-processor communication with
compiler-generated copyin/copyout code around the loop nest.
- Any reductions in an interior (i.e. any but the outer) loop may use
an INDEPENDENT DO index as a subscript only if that index represents a
serially distributed dimension of the array. An exception to this is
the index of the outermost DO loop, which may be used as a subscript
even if it represents a non-serially distributed array dimension.
- There must not be any assignments to scalars, except for NEW or
reduction variables.
- Any procedure call inside an INDEPENDENT DO loop must either be
PURE, or be encapsulated in an ON HOME RESIDENT region (see
Section 1.7.5.6).
When the entire loop nest is encapsulated in an ON HOME RESIDENT
region, then only the first two restrictions apply.
For More Information:
- On enclosing INDEPENDENT DO loops in an ON HOME RESIDENT region,
see Section 1.7.5.6
1.7.1.4 Nearest-Neighbor Optimization
The following is a list of conditions that must be satisfied in an
array assignment, FORALL statement, or INDEPENDENT DO loop in order to
take advantage of the nearest-neighbor optimization:
- Relevant arrays with the POINTER or TARGET attributes must have
shadow edges explicitly declared with the SHADOW directive.
- The arrays involved in the nearest-neighbor style assignment
statements should not be module variables or variables assigned by USE
association. However, if both the actual and all associated dummies are
assigned a shadow-edge width with the SHADOW directive, this
restriction is lifted.
- A value must be specified for the
-wsf
option on the command line.
- Some interprocessor communication must be necessary in the
statement.
- Corresponding dimensions of an array must be distributed in the
same way (though they can be offset using an ALIGN directive). If the
-nearest_neighbor
flag's optional nn field is used to specify a maximum
shadow-edge width, only constructs with a subscript difference
(adjusted for any ALIGN offset) less than or equal to the value
specified by nn will be recognized as nearest neighbor. For
example, the assignment statement (FORALL (i=1:n)
A(i) = B(i-3)) has a subscript difference of
3
. In a program compiled with the flag
-nearest_neighbor 2
, this assignment statement would not be eligible for the nearest
neighbor optimization.
- The left-hand side array must be distributed BLOCK in at least one
dimension.
- The arrays must not have complicated subscripts (no vector-valued
subscripts, and any subscripts containing a FORALL index must be affine
functions of one FORALL index; further, that FORALL index must
not be repeated in any other subscript of a particular array reference).
- Statements with scalar subscripts are eligible only if that array
dimension is (effectively) mapped serially.
- Subscript triplet strides must be known at compile time and be
greater than 0.
- The arrays must be distributed BLOCK or serial (*) in each
dimension.
Compile with the
-show hpf
or
-show hpf_nearest
switch to see which lines are treated as nearest-neighbor.
Nearest-neighbor communications are not profiled by the
pprof
profiler. See the section about the
pprof
Profile Analysis Tool in the Parallel Software Environment (PSE)
Version 1.6 release notes.
For More Information:
- On profiling nearest-neighbor computations, see the section about
the
pprof
Profile Analysis Tool in the Parallel Software Environment (PSE)
Version 1.6 release notes.
- On using EOSHIFT for nearest-neighbor computations, see Section 1.7.1.6
1.7.1.5 Widths Given with the SHADOW Directive Agree with Automatically Generated Widths
When compiler-determined shadow widths don't agree with the widths
given with the SHADOW directive, less efficient code will usually be
generated.
To avoid this problem, create a version of your program without the
SHADOW directive, and compile with the -show
hpf or -show hpf_near option.
The compiler will generate messages that include the sizes of the
compiler-determined shadow widths. Make sure that any widths you
specify with the SHADOW directive match the compiler-generated widths.
1.7.1.6 Using EOSHIFT Intrinsic for Nearest Neighbor Calculations
In the current compiler version, the compiler does not always recognize
nearest-neighbor calculations coded using EOSHIFT. Also, EOSHIFT is
sometimes converted into a series of statements, only some of which may
be eligible for the nearest neighbor optimization.
To avoid these problems, DIGITAL recommends using CSHIFT or FORALL
instead of EOSHIFT if these alternatives meet the needs of your program.
1.7.2 New Features
This section describes the new HPF features in this release of DIGITAL
Fortran 90.
1.7.2.1 RANDOM_NUMBER Executes in Parallel
The RANDOM_NUMBER intrinsic subroutine now executes in parallel for
mapped data. The result is a significant decrease in execution time.
1.7.2.2 Improved Performance of TRANSPOSE Intrinsic
The TRANSPOSE intrinsic will execute faster for most arrays that are
mapped either * or BLOCK in all dimensions.
1.7.2.3 Improved Performance of DO Loops Marked as INDEPENDENT
Certain induction variables are now recognized as affine functions of
the INDEPENDENT DO loop indices, thus meeting the requirements listed
in Section 1.7.1.3. Now, the compiler can parallelize array references
containing such variables as subscripts. An example is next.
! Compiler now recognizes a loop as INDEPENDENT because it
! knows that variable k1 is k+1.
PROGRAM gauss
INTEGER, PARAMETER :: n = 1024
REAL, DIMENSION (n,n) :: A
!HPF$ DISTRIBUTE A(*,CYCLIC)
DO k = 1, n-1
k1 = k+1
!HPF$ INDEPENDENT, NEW(i)
DO j = k1, n
DO i = k1, n
A(i,j) = A(i,j) - A(i,k) * A(k,j)
ENDDO
ENDDO
ENDDO
END PROGRAM gauss
|
1.7.3 Corrections
This section lists problems in previous versions that have been fixed
in this version.
- In programs compiled with the
-wsf
option, pointer assignments inside a FORALL did not work reliably. In
many cases, incorrect program results occurred.
- The ASSOCIATED intrinisc sometimes returned incorrect results in
programs compiled with the
-wsf
compile-time option.
- GRADE_UP and GRADE_DOWN were not stable sorts.
1.7.4 Known Problems
1.7.4.1 "Variable used before its value has been defined" Warning
The compiler may inappropriately issue a "Variable is used before
its value has been defined" warning. If the variable named in the
warning does not appear in your program (e.g. var$0354), you should
ignore the warning.
1.7.4.2 Mask Expressions Referencing Multiple FORALL Indices
FORALL statements containing mask expressions referencing more than
seven FORALL indices do not work properly.
1.7.5 Unsupported Features
This section lists unsupported features in this release of DIGITAL
Fortran 90.
1.7.5.1 SMP Decomposition (OpenMP) not Currently Compatible with HPF
Manual decomposition directives for SMP (such as the OpenMP directives
enabled with the
-omp
option, or the directives enabled with the
-mp
option) are not currently compatible with the
-wsf
option.
1.7.5.2 Command Line Options not Compatible with the -wsf Option
The following command line options may not be used with the
-wsf
option:
- The -feedback and -cord options are not compatible, since they
require the use of -p, which is not compatible with
-wsf
.
- -double_size 128
- -gen_feedback
- -p, -p1, -pg (use -pprof instead)
- -fpe1, -fpe2, -fpe3, -fpe4
- -om
- -mp
- -omp
1.7.5.3 HPF_LOCAL Routines
Arguments passed to HPF_LOCAL procedures cannot be distributed
CYCLIC(n). Furthermore, they can have neither the inherit
attribute nor a transcriptive distribution.
Also, the following procedures in the HPF Local Routine Library are not
supported in the current release:
- ACTIVE_NUM_PROCS
- ACTIVE_PROCS_SHAPE
- HPF_MAP_ARRAY
- HPF_NUMBER_MAPPED
- LOCAL_BLKCNT
- LOCAL_LINDEX
- LOCAL_UINDEX
1.7.5.4 SORT_UP and SORT_DOWN Functions
The SORT_UP and SORT_DOWN HPF library procedures are not supported.
Instead, use GRADE_UP and GRADE_DOWN, respectively.
1.7.5.5 Restricted Definition of PURE
In addition to the restrictions on PURE functions listed in the Fortran
95 language standard and in the High Performance Fortran Language
Specification, DIGITAL Fortran 90 adds the additional restriction
that PURE functions must be resident. "Resident"
means that the function can execute on each processor without reading
or writing any data that is not local to that processor.
Non-resident PURE functions are not handled. They will probably cause
failure of the executable at run-time if used in FORALLs or in
INDEPENDENT DO loops.
1.7.5.6 Restrictions on Procedure Calls in INDEPENDENT DO and FORALL
In order to execute in parallel, procedure calls from FORALL and DO
INDEPENDENT constructs must be resident. "Resident"
means that the function can execute on each processor without reading
or writing any data that is not local to that processor. The compiler
requires an explicit assertion that all procedure calls are resident.
You can make this assertion in one of two ways:
- by labeling every procedure called by the FORALL or INDEPENDENT DO
loop as PURE
- by encapsulating the entire body of the loop in an ON HOME RESIDENT
region.
Because of the restricted definition of PURE in DIGITAL Fortran 90 (see
Section 1.7.5.5), the compiler interprets PURE as an assertion by the
program that a procedure is resident.
Unlike procedures called from inside FORALLs, procedures called from
inside INDEPENDENT DO loops are not required to be PURE. To assert to
the compiler that any non-PURE procedures called from the loop are
resident, you can encapsulate the entire body of the loop in an ON HOME
RESIDENT region.
If you incorrectly assert that a procedure is resident (using either
PURE or ON HOME RESIDENT), the program will either fail at run time, or
produce incorrect program results.
Here is an example of an INDEPENDENT DO loop containing an ON HOME
RESIDENT directive and a procedure call:
!HPF$ INDEPENDENT
DO i = 1, 10
!HPF$ ON HOME (B(i)), RESIDENT BEGIN
A(i) = addone(B(i))
!HPF$ END ON
END DO
.
.
.
CONTAINS
FUNCTION addone(x)
INTEGER, INTENT(IN) :: x
INTEGER addone
addone = x + 1
END FUNCTION addone
|
The ON HOME RESIDENT region does not impose any syntactic restrictions.
It is merely an assertion that inter-processor communication will not
actually be required at run time.
For More Information:
- On the requirements for parallel execution of INDEPENDENT DO loops,
see Section 1.7.1.3
1.7.5.7 Restrictions on Routines Compiled with -nowsf_main
The following are restrictions on dummy arguments to routines compiled
with the -nowsf_main compile-time option:
- The dummy must not be assumed-size
- The dummy must not be of type CHARACTER*(*)
- The dummy must not have the POINTER attribute
- %LOC must not be applied to distributed arguments
Failure to adhere to these restrictions may result in program failure,
or incorrect program results.
1.7.5.8 RAN and SECNDS Are Not PURE
The intrinsic functions RAN and SECNDS are serialized (not executed in
parallel). As a result, they are not PURE functions, and cannot be used
within a FORALL construct or statement.
1.7.5.9 Nonadvancing I/O on stdin and stdout
Nonadvancing I/O does not work correctly on
stdin
and
stdout
. For example, this program is supposed to print the prompt ending with
the colon and keep the cursor on that line. Unfortunately, the prompt
does not appear until after the input is entered.
PROGRAM SIMPLE
INTEGER STOCKPRICE
WRITE (6,'(A)',ADVANCE='NO') 'Stock price1 : '
READ (5, *) STOCKPRICE
WRITE (6,200) 'The number you entered was ', STOCKPRICE
200 FORMAT(A,I)
END PROGRAM SIMPLE
|
The work-around for this bug is to insert a CLOSE statement after the
WRITE to
stdout
. This effectively flushes the buffer.
PROGRAM SIMPLE
INTEGER STOCKPRICE
WRITE (6,'(A)',ADVANCE='NO') 'Stock price1 : '
CLOSE (6) ! Add close to get around bug
READ (5, *) STOCKPRICE
WRITE (6,200) 'The number you entered was ', STOCKPRICE
200 FORMAT(A,I)
END PROGRAM SIMPLE
|
1.7.5.10 WHERE and Nested FORALL
The following statements are not currently supported:
- WHERE statements inside FORALLs
- FORALLs inside WHEREs
- Nested FORALL statements
When nested DO loops are converted into FORALLs, nesting is ordinarily
not necessary. For example,
DO x=1, 6
DO y=1, 6
A(x, y) = B(x) + C(y)
END DO
END DO
|
can be converted into
FORALL (x=1:6, y=1:6) A(x, y) = B(x) + C(y)
|
In this example, both indices (x and y) can be defined in a single
FORALL statement that produces the same result as the nested DO loops.
In general, nested FORALLs are required only when the outer index is
used in the definition of the inner index. For example, consider the
following DO loop nest, which adds 3 to the elements in the upper
triangle of a 6 x 6 array:
DO x=1, 6
DO y=x, 6
A(x, y) = A(x, y) + 3
END DO
END DO
|
In Fortran 90, this DO loop nest can be replaced with the following
nest of FORALL structures:
FORALL (x=1:6)
FORALL (y=x:6)
A(x, y) = A(x, y) + 3
END FORALL
END FORALL
|
However, nested FORALL is not currently supported in parallel (i.e.
with the
-wsf
option).
A work-around is to use the INDEPENDENT directive:
integer, parameter :: n=6
integer, dimension (n,n) :: A
!hpf$ distribute A(block,block)
A = 8
!hpf$ independent, new(i)
do j=1,n
!hpf$ independent
do i=j,n
A(i,j) = A(i,j) + 3
end do
end do
print "(6i3)", A
end
|
All three of these code fragments would convert a matrix like this:
8 8 8 8 8 8
8 8 8 8 8 8
8 8 8 8 8 8
8 8 8 8 8 8
8 8 8 8 8 8
8 8 8 8 8 8
|
into this matrix:
11 11 11 11 11 11
8 11 11 11 11 11
8 8 11 11 11 11
8 8 8 11 11 11
8 8 8 8 11 11
8 8 8 8 8 11
|
1.7.6 Obsolete Features Deleted
1.7.6.1 GLOBAL_TO_PHYSICAL and GLOBAL_LBOUNDS are Deleted
The following obsolete HPF Local Library routines have been deleted:
- GLOBAL_TO_PHYSICAL
- GLOBAL_LBOUNDS
1.7.7 Miscellaneous
This section contains miscellaneous release notes relevant to HPF.
1.7.7.1 What To Do When Encountering Unexpected Program Behavior
This section gives some guidelines about what to do when your program
displays unexpected behavior at runtime. The two most common problems
are incorrect programs that either segmentation fault or hang at
runtime.
Before attempting to debug parallel HPF programs, it is important to
verify first that the program runs correctly when compiled without the
-wsf
command line switch.
When the problem occurs only when compiled with the
-wsf
switch, the best way to debug these programs is to execute them with the
-debug
command line switch.
In addition, programs with zero sized arrays which were compiled with
-fast
or
-assume nozsize
may behave erratically or fail to execute.
1.7.7.1.1 Incompatible or Incomplete Libraries Installed
If your program displays unexpected behavior at runtime, your system
might have incomplete or incompatible libraries installed. You must
have PSE160 installed on your system to execute programs compiled with
the
-wsf
switch. PSE180 is not sufficient. In addition, for this release, you
must have first installed PSE160. Then you must have installed Fortran
V5.2, including the HPFLIBS170 subset.
Choose one of the following options to fix an incorrect installation:
- If you have installed Fortran V5.2 but are missing PSE160, then
install PSE160. Delete the HPFLIBS170 subset of Fortran V5.2 and then
reinstall the HPFLIBS170 subset.
- If you installed Fortran V5.2 first and then PSE160, then delete
the HPFLIBS170 subset of Fortran V5.2. Next, reinstall the HPFLIBS170
subset.
- If you already have Fortran V5.2 and PSE160 installed but did not
install the HPFLIBS170 subset of Fortran V5.2, then simply install the
HPFLIBS170 subset.
- If you deleted any old PSESHPF subset after installing Fortran
V5.2, this will also cause problems. In this case delete the HPFLIBS170
subset of Fortran V5.2 and then reinstall the HPFLIBS170 subset.
- If you have installed PSE180 but not PSE160, then begin to correct
this situation by deleting PSE180. Install PSE160. Next, reinstall
PSE180. You need both PSE160 and PSE180; PSE180 must be installed last.
Finish by deleting the HPFLIBS170 subset of Fortran V5.2 and then
reinstalling the HPFLIBS170 subset.
For more information about installing PSE160, see the DIGITAL
Parallel Software Environment Release Notes, Version 1.6.
For more information about installing PSE180, see the DIGITAL
Parallel Software Environment Release Notes, Version 1.8.
1.7.7.1.2 Segmentation Faults
When a program segmentation faults at runtime it can be confusing
because it may look like the program executed, even though no output is
produced. The PSE does not always display an error message when the
return status of the executed program is non zero. In particular, if
the program segmentation faults it does not display an error message,
the program just stops. In this example, program "bad" gets a
segmentation fault at runtime.
To see the execution status, type this
csh
command (other shells require different commands):
A status of
-117
indicates a segmentation fault. See the section about known problems in
the Parallel Software Environment (PSE) Version 1.6 release notes.
Alternatively, you can run the program in the debugger. This is better
because it shows what went wrong on each peer. To do this, use the
-debug
command line switch.
See Chapter 9 of the DIGITAL High Performance Fortran HPF and PSE
Manual for more information.
Note that some correct programs may segmentation fault at runtime due
to lack of stack space and data space. See Section 1.7.7.2 for further
details.
1.7.7.1.3 Programs that Hang
If your program hangs at runtime, rerun it in the debugger. You can type
<ctrl>/c
in the debugger to get it to stop. Then look at the stack frames to
determine where and why the program is hanging. Programs can hang for
many reasons. Some of the more common reasons are:
- Incorrect or incorrectly-spelled HPF directives
- Incorrect usage of extrinsic routines
- Templates not large enough
- Incorrect interfaces
- Missing interface blocks
- Allocatables aligned incorrectly
- Arrays aligned outside of template bounds
- Exceeding the available stack or data space (see Section 1.7.7.2)
It is always best to compile, run, and debug the program without the
-wsf
switch first to verify program correctness. Since it is easier to debug
scalar programs than parallel programs, this should always be done
first.
1.7.7.1.4 Programs with Zero Sized Arrays
Programs with zero sized arrays should not be compiled with the
-fast
or the
-assume nozsize
command line switches; see Chapter 8 in the DIGITAL High
Performance Fortran HPF and PSE Manual. If you incorrectly compile
this way there are several different types of behavior that might
occur. The program might return an error status of
-122
or
-177
or
64
. It might also hang (or timeout when the
-timeout
switch is used). Try compiling the program without these options and
execute it to see if it works correctly. If it does, there is most
likely a zero-sized array in the program.
1.7.7.2 Stack and Data Space Usage
Exceeding the available stack or data space on a processor can cause
the program execution to fail. The failure takes the form of a
segmentation violation, which results in an error status of -117. (See
the section about known problems in the Parallel Software Environment
(PSE) Version 1.6 release notes.) This problem can often be corrected
by increasing the stack and data space sizes or by reducing the stack
and data requirements of the program. The following
csh
commands increase the sizes of the stack and data space up to system
limits (other shells require different commands):
limit stacksize unlimited
limit datasize unlimited
|
If your system limits are not sufficient, contact your system
administrator, and request that
maxdsiz
(the data space limit) and/or
maxssiz
(the stack limit) be increased.
1.7.7.3 Non-"-wsf" main programs
The ability to call parallel HPF subprograms from non-parallel (Fortran
or non-Fortran) main programs, is supported in this release. For more
information, see Chapter 6 of the DIGITAL High Performance Fortran
HPF and PSE Manual.
1.7.7.4 Using "-std" Disables HPF Directive Checking
Normally, all HPF directives are checked for syntactic and semantic
correctness regardless of whether or not the
-wsf
switch is specified. To disable this checking, specify the
-std
option.
1.7.7.5 Use the Extended Form of HPF_ALIGNMENT
Due to an anomaly in the High Performance Fortran Language
Specification, the extended version of the HPF_ALIGNMENT library
routine (High Performance Fortran Language Specification V.2
Section 12.2) is incompatible with the standard version (High
Performance Fortran Language Specification V.2 Section 7.7).
In particular, the DYNAMIC argument, which is valid only in the
extended version, is not the final argument in the argument list.
Because each compiler vendor must choose to implement only one version
of this library routine, programs that use this routine are not
portable from one compiler to another unless keywords are used for each
of the optional arguments.
DIGITAL chooses to support the extended version of this library routine.
1.7.7.6 EXTRINSIC(SCALAR) Changed to EXTRINSIC(HPF_SERIAL)
EXTRINSIC(SCALAR) was renamed to EXTRINSIC(HPF_SERIAL) to be compatible
with Versions 1.1 and later of the High Performance Fortran
Language Specification. EXTRINSIC(SCALAR) continues to be
supported in this release, but may not be supported in future releases.
1.7.8 Example Programs
The
/usr/examples/hpf
directory contains example Fortran programs. Most of these programs are
referred to in the HPF Tutorial section of the DIGITAL High
Performance Fortran HPF and PSE Manual. Others are just there to
show examples of HPF code and PVM code. The provided makefile can be
used to compile all these programs.
-
heat_example.f90
solves a heat flow distribution problem. It is referred to by the
Solving Nearest Neighbor Problems section of the DIGITAL High
Performance Fortran HPF and PSE Manual.
-
io_example.f90
implements a network striped file. It is referred to by the Network
Striped Files chapter of the DIGITAL High Performance Fortran HPF
and PSE Manual. This program is a good example of how to use
EXTRINSIC(HPF_LOCAL) routines.
-
lu.f90
implements a LU Decomposition. It is referred to by the LU
Decomposition chapter of the DIGITAL High Performance Fortran HPF
and PSE Manual.
-
mandelbrot.f90
visualizes the Mandelbrot Set. It is referred to by the HPF Tutorial.
This program uses the PURE attribute and non-Fortran subprograms within
an HPF program. Mandelbrot also requires these files:
simplex.h, simplex.c
, and
dope.h
. Read the
readme.mandelbrot
file to see how to compile and execute Mandelbrot.
-
pi_example.f90
calculates pi using four different Fortran 90 methods. This program
contains a timing module which may be pulled out and used separately.
-
shallow.f90
is a optimized HPF version of the Shallow Water benchmark.
-
twin.f90
demonstrates DIGITAL Fortran 90's new non-wsf main program capability.
-
hpf_gexample.f
is a Fortran program with explicit calls to PVM. It demonstrates some
group and reduction operations in PVM. You must have PVM installed to
run this program.
-
hpf.tcl
is a TK-based HPF data distribution learning aid. It illustrates the
data distribution patterns represented by various data distributions,
such as (BLOCK, *), (*, CYCLIC), (BLOCK, CYCLIC), etc.
-
fft.f90
performs a fast Fourier transform, achieving parallelism by means of
EXTRINSIC(HPF_LOCAL) routines.
1.8 New Features and Corrections in Version 5.1
Version 5.1 is a major release that includes corrections to problems
discovered since Version 5.0 was released.
The following topics are discussed:
1.8.1 Version 5.1 New Features
The following new DIGITAL Fortran 90 features are now supported:
- DIGITAL Fortran 90 on UNIX contains full support for OpenMP. Here
are some details from the OpenMP web site (http://www.openmp.org).
The OpenMP application program interface (API) supports
multi-platform shared-memory programming on UNIX platforms and
Microsoft® Windows NTTM
architectures. Jointly defined
by a group of major computer hardware and software vendors, OpenMP is a
portable, scalable model that gives shared-memory programmers a simple
and flexible interface for developing parallel applications for
platforms ranging from the desktop to the supercomputer.
For more
information on the OpenMP Fortran API, see the revised user manual.
The following directives in OpenMP are supported by DIGITAL Fortran
90 Version 5.1:
- !$OMP PARALLEL and !$OMP END PARALLEL
- !$OMP DO and !$OMP END DO
- !$OMP SECTIONS and !$OMP END SECTIONS and !$OMP SECTION
- !$OMP SINGLE and !$OMP END SINGLE
- !$OMP PARALLEL DO and !$OMP END PARALLEL DO
- !$OMP PARALLEL SECTIONS and !$OMP END PARALLEL SECTIONS
- !$OMP MASTER and !$OMP END MASTER
- !$OMP CRITICAL [(name)] and !$OMP END CRITICAL [(name)]
- !$OMP BARRIER
- !$OMP ATOMIC
- !$OMP FLUSH
- !$OMP ORDERED and !$OMP END ORDERED
- !$OMP THREADPRIVATE
The following clauses on directives in OpenMP are supported by
DIGITAL Fortran 90 Version 5.1:
- IF (exp)
- PRIVATE(list)
- SHARED(list)
- DEFAULT (PRIVATE | SHARED | NONE)
- FIRSTPRIVATE(list)
- LASTPRIVATE(list)
- REDUCTION({operator | intrinsic} : list)
- COPYIN(list)
- SCHEDULE(type[,chunksize])
- ORDERED
- The following new features are now supported:
- As of DIGITAL UNIX v4.0, constants in Fortran code are placed in
read-only memory. An attempt to modify a constant (as in the example
below) has always been an error but will now cause the program to abort:
CALL F (1)
...
SUBROUTINE F (I)
I = 2
|
- A change in the math library (
libm
) starting with DIGITAL UNIX v4.0B is that MOD(3.0,0.0) now returns "floating invalid"; it
used to return "0".
- Several new intrinsics are now available in DIGITAL Fortran 90. For
more details, see the online Fortran 90 help file, located in:
/usr/lib/cmplrs/fort/decfortran90.hlp
|
- ASM - execute in-line assembler code
- LEADZ and TRAILZ - count leading and trailing 0 bits in an integer
- POPCNT - count 1 bits in an integer
- POPPAR - parity of the bits in an integer
- MULT_HIGH - multiply two 64-bit unsigned integers
- The X-Open Standard followed by DIGITAL UNIX made a change to its
"pow" function that affects Fortran's "**" operation: (0.0)**Y for all
negative values of Y (single or DOUBLE PRECISION) will now return
"-Infinity" (using
-fpe3
); it used to return "+Infinity".
- The following new
f90
command options are now supported:
-
-align recnbyte
Requests that fields of records and components of derived types be
aligned on the smaller of:
- The size byte boundary (N) specified (N is 1, 2,
4, or 8)
- The boundary that will naturally align them
Specifying
-align recnbyte
does not affect whether common blocks are naturally aligned or packed.
-
-altparam
Specifies if the alternate form of parameter constant declarations
(without parenthesis) is recognized. The default is
-altparam
.
-
-assume minus0
Tells compiler to use Fortran 95 standard semantics for the
treatment of the IEEE floating value -0.0 {of all KINDs}. There are two
places where Fortran 95 defines behavior on -0.0:
- SIGN (data, -0.0) is "data" with a negative sign, whereas the
Fortran 90 standard says SIGN (data, -0.0) is the same as SIGN (data,
+0.0) which is "data" with a positive sign
- Fortran 95 says that -0.0 prints as "-0.0", whereas Fortran 90 says
it prints as "0.0"
-assume nominus0
is the default {this is a change from DIGITAL Fortran 90 v5.0} and
means that SIGN (data, -0.0) is the same as SIGN (data, +0.0) {the
Fortran 90 and FORTRAN 77 standard semantics}
The
f95
command driver adds "
-assume minus0
" to the compiler command line (before any other options) so the
f95
command will get the Fortran 95 standard semantics.
-
-check omp_bindings
Provides run-time checking to enforce the OpenMP binding rules:
- It is an error to enter a DO, SINGLE, or SECTIONS if you are
already in a work-sharing construct, a CRITICAL SECTION, or a MASTER.
- It is an error to attempt to execute a BARRIER if you are already
in a work-sharing construct, a CRITICAL SECTION, or a MASTER.
- It is an error to attempt to execute a MASTER directive if you are
already in a work-sharing construct.
- It is an error to execute an ORDERED directive if you are already
in a CRITICAL SECTION.
- It is an error to execute an ORDERED directive unless you are
already in an ORDERED DO.
The default is
-check noomp_bindings
:
-
-omp
implies
-check omp_bindings
-
-fast -omp
implies
-check noomp_bindings
, regardless of the placement of
-fast
- If the user wants the checking done on
-mp
, specify
-check omp_bindings
explicitly
At run-time, the errors in example program
t.f
trigger an ASSERTION error and the program aborts:
Example program t.f:
real b(100)
x = 0
!$omp paralleldo
do i= 1, 100
b(i) = i
!$omp single
x = x + 1
!$omp end single
end do
print *, b, x
end
> f90 -omp t.f
> a.out
forrtl: severe (145): assertion error
|
-
-module directory
Requests that the compiler create module files in the specified
directory instead of the current directory.
-
-omp
Enables recognition of OpenMP directives.
-
-std95
Enables Fortran 95 standards checking (
-std90
or
-std
enable Fortran 90 standards checking).
-
-warn truncated_source
Requests that the compiler issues a warning diagnostic message
when it reads a source line with a statement field that exceeds the
maximum column width in fixed-format source files. The maximum column
width for fixed-format files is column 72 or 132, depending whether the
-extend_source
option was specified.
This option has no effect on truncation;
lines that exceed the maximum column width are always truncated.
This option does not apply to free-format source files. The default is
-warn notruncated_source
.
- Additional support has been provided for directed parallel
processing using the
-omp
and
-mp
options.
For more information on the parallel directives, see the
DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems
available with Version 5.1.
To allow task-local thread storage, you
must be using Version 4.0D (code name PTmin) of the DIGITAL UNIX
operating system.
The following problem in the use of
-omp
and
-mp
parallel directives should be noted:
In the following example
test.f
, the user should add "firstprivate(k,m)" to initialize the private
variables k and m for use in the loop control expressions.
Example test.f:
dimension x(10)
k = 1
m = 10
!$omp parallel
!$omp do private(k,m)
do i = k,m
x(i) = i
enddo
!$omp end parallel
print *, x
end
> f90 -omp test.f
f90: Warning: test.f, line 8: Variable K is used before its value has been
defined
do i = k,m
------^
f90: Warning: test.f, line 8: Variable M is used before its value has been
defined
do i = k,m
------^
|
- The following Fortran 95 features are have been implemented in
Version 5.1:
- Zero-length formats
On output, when using I, B, O, Z, and F
edit descriptors, the specified value of the field width can be zero.
In such cases, the compiler selects the smallest possible positive
actual field width that does not result in the field being filled with
asterisks (*).
- The command-line options
-assume minus0
and
-std95
(described previously in this section).
1.8.2 Version 5.1 Corrections
Since Version 5.0, the following corrections have been made:
- Using ASSOCIATED with f90 pointer now gives correct answer.
- Using vector subscripts in MATMUL now gives correct answer.
- Passing %REF argument to a routine with explicit INTERFACE no
longer gets an internal error.
- CSHIFT of an array pointer contained within a derived type no
longer gets an internal error.
- Compiling files that contain very long routine names with
-v
no longer gets an internal error.
- Using assignments in a defined generic assignment subroutine when
the subroutine is not RECURSIVE now gets an error.
- Parameter constant is allowed as argument of a LOC intrinsic.
- Using UNION within derived type now gets correct result.
- Having EQUIVALENCEd character array elements within a MODULE no
longer gets internal error.
- Duplicate SAVE statement no longer gets an error.
- Parameter constant can be used as case-value in a SELECT CASE
statement.
- ALIAS attribute can now be specified in a cDEC$ ATTRIBUTE directive
for a variable that has not been declared EXTERNAL (EXTERNAL is
assumed).
- Interface with optional function argument is now resolved properly.
- Using record fields in multiply and add operations now produces
correct result.
- Using the following operators: :=,=, /=, <, >, <=, and
>= no longer get non-standard conforming warnings.
- Extra trailing blanks are now allowed and ignored when used in
specifier of OPEN statement, e.g., FORM='formatted '.
- Passing an array argument to a statement function now gets an error.
- INTEGER*2 array now gets correct result when compiled with
-integer_size 16
.
- Fix a bug related to module importing with modules that contain
PRIVATE statement.
- Parameter constant defined in a MODULE is now imported when its use
is only in a variable format expression.
- C attribute can be specified in a cDEC$ ATTRIBUTE directive for
module variables.
- Parameter constants are allowed in a structure constructor.
- A derived type component having the same name as a common block no
longer gets an internal error.
- IVDEP directive can be specified between PDO and DO statements.
- A non-standard warning is issued if the first argument of a GENERIC
assignment procedure is not INTENT(OUT) or INTENT(INOUT).
- $PACK directive and the
-align recnbyte
option now affect alignment of data items in a SEQUENCE derived-type.
- Using a structure constructor to initialize a multi-dimensional
array component of a derived-type no longer causes an internal error.
- Fix $omp parallel copyin (/common_block/) directive.
- The
-fpconstant
option now works correctly for assignment to double complex variables.
- Having a D line as the first non-comment line after a conditional
$ENDIF directive no longer gets an error.
- No longer flag ES format as non-standard.
- Remove an internal limit on the number of entries of a NAMELIST
- Using substring of a character array as argument of ICHAR intrinsic
no longer gets internal error
- Pointer assignment of an array of character substrings now gets
correct result. For example: p=>a(:)(2:4) )
- Using array transformation intrinsics such as PACK, SPREAD, and
RESHAPE with array of derived-type as argument in a PRINT statement now
gets correct results
- Allow an array with a name of TYPE
- Specifying $NOFREEFORM in a .f90 file now sets the line size to 72
columns
- Remove a limit of 256 number of arguments for subroutines and
functions
- An incorrect statement: "IF (ABS(I).GT 1) I=0" now gets an error
message
- An incorrect statement: "CHARACTER(LEN=1), PARAMETER :: CPSCLR = ''
''" now gets an error message
- Using record fields in multiply and subtract operations now
produces correct results
- Having a PRIVATE, EQUIVALENCE variable in a module no longer causes
compile time segmentation violation
- Specifying ONLY on one variable in a COMMON block now only declares
the one variable (not the entire variables) in the COMMON block
- Allow user-defined operator to be used as the format character
expression in a PRINT or READ statement
- Using modules and the AUTOMATIC statement in the same routine no
longer gets internal error
- Module variables with EXTERN attributes now work properly
- Increase an internal limit so that large programs no longer get the
"text handle table overflow" message
- Using record fields in exponentiation and subtract operations now
produce correct result
- Flag incorrect usage of an entry dummy argument in an executable
statement before its declaration in the entry statement
- Disallow optional return dummy argument following other OPTIONAL
dummy arguments
- An invalid WRITE statement no longer gets an internal error
- Allow passing NULL intrinsic function as argument to other routines
- Allow AUTOMATIC variables to be used in an EQUIVALENCE statement
- Using a structure constructor with scalar value to assign an array
element now produces correct result
- Using an array constructor with integer value to initialize a real
or complex array now produces correct result
- Flag common block name and routine name conflict
- Fix elemental character function with varying length
- Fix problem where
-assume dummy_aliases
wasn't being taken into account in checks for overlap in array
assignment.
- If !DEC$ ATTRIBUTES C is specified in an INTERFACE block, and an
argument is declared as having an array type, always pass that argument
by reference even if the actual argument is a single array element.
- Allow a concatenation expression as the first argument to TRANSFER.
- Implement
-std90
and
-std95
options.
- A STRUCTURE with no fields no longer causes a compiler failure.
- No longer issue standards warning for certain cases with a
relational operator followed by a unary minus.
- Do not give spurious "more variables than values" warning for
certain cases of data initialization of multi-dimensional arrays.
- User-defined generic interface for IDATE no longer causes internal
compiler error.
- LOC(funcname) as an actual argument when used inside function
"funcname" now properly returns the address of the return value
variable and not the entry point.
- The compiler no longer gives spurious errors (including internal
compiler failures) in certain cases where a module file cannot be
opened.
- Certain incorrect programs which include a reference to fields of
an undeclared STRUCTURE no longer cause an internal compiler error.
- Give error when ALLOCATED is used on a non-ALLOCATABLE object.
- Allow a recursive function name to be passed as an actual argument
inside the function.
- If an INCLUDE file includes a directive to change the source form,
revert to the original setting after returning to the including source
file.
The following limitations were fixed in Version 2.0 or
previous releases:
- The
f90
command option
-wsf
and its related options are now supported.
- Allocatable arrays that are allocated but not deallocated before
routine exit are now deallocated upon exit from routine.
- The
f90
command options
-cord
and
-feedback
described in the documentation have now been implemented.
1.8.3 HPF Version 5.1 New Features
1.8.3.1 SHADOW Directive Now Supported
The new SHADOW directive, as defined in Version 2.0 of the High
Performance Fortran Language Specification, is now supported.
SHADOW is now a separate HPF directive, rather than a keyword inside
the DISTRIBUTE directive.
1.8.3.2 Pointers Now Handled in Parallel
Mapped variables with the POINTER attribute are now handled in
parallel. This capability is an approved extension of the High
Performance Fortran Language Specification.
1.8.3.3 SHADOW Directive Required for Nearest-Neighbor POINTER or TARGET Arrays
The compiler will not generate shadow edges automatically for
arrays with the POINTER or TARGET attributes. In order to be eligible
for the compiler's nearest-neighbor optimization, POINTER or TARGET
arrays must explicitely be given shadow edges using the SHADOW
directive. If pointer assignment is done, both the POINTER and the
TARGET must have the same mapping, including shadow edges.
For More Information:
- On the conditions that must be satisfied for a statement to be
eligible for the nearest-neighbor optimization, see Section 1.7.1.4 of
these Release Notes.
1.8.3.4 Descriptive Mapping Directives are Now Obsolescent
In Version 1 of the HPF Language Specification, a special form of the
DISTRIBUTE and ALIGN directives was used in interfaces and procedures
when mapped arrays were passed to a procedure. Known as
descriptive mapping, it was specified by an asterisk (*)
appearing before the left parenthesis "(" in a DISTRIBUTE
directive, or after the WITH in an ALIGN directive. For example,
!HPF$ DISTRIBUTE R*(BLOCK, BLOCK)
!HPF$ ALIGN S WITH *R
|
Beginning with version 2.0 of the High Performance Fortran Language
Specification (DIGITAL Fortran 90 version 5.0), the meaning of
descriptive syntax has changed. Descriptive mapping is now a weak
assertion that the programmer believes that no data communication is
required at the procedure interface. If this assertion is wrong, the
data communication will in fact occur.
Although there is now no semantic difference between the descriptive
form and the ordinary prescriptive form, there is still some benefit in
using the descriptive form. DIGITAL Fortran 90 generates informational
messages when a descriptive directive is specified if the compiler is
unable to confirm that there will in fact be no communication. These
messages can uncover subtle programming mistakes that cause performance
degradation.
Existing programs with descriptive mapping directives will continue to
compile and run with no modification.
In the future, DIGITAL may provide a command-line option that specifies
that descriptive directives be treated as strong assertions that data
communication will not be necessary at the procedure interface. This
would allow the compiler to omit checking whether the mappings of the
actual and dummy agree, leading to performance improvement in some
cases.
1.8.3.5 New support for HPF Local Library Routines GLOBAL_LBOUND and GLOBAL_UBOUND
The following HPF Local Library routines are now supported:
- GLOBAL_LBOUND
- GLOBAL_UBOUND
1.8.3.6 REDUCTION Clause in INDEPENDENT Directives
The REDUCTION clause in INDEPENDENT directives is now supported.
1.8.3.7 HPF_SERIAL Restriction Lifted for Procedures Called from INDEPENDENT DO Loops
Previous versions required procedures called from inside INDEPENDENT DO
loops to HPF_SERIAL in order to obtain parallel execution. This
restriction is now lifted.
For More Information:
- On the requirements for parallel execution of INDEPENDENT DO loops
containing procedure calls, see Section 1.7.5.6 of these Release Notes.
1.8.4 HPF Version 5.1 Corrections
This section lists problems in previous versions that have been fixed
in this version.
- Some bugs in implementing whole structure references in IO and
assignment were fixed.
- Aligning components of derived types is now supported.
- The restriction that statements with scalar subscripts are not
eligible for the nearest-neighbor optimization is now removed.
Statements with scalar subscripts may now be eligible for the
nearest-neighbor optimization if that array dimension is (effectively)
mapped serially.
- Nearest-neighbor assignments with derived types are now eligible
for the nearest-neighbor optimization.
1.9 New Features and Corrections in Version 5.0
Version 5.0 is a major release that also includes corrections to
problems discovered since Version 4.1 was released.
The following topics are discussed:
1.9.1 Version 5.0 New Features
The following new DIGITAL Fortran 90 features are now supported:
- The
-mp
compiler option enables parallel processing using directed
decomposition. Parallel processing is directed by inserting !$PAR
directives in your source code. This type of parallel processing is for
shared memory multiprocessor systems.
To enable parallel processing
across clusters of servers or workstations with !HPF$ directives,
continue to use the
-wsf
compiler option.
On a shared memory system, you can use both the
-mp
and the
-wsf
options for the same program. This combination provides improved
performance for certain programs running mostly on shared memory
systems.
The new parallel directives:
- Use the !$PAR prefix
- Are recognized only if compiled with the
-mp
option
- Some of the parallel !$PAR directives include:
- PARALLEL and END PARALLEL
- PDO
- PARALLEL DO
- PSECTIONS
- CRITICAL SECTION
- TASK COMMON
- Environment variables control the run-time behavior. For example,
MP_THREAD_COUNT specifies how many threads to create.
To allow task-local thread storage, you must be using Version 4.0D
(code name PTmin) of the DIGITAL UNIX operating system.
For more
information on these directives, see the DIGITAL Fortran 90 User
Manual for DIGITAL UNIX Systems available with Version 5.1.
- The
-warning_severity keyword
compiler option allows you to:
- Specify
-warning_severity errors
to make all compiler warning messages error-level instead of
warning-level messages.
- Specify
-warning_severity stderrors
to make standards checking compiler warning messages (
-std
option) error-level instead of warning-level messages.
- The
-warn nogranularity
compiler option allows you to suppress the NONGRNACC warning message:
Unable to generate code for requested
granularity.
- An internal procedure can now be used as an actual argument.
- Support for certain new language extensions for compatibility with
DIGITAL Visual Fortran (and Microsoft® Fortran PowerStation). These
features include the following:
- # Constants--constants using other than base 10
- C Strings--NULL terminated strings
- Conditional Compilation And Metacommand Expressions ($define,
$undefine, $if, $elseif, $else, $endif)
- $FREEFORM, $NOFREEFORM, $FIXEDFORM--source file format
- $INTEGER, $REAL--selects size
- $FIXEDFORMLINESIZE--line length for fixed form source
- $STRICT, $NOSTRICT--F90 conformance
- $PACK--structure packing
- $ATTRIBUTES ALIAS--external name for a subprogram or common block
- $ATTRIBUTES C, STDCALL--calling and naming conventions
- $ATTRIBUTES VALUE, REFERENCE--calling conventions
- \ Descriptor--prevents writing an end-of-record mark
- Ew.dDe and Gw.dDe Edit Descriptors--similar to Ew.dEe and Gw.dEe
- 7200 Character Statement Length
- Free form infinite line length
- $DECLARE and $NODECLARE :=,= IMPLICIT NONE
- $ATTRIBUTES EXTERN--variable allocated in another source file
- $ATTRIBUTES VARYING--variable number of arguments
- $ATTRIBUTES ALLOCATABLE--allocatable array
- Mixing Subroutines/Functions in Generic Interfaces
- $MESSAGE--output message during compilation
- $LINE :=,= C's #line
- INT1 converts to one byte integer by truncating
- INT2 converts to two byte integer by truncating
- INT4 converts to four byte integer by truncating
- COTAN returns cotangent
- DCOTAN returns double precision cotangent
- IMAG returns the imaginary part of complex number
- IBCHNG reverses value of bit
- ISHA shifts arithmetically left or right
- ISHC performs a circular shift
- ISHL shifts logically left or right
The following new High Performance Fortran (HPF) features and
corrections have been added for DIGITAL Fortran Version 5.0:
- The new SHADOW directive, as defined in Version 2.0 of the HPF
specification, is now supported. SHADOW is now a separate HPF
directive, rather than a keyword inside the DISTRIBUTE directive.
- Mapped variables with the POINTER attribute are now handled in
parallel. This capability is an approved extension of the HPF
specification.
- Beginning with version 2.0 of the HPF specification (DIGITAL
Fortran Version 5.0), the meaning of descriptive syntax has changed.
Descriptive mapping is now a weak assertion that the programmer
believes that no data communication is required at the procedure
interface. If this assertion is wrong, the data communication will in
fact occur.
Existing programs with descriptive mapping directives
will continue to compile and run with no modification and no
performance penalty.
- The following HPF Local Library routines are now supported:
- GLOBAL_LBOUND
- GLOBAL_UBOUND
- The REDUCTION clause in INDEPENDENT directives is now supported.
- Previous versions required procedures called from inside
INDEPENDENT DO loops to HPF_SERIAL in order to obtain parallel
execution. This restriction is now lifted.
- Some bugs in implementing whole structure references in IO and
assignment were fixed.
- Aligning components of derived types is now supported.
- The restriction that statements with scalar subscripts are not
eligible for the nearest-neighbor optimization is now removed.
Statements with scalar subscripts may now be eligible for the
nearest-neighbor optimization if that array dimension is (effectively)
mapped serially.
- Nearest-neighbor assignments with derived types are now eligible
for the nearest-neighbor optimization.
1.9.2 Version 5.0 Corrections
Since Version 4.1, the following corrections have been made:
- Fix SIGN intrinsic to handle --0.
- Fix LOC intrinsic and %LOC of a derived type field.
- Fixed debug information for dynamic character variable (such as
character*(i) c).
- Add debugging support for integer (Cray) pointers.
- Fix storing to the return value of a function returning character
in a containing internal routine.
- Fix Nullification of a character*n pointer argument.
- Fix using passed length argument in a containing internal routine.
- Fix compiler abort when a source line is longer than 1024
characters in freeform source file.
- Fix using IOLENGTH in a INQUIRE statement.
- Fix FORALL problem of the form "X(X(I))
=."
- Fix contained functions returning an implicitly initialized
derived-type.
- Better diagnostics for invalid programs.
- Fix compiler abort when using Nullification of a pointer in a
MODULE.
- Fix a certain type of USE of a MODULE with rename list.
- Fix using
-extend_source:80
and
-pad_source
.
- Fix compiler abort when using do-loop style implicitly initialized
derived-types in a MODULE.
- Sign-extending INTEGER*2 parameter constants.
- Flag invalid nested internal procedures.
- Fix compiler abort of USE of a MODULE with namelist variables in
rename list.
- Issue a warning message for a intrinsic with wrong argument type
and treat it as an external.
- Issue a warning message for having a SAVE common block data object.
- Fix compiler abort of USE of a MODULE with namelists.
- Fix using SIZEOF(common_block_array) in a PARAMETER statement.
- Fix using READONLY keyword as first keyword in an OPEN statement.
- Allow record name to be the same as a structure name.
- Fix parameter character constant with embedded NULL character.
- Fix compiler abort when same name used as a structure and derived
type.
- Allow BLOCKSIZE keyword in an INQUIRE statement.
- Allow a record in a SAVE statement.
- Allow a module to have the name "procedures".
- Do not flag IABS intrinsic function as nonstandard.
- Do not flag DOUBLE COMPLEX as nonstandard.
- Treat POPCNT, POPPAR, LEADZ as external functions.
- Put out an error message for ptr =>
pack(...).
- Treat C$DOACROSS as a comment.
- Issue an error message for invalid derived type parameter constant.
- Fix compiler abort when passing an array constructor as an actual
argument.
- Fix using derived-type components that are same as intrinsic names.
- Fix an incorrect warning about "explicit-shaped array is being
passed to a routine that expects a pointer or assumed-shape array".
- Fix a problem with
-warn:errors
and
-stand:f90
options. Nonstandard messages should be error messages.
- Fix incorrect results when compiled a program with
-assume:dummy_aliasing
.
- Do not flag BOZ constant as nonstandard.
- Do not flag Z format as nonstandard.
- Allow 511 continuation lines.
- Put out a standard warning for using character constant in DATA
statement.
- Fix using TRANSFER in initialization.
- Fix a problem with user defined assignment statement.
- Issue an error message when passing or receiving an optional
argument by value.
- Fix an invalid message about return value of a function is not
defined when the function returns an initialized derived type.
- Fix a compiler abort with "text handle table overflow" message.
- Fix a compiler abort using a SAVE statement.
- Fix a problem when an existing operator is overloaded.
- Fix argument checking of intrinsic subroutines.
- Fix generic interface of elemental functions.
- Issue an argument mismatch warning message for using an integer
with a statement function that takes real argument.
- Fix compiler directives processing.
- Fix a compiler abort using an invalid PARAMETER array.
- Issue an error message for SAVE of an ENTRY result variable.
- Fix using UNION within derive type.
- Fix a compiler internal error when using C and REFERENCE attributes
on a function name.
- Fix a compiler internal error when using ASSOCIATED of a function
returning a pointer.
- Add support for passing complex by value.
- Fix pointer assignment with a character substring.
- Allow using ICHAR in an array constructor within the initialization
part of an array declaration.
- Fix a problem with using UNION declaration within the derived type.
- Allow exporting of a module procedure which has a name that is the
same as a generic name.
- Fix a problem with using user defined assignment operation.
- Allow specifying NaNs in the PARAMETER statement.
- Allow D source line to continue a non-D source line.
- Fix a problem in array initialization processing.
- Cray pointees that were being allocated statically are now
correctly given no storage class.
- Using assume shape array within a contained routine no longer
produces an internal compiler error.
- An error message is now given for invalid keyword values given for
an I/O statement's keyword.
- Declarations of the type "character, allocatable :: field*7(:)", in
which the array shape specifier comes after the length specification in
a deferred-shape character array no longer produces an internal
compiler error.
- When assigning a derived type variable with a structure
constructor, if a character scalar is supplied to an character array
component, every elements of the array is assigned with the character
scalar value.
- The MVBITS intrinsic now gives correct result if its 4th argument
is a non-lowerbound subscripted array element.
- Reference of a character function, where the length of its return
value is dependent on one or more of its arguments, no longer produces
an internal compiler error.
- Pointer assignment should now work properly when the target is a
component of an allocatable array with a lower bound different of 1.
- Long NAMELISTs no longer causes a compiler internal error.
- The compiler now prints out better error messages for the PDONE
directive.
- When initializing a derived type variable with a structure
constructor, if a scalar is supplied to an array component, every
elements of the array is initialized with the scalar value.
- Allow %fill in STRUCTURE declarations using F90 syntax, such as:
integer :: %fill.
- Using unary "-" operator with record fields should now give correct
results.
- Use of NEAREST with two different KIND REAL arguments no longer
gets a nonstandard warning.
- Allow SIZEOF of assumed size record field.
- Module importing has been improved. If a module is USEd in both the
host and its internal procedure, the module is now only imported once
by the compiler.
- A module that contains "PRIVATE" followed by "PUBLIC variable" no
longer gets incorrect error message.
- Optional comma in DO with label, such as: label:
DO, JJ = 1, N, 1 no longer gets incorrect syntax error.
- Allow a dummy argument to have the same name as a structure field.
- A module that contains USE module, ONLY :
var no longer gets internal compiler error.
- A component of a derived-type with a name that starts with FILL no
longer gets a syntax error.
- A PDONE directive in a statically-scheduled PDO loop no longer gets
an error message.
- Allow a variable with '_' in its name to be used in a variable
format expression.
- Fix for array references in CRITICAL SECTION directive.
- Set NOWAIT for paralleldo directive (the region waits, so do NOT
make the loop wait as well).
- Allow variables in COMMON/EQUIVALENCE on local, lastlocal, and
reduction lists. Create and use new local variables in parallel do
scopes for these variables.
- Allow c$copyin of EQUIVALENCE/COMMON variables.
- Fix
-mp
(ordered) bug.
- No longer import any definitions if a module is used with the "USE
module_name, ONLY:" statement.
- Fix a compile time stack overflow problem.
- Fix a "$IF DEFINED()" problem when a routine is defined between the
conditional compilation.
- Put out error message for an invalid use of "TYPE (type_name)"
statement.
- Allow RECORD in a NAMELIST.
- Fix using "# line_number" in DATA statement.
- The
-pad_source
option now properly pads Hollerith literals that are continued across
source records.
- Add standards warning for using two consecutive operators in an
expression.
- Allow POINTER attribute for character entities whose length is
specified by a variable expression or an * (assumed length character).
- Do not flag as nonstandard when all of the objects in the
EQUIVALENCE set are of type default integer, default real, double
precision, default complex, default logical, or numeric sequence type.
- Add standards warning for assignment to the host associated
variable in a PURE function.
- Add standards warning for using a dummy argument in a
specification-expr as the argument of one of the intrinsic functions
BIT_SIZE, KIND, LEN, or the numeric inquiry functions.
- Compiling BLOCK DATA with
-recursive
no longer causes a compiler internal error.
- A special usage of equivalenced variables in parallel no longer
causes a compiler internal error.
- DO loop variables are now set to be PRIVATE by default in a
parallel region.
- The scope of C$CHUNK and C$MP_SCHEDTYPE directives is restricted to
one program unit.
- Fix a bug in a special usage of passing internal procedure as
argument.
1.10 Additional Information
This section contains information that supplements the DIGITAL Fortran 90
documentation.
1.10.1 The DIGITAL Fortran 90 Home Page
If you have Internet access and a World Wide Web (WWW) viewer, you are
welcome to view the following:
- The DIGITAL Fortran 90 home page, located at the following URL:
- http://www.digital.com/fortran
- The Digital Equipment Corporation home page, located at the
following URL:
1.10.2 Support for the Fortran 95 Standard Features
This section briefly describes the Fortran 95 language features that
have been added to DIGITAL Fortran:
- The FORALL statement and construct
In Fortran 90, you could
build array values element-by-element by using array constructors and
the RESHAPE and SPREAD intrinsics. The Fortran 95 FORALL statement and
construct offer an alternative method.
FORALL allows array
elements, array sections, character substrings, or pointer targets to
be explicitly specified as a function of the element subscripts. A
FORALL construct allows several array assignments to share the same
element subscript control.
FORALL is a generalization of WHERE.
They both allow masked array assignment, but FORALL uses element
subscripts, while WHERE uses the whole array.
DIGITAL Fortran
previously provided the FORALL statement and construct as language
extensions.
- PURE procedures
Pure user-defined procedures do not have side
effects, such as changing the value of a variable in a common block. To
specify a pure procedure, use the PURE prefix in the function or
subroutine statement. Pure functions are allowed in specification
statements.
DIGITAL Fortran previously allowed pure procedures as a
language extension.
- ELEMENTAL procedures
An elemental user-defined procedure is a
restricted form of pure procedure. An elemental procedure can be passed
an array, which is acted upon one element at a time. To specify an
elemental procedure, use the ELEMENTAL prefix in the function or
subroutine statement.
- Pointer initialization
In Fortran 90, there was no way to
define the initial value of a pointer or to assign a null value to the
pointer by using a pointer assignment operation. A Fortran 90 pointer
had to be explicitly allocated, nullified, or associated with a target
during execution before association status could be determined.
Fortran 95 provides the NULL intrinsic function that can be used to
nullify a pointer.
- Derived-type structure default initialization
Fortran 95 lets
you specify, in derived-type definitions, default initial values for
derived-type components.
- Automatic deallocation of allocatable arrays
Arrays declared
using the ALLOCATABLE attribute can now be automatically deallocated in
cases where Fortran 90 would have assigned them undefined allocation
status.
DIGITAL Fortran previously provided this feature as a
language extension.
- CPU_TIME intrinsic subroutine
This new intrinsic subroutine
returns a processor-dependent approximation of processor time.
- Enhanced CEILING and FLOOR intrinsic functions
KIND can now be
specified for these intrinsic functions.
- Enhanced MAXLOC and MINLOC intrinsic functions
DIM can now be
specified for the MAXLOC and MINLOC intrinsic functions. DIM was
allowed previously as a DIGITAL Fortran language extension.
- Enhanced SIGN intrinsic function
The SIGN function can now
distinguish between positive and negative zero (if the processor is
capable of doing so).
- Enhanced WHERE construct
The WHERE construct has been improved
to allow nested WHERE constructs and a masked ELSEWHERE statement.
WHERE constructs can now be named.
- Comments allowed in namelist input
Fortran 95 allows comments
(beginning with !) in namelist input data. DIGITAL Fortran previously
allowed this as a language extension.
- Generic identifier to END INTERFACE statement
The END INTERFACE
statement of an interface block defining a generic routine now allows a
generic identifier.
- Zero-length formats
On output, when using I, B, O, Z and F edit
descriptors, the specified value of the field width can be zero (0). In
such cases, the compiler selects the smallest possible positive actual
field width that does not result in the field being filled with
asterisks.
- New obsolescent features
Fortran 95 deletes several language
features that were obsolescent in Fortran 90, and identifies new
obsolescent features:
- REAL and DOUBLE PRECISION DO variables
- Branching to an ENDIF from outside its IF
- PAUSE statement
- ASSIGN statement, assigned GOTO, and assigned FORMATs
- H edit descriptor
DIGITAL Fortran flags these deleted and obsolescent features, but
fully supports them.
1.10.3 Preliminary Information on Support for Big Objects
Big objects are data items whose size cannot be
represented by a signed 32 bit integer. DIGITAL Fortran 90 supports
larger objects than DIGITAL Fortran 77.
Big objects are good for massive machines and clusters used for
numerical analysis, such as weather forecasting and high energy physics
problems. Both special knowledge and very large hardware configurations
are needed to use this feature.
Your system and its operating system must be configured to:
- Allow a very large stack space.
- Allow a very large data space.
- Allow large values for parameters, such as vm-maxvas.
- Unless huge amounts of physical memory are present, enable lazy
swapping.
- Check the size of page/swap files and create larger files if needed.
For more information, see the DIGITAL UNIX system management
documentation. For DIGITAL UNIX Version 4.0, you can use the following
check list:
- Either have a large swap space or use deferred swap allocation.
This involves either:
- Have more swap space than the address space used by the largest
program you want to run. The following command shows swap allocation:
- Use the deferred mode of swap allocation. The following command
displays the reference (man) page for swapon, which describes how to
change the swap allocation
- Reconfigure the UNIX kernel (for Version 4.0 or later) to change
the following parameters as desired. For example, on one system, all
values were set to 16 GB:
Parameter |
Explanation |
max-per-proc-address-space
|
Largest address space
|
max-per-proc-data-size
|
Largest data size
|
max-per-proc-stack-size
|
Largest stack size
|
vm-maxvas
|
Largest virtual-memory
|
Also set the following per-process values:
Parameter |
Explanation |
per-proc-address-space
|
Default address space
|
per-proc-data-size
|
Default data size
|
per-proc-stack-size
|
Default stack size
|
The per-process limits can be checked and increased with the
limit
or
ulimit
commands.
You can create big objects as static data, automatic data (stack), or
dynamically allocated data (ALLOCATE statement or other means).
The address space limitations depends on the Alpha processor generation
in use:
- Address space for ev4 Alpha generation processors is 2**42
- Address space for ev5 Alpha generation processors is 2**46
Although the compiler produces code that computes 63-bit signed
addresses, objects and addresses larger than the hardware limitations
will not work.
Limitations of using big objects include:
- Initializing big objects by using a DATA statement or a TYPE
declaration is not supported.
- Big objects cannot be passed by value as program arguments.
- Debug support for big objects is limited.
- I/O of entire big objects is not supported, but I/O of parts of an
array should work.
The following small example program allocates a big character object:
character xx(2_8**31+100_8)
integer*8 i
i = 10
xx(i) = 'A'
i = 2_8**31 + 100_8
xx(i) = 'B'
print *,xx(10_8)
print *,xx(i)
end
|
1.10.4 New Random Number Algorithm
A new random_number intrinsic (Version 4.0 or later) uses a different
algorithm than the one previously used.
The test program below shows the use of the random_seed and
random_number intrinsics.
program testrand
intrinsic random_seed, random_number
integer size, seed(2), gseed(2), hiseed(2), zseed(2)
real harvest(10)
data seed /123456789, 987654321/
data hiseed /-1, -1/
data zseed /0, 0/
call random_seed(SIZE=size)
print *,"size ",size
call random_seed(PUT=hiseed(1:size))
call random_seed(GET=gseed(1:size))
print *,"hiseed gseed", hiseed, gseed
call random_seed(PUT=zseed(1:size))
call random_seed(GET=gseed(1:size))
print *,"zseed gseed ", zseed, gseed
call random_seed(PUT=seed(1:size))
call random_seed(GET=gseed(1:size))
call random_number(HARVEST=harvest)
print *, "seed gseed ", seed, gseed
print *, "harvest"
print *, harvest
call random_seed(GET=gseed(1:size))
print *,"gseed after harvest ", gseed
end program testrand
|
When executed, the program produces the following output:
% testrand
size 2
hiseed gseed -1 -1 171 499
zseed gseed 0 0 2147483562 2147483398
seed gseed 123456789 987654321 123456789 987654321
harvest
0.6099895 0.9807594 0.2936640 0.9100146 0.8464803
0.4358687 2.5444610E-02 0.5457680 0.6483381 0.3045360
gseed after harvest 375533067 1869030476
|
1.10.5 DIGITAL Fortran 77 Pointers
DIGITAL Fortran 77 pointers are CRAY® style pointers, an extension
to the Fortran 90 standard. The POINTER statement establishes pairs of
variables and pointers, as described in the DIGITAL Fortran Language Reference Manual.
1.10.6 Extended Precision REAL (KIND=16) Floating-Point Data
The X_float data type is a little endian IEEE-based format that
provides extended precision. It supports the REAL*16 DIGITAL Fortran Q
intrinsic procedures. For example, the QCOS intrinsic procedure for the
generic COS intrinsic procedure.
The value of REAL (KIND=16) data is in the approximate range:
6.475175119438025110924438958227647Q-4966 to
1.189731495357231765085759326628007Q4932.
Unlike other floating-point formats, there is little if any performance
penalty from using denormalized extended-precision numbers, since
accessing denormalized numbers do not result in an arithmetic trap
(extended-precision is emulated in software). (The smallest normalized
number is 3.362103143112093506262677817321753Q-4932.)
The precision is approximately one part in 2**112 or typically 33
decimal digits.
The X_float format is emulated in software. Although there is no
standard IEEE little endian 16-byte REAL data type, the X_float format
supports IEEE exceptional values.
For more information, see the revised DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems and the DIGITAL Fortran Language Reference Manual.
1.10.7 Variable Format Expressions (VFEs)
By enclosing an arithmetic expression in angle brackets, you can use it
in a FORMAT statement wherever you can use an integer (except as the
specification of the number of characters in the H field). For example:
For more information, see the DIGITAL Fortran Language Reference Manual.
1.10.8 Notes on Debugger Support
DIGITAL UNIX provides both the
dbx
and the DIGITAL Ladebug (formerly DECladebug) debuggers in the
programming environment subsets.
These debuggers are very similar and use almost identical set of
commands and command syntax. Both have a command-line interface as well
as a Motif windowing interface.
A character-cell DIGITAL Ladebug (ladebug) interface is provided with
Ladebug in the DIGITAL UNIX operating system Programmer's Development
Toolkit. To use the character-cell interface, use the
ladebug
command.
When using DIGITAL Ladebug with certain versions of the UNIX operating
system, be aware that a trailing underscore may be needed to display
module variables. For example, to display variable X in module MOD,
type:
The Parallel Software Environment supports debugging parallel HPF
programs (see the DIGITAL High Performance Fortran 90 HPF and PSE Manual). This section addresses scalar
(nonparallel) debugging.
When using the
f90
command to create a program to be debugged using
dbx
or
ladebug
, consider using the following options:
- Specify
-g
or
-g2
to request symbol table and traceback information needed for debugging.
- Avoid requesting optimization. When you specify
-g
or
-g2
, the optimization level is set to
-o0
by default. Debugging optimized code is neither easy nor recommended.
- When using the Ladebug debugger, you should specify the
-ladebug
option. The
-ladebug
option allows you to print and assign to dynamic arrays using standard
Fortran syntax.
For example, the following command creates the executable program
proj_dbg.out
for debugging with Ladebug:
% f90 -g -ladebug -o proj_dbg.out file.f90
|
You invoke the character-cell Ladebug debugger by using the
ladebug
command.
For more information, see the debugger chapter in the revised
DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems (Chapter 4).
1.10.8.1 DIGITAL Ladebug Debugger Support Notes
The following improvements in Ladebug support for the DIGITAL Fortran
90 language were added for DIGITAL UNIX Version 4.0:
- Ladebug now includes a graphical window interface.
- Ladebug now supports the display of array sections.
- Ladebug now displays Fortran data types using Fortran 90 name
syntax rather than C names (such as integer rather than int).
- Ladebug provides improved support for debugging mixed-language C
and Fortran applications.
- These and other improvements are described in the debugger chapter
(Chapter 4) of the DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems.
The following improvements in Ladebug support for the DIGITAL Fortran
90 language were added for DEC OSF/1 Version 3.2 (DECladebug V3.0-16):
- Fortran and Fortran 90 language expression evaluation is built into
the Ladebug command language, including:
- Case-insensitive identifiers, variables, program names, and so on
- Logical expressions, including:
- Relational operators (.LT., .LE., .EQ., .NE., .GT., .GE.)
- Logical operators (.XOR., .AND., .OR., .EQV., .NEQV., .NOT.)
- Fortran 90 pointers
- Fortran 90 array support, including:
- Explicit-shape arrays
- Assumed-shape arrays
- Automatic arrays
- Assumed-size arrays
- Deferred-shape arrays
- COMMON block support, including:
- Display of whole common block
- Display of (optionally-qualified) common block members
- COMPLEX variable support, including the display, assignment, and
use of arithmetic expressions involving COMPLEX variables
- Alternate entry points, including breakpoints, tracepoints, and
stack tracing (
where
command)
- Mixed-language debugging
For more information on using Ladebug, see the debugger chapter in the
revised DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems (Chapter 4).
1.10.8.2 dbx Debugger Support Notes
When using
dbx
with DIGITAL Fortran 90 programs, certain differences exist. For example, in
dbx
, assumed-shape arguments, allocatable arrays, and pointers to arrays
are printed as a derived type. Consider the following program:
module foo
real x
contains
subroutine bar(a)
integer a(:)
a(1) = 1
end subroutine bar
end module foo
use foo
integer b(100)
call bar(b)
end
|
If the above program were stopped inside BAR, the following would occur:
(dbx) print a
common /
dim = 1
element_length = 4
ptr = 0x140000244
ies1 = 4
ub1 = 10
lb1 = 1
/
|
The meaning of the fields are:
- dim - dimension of the object
- element_length - the length of each element in bytes
- ptr - the address of the object
- iesn - distance (in bytes) between elements in the
nth dimension
- ubn - upper bound in the nth dimension
- lbn - lower bound in the nth dimension
1.10.9 Notes on Fast Math Library Routines
The
f90
option
-math_library fast
provides alternate math routine entry points to the following:
- SQRT, EXP, LOG, LOG10, SIN, and COS intrinsic procedures
- Power (**) in arithmetic expressions
1.10.10 The DIGITAL Fortran 90 Array Descriptor Format
In the DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems, Chapter 10, Section 10.1.7 describes the DIGITAL
Fortran 90 array descriptor format.
These notes are an initial attempt to provide a template for those C
programmers creating an a .h file that lays out the DIGITAL Fortran 90
array descriptor format.
There are two varying parameters for this descriptor format:
- The element type (shown in this section as <ELEMENT_TYPE> )
- The rank (shown in this section as <RANK> )
Common information for all descriptors is the general layout of the
header and the information for each dimension.
One possible C @codefont(struct) definition for the per-dimension
information is:
struct _f90_array_dim_info {
int inter_element_spacing;
int pad1;
int upper_bound;
int pad2;
int lower_bound;
int pad3;
};
|
The inter-element spacing is measured in 8-bit bytes, not in array
elements. This presents a challenge in designing array descriptor
definitions in C, since there is no completely clean way to interact
with C's pointer arithmetic.
One way to design the struct definition for an array descriptor is to
use the template:
struct _f90_array_desc_rank<RANK>_<NAME_TOKEN> {
unsigned char dim;
unsigned char flags;
unsigned char dtype;
unsigned char class;
int pad;
long length;
<ELEMENT_TYPE> * pointer;
long arrsize;
void * addr_a0;
struct _f90_array_dim_info dim_info[<RANK>];
};
|
Where <RANK>, <NAME_TOKEN> and <ELEMENT_TYPE> are the
template parameters. Often <NAME_TOKEN> and <ELEMENT_TYPE>
can be the same, but in cases where <ELEMENT_TYPE> has
non-identifier characters in it (for example, space or star) then a
suitable <NAME_TOKEN> should be devised.
The problem with this approach is that the element addressing, which
uses the inter-element spacing, generates an offset in bytes. In order
to use C's native pointer arithmetic, either casts need to be done or a
division. For example:
- Casting:
*((<ELEMENT_TYPE> *) (((char *) desc->pointer) + byte_offset))
|
- Division:
(desc->pointer)[byte_offset/sizeof(<ELEMENT_TYPE>)]
|
Another way to design the struct definition for an array descriptor is
to use the template:
struct _f90_array_desc_rank<RANK>_general {
unsigned char dim;
unsigned char flags;
unsigned char dtype;
unsigned char class;
int pad;
long length;
char * pointer;
long arrsize;
void * addr_a0;
struct _f90_array_dim_info dim_info[<RANK>];
};
|
An advantage to this approach is that the same definition can be used
for all arrays of the same rank. The problem with this approach is that
it forces the programmer to cast:
*((<ELEMENT_TYPE> *) (desc->pointer + byte_offset))
|
Another approach is to remove <RANK> from the template as well,
yielding:
struct _f90_array_desc_general {
unsigned char dim;
unsigned char flags;
unsigned char dtype;
unsigned char class;
int pad;
long length;
char * pointer;
long arrsize;
void * addr_a0;
struct _f90_array_dim_info dim_info[7];
};
|
On the last line, 7 is used since that is the maximum rank allowed by
Fortran. Since the dim field should be checked, this definition can be
used in many (perhaps most) of the places a rank-specific definition
would be used, provided the programmer is aware that the dim_info
fields beyond the actual rank are undefined.
One place such a definition should NOT be used is when an object of
this definition is used as part of an assignment. This usage is
considered rare. For example:
void
ptr_assign_buggy(struct _f90_array_desc_general * ptr,
struct _f90_array_desc_general * tgt)
{
*ptr = *tgt;
}
|
Example of Array Descriptor Format Use
In this example, we have a 'struct tree' and a procedure
prune_some_trees_() that takes a descriptor of a rank=3 array of such
structs and calls prune_one_tree_() on each individual tree (by
reference):
void
prune_some_trees(struct _f90_array_desc_general * trees)
{
if (trees->dim != 3) {
raise_an_error();
return;
} else {
int x,y,z;
int xmin = trees->dim_info[0].lower_bound;
int xmax = trees->dim_info[0].upper_bound;
int xstp = trees->dim_info[0].inter_element_spacing;
int ymin = trees->dim_info[1].lower_bound;
int ymax = trees->dim_info[1].upper_bound;
int ystp = trees->dim_info[1].inter_element_spacing;
int zmin = trees->dim_info[2].lower_bound;
int zmax = trees->dim_info[2].upper_bound;
int zstp = trees->dim_info[2].inter_element_spacing;
int xoffset,yoffset,zoffset;
for (z = zmin, zoffset = 0; z <= zmax; z+= 1, zoffset += zstp) {
for (y = ymin, yoffset = 0; y <= ymax; y+= 1, yoffset += ystp) {
for (x = xmin, xoffset = 0; x <= xmax; x+= 1, xoffset += xstp) {
struct tree * this_tree =
(struct tree *) (trees->pointer + xoffset+yoffset+zoffset);
prune_one_tree_(this_tree);
}
}
}
}
}
|
DIGITAL would appreciate feedback on which definitions of array
descriptors users have found most useful.
Note that the format for array descriptors used by HPF is more
complicated and is not described at this time.
Chapter 2
New Features for DIGITAL Fortran 90 Versions 4.n, 2.0, and 1.n Releases
This chapter summarizes the new features for DIGITAL Fortran 90 Versions
prior to Version 5.0:
2.1 New Features and Corrections in Version 4.1
Version 4.1 is a maintenance release that contains a limited number of
new features and corrections to problems discovered since Version 4.0
was released.
For additional information added to these release notes for Version
4.1, see Section 1.10.3.
The following new features have been added for DIGITAL Fortran 90
Version 4.1:
- This release includes a partial implementation of the proposed
Fortran 95 standard.
The following features of the proposed Fortran
95 standard have been implemented by this version of DIGITAL Fortran 90
and are supported when using the
f90
or
f95
commands:
- FORALL statement and construct (implemented prior to Version 4.1)
- Automatic deallocation of ALLOCATABLE arrays (implemented prior to
Version 4.1)
- Dim argument to MAXLOC and MINLOC (implemented prior to Version 4.1)
- PURE user-defined subprograms (implemented prior to Version 4.1)
- ELEMENTAL user-defined subprograms (a restricted form of a pure
procedure)
- Pointer initialization (initial value)
- The NULL intrinsic to nullify a pointer
- Derived-type structure initialization
- CPU_TIME intrinsic subroutine
- Kind argument to CEILING and FLOOR intriniscs
- Enhanced SIGN intrinsic function
- Nested WHERE constructs, masked ELSEWHERE statement, and named
WHERE constructs
- Comments allowed in namelist input
- Generic identifier in END INTERFACE statements
- Detection of Obsolescent and/or Deleted features listed in the
proposed Fortran 95 standard
For more information on Fortran 95 features, see the Section 1.10.2.
- The
f95
command is now available for use with the
-std
option:
- To perform standards conformance checking against the Fortran 90
standard, use the
f90
command with
-std
. Using
f90
with
-std
will issue messages for features (such as FORALL) that have recently
been added to the proposed Fortran 95 standard (as well as other
extensions to the Fortran 90 standard).
- To perform standards conformance checking against the Fortran 95
standard, use the
f95
command with
-std
. Using
f95
with
-std
will not issue messages for features (such as FORALL) that have been
added to the proposed Fortran 95 standard, but will issue messages for
extensions to the Fortran 95 standard.
For more information on Fortran 95 features, see the Section 1.10.2.
- The
-intconstant
option has been added.
Specify the
-intconstant
option to use DIGITAL Fortran 77 rather than Fortran 90 semantics to
determine kind of integer constants. If you do not specify
-intconstant
, Fortran 90 semantics are used.
Fortran 77 semantics require that
all constants are kept internally by the compiler in the highest
precision possible. For example, if you specify
-intconstant
, an integer constant of 14 will be stored internally as
INTEGER(KIND=8) and converted by the compiler upon reference to the
corresponding proper size. Fortran 90 specifies that integer constants
with not explicit KIND are kept internally in the default INTEGER kind
(KIND=4 by default).
Similarly, the internal precision for
floating-point constants is controlled by the
-fpconstant
option.
- The
-pad_source
option has been added.
Specify the
-pad_source
option to request that source records shorter than the statement field
width are to be padded with spaces on the right out to the end of the
statement field. This affects the interpretation of character and
Hollerith literals that are continued across source records.
The
default is
-nopad_source
, which causes a warning message to be displayed if a character or
Hollerith literal that ends before the statement field ends is
continued onto the next source record. To suppress this warning
message, specify the
-warn nousage
option.
Specifying
-pad_source
can prevent warning messages associated with
-warn usage
.
- The
-warn usage
option has been added.
Specify the
-warn nousage
option to suppress warning messages about questionable programming
practices which, although allowed, often are the result of programming
errors. For example, a continued character or Hollerith literal whose
first part ends before the statement field ends and appears to end with
trailing spaces is detected and reported by
-warn usage
.
The default is
-warn usage
.
- The
-arch keyword
option has been added.
This option determines the type of Alpha
chip code that will be generated for this program. The
-arch keyword
option uses the same keywords as the
-tune keyword
option.
Whereas the
-tune keyword
option primarily applies to certain higher-level optimizations for
instruction scheduling purposes, the
-arch keyword
option determines the type of code instructions generated for the
program unit being compiled.
DIGITAL UNIX Version 4.0 and
subsequent releases provide an operating system kernel that includes an
instruction emulator. This emulator allows new instructions, not
implemented on the host processor chip, to execute and produce correct
results. Applications using emulated instructions will run correctly,
but may incur significant software emulation overhead at runtime.
All Alpha processors implement a core set of instructions. Certain
Alpha processor versions include additional instruction extensions.
Supported
-arch
keywords are as follows:
-
-arch generic
generates code that is appropriate for all Alpha processor generations.
This is the default.
Running programs compiled with the generic
keyword will run all implementations of the Alpha architecture without
any instruction emulation overhead.
-
-arch host
generates code for the processor generation in use on the system being
used for compilation.
Running programs compiled with this keyword
on other implementations of the Alpha architecture might encounter
instruction emulation overhead.
-
-arch ev4
generates code for the 21064, 21064A, 21066, and 21068 implementations
of the Alpha architecture.
Running programs compiled with the ev4
keyword will run without instruction emulation overhead on all Alpha
processors.
-
-arch ev5
generates code for some 21164 chip implementations of the Alpha
architecture that use only the base set of Alpha instructions (no
extensions).
Running programs compiled with the ev5 keyword will
run without instruction emulation overhead on all Alpha processors.
-
-arch ev56
generates code for some 21164 chip implementations that use the byte
and word manipulation instruction extensions of the Alpha architecture.
Running programs compiled with the ev56 keyword might incur
emulation overhead on ev4 and ev5 processors, but will still run
correctly on DIGITAL UNIX Version 4.0 (or later) systems.
-
-arch pca56
generates code for the 21164PC chip implementation that uses the byte
and word manipulation instruction extensions and multimedia instruction
extensions of the Alpha architecture.
Running programs compiled
with the pca56 keyword might incur emulation overhead on ev4 and ev5
and ev56 processors, but will still run correctly on DIGITAL UNIX
Version 4.0 (or later) systems.
- In addition to ev4, ev5, generic, and host, The ev56 and pca56
keywords are now supported for the
-tune
option.
The following new High Performance Fortran features have been added for
DIGITAL Fortran 90 Version 4.1:
- Transcriptive data distributions are now supported.
- The INHERIT directive can now be used to inherit distributions, as
well as alignments.
- Distributed components of user-defined types are now handled in
parallel. This is not part of standard High Performance Fortran (HPF),
but is an approved extension.
- The GLOBAL_SHAPE and GLOBAL_SIZE HPF Local Library routines are now
supported.
- There is a new compile-time option named
-show hpf
, which replaces the
-show wsfinfo
option. The
-show hpf
option provides performance information at compile time. Information is
given about inter-processor communication, temporaries created at
procedure boundaries, optimized nearest-neighbor computations, and code
that is not handled in parallel. You can choose the level of detail you
wish to see.
- New example programs are available in the following directory:
These new features are described in the DIGITAL High Performance Fortran 90 HPF and PSE Manual.
The corrections made for DIGITAL Fortran 90 Version 4.1 include the
following:
- Fix compiler abort with certain types of pointer assignment.
- Fix incorrect error message for nested STRUCTUREs.
- Fix inconsistent severity for undeclared variable message with
IMPLICIT NONE or command line switch.
- Fix incorrect error about passing LOGICAL*4 to a LOGICAL*1 argument.
- Add standards warning for non-integer expressions in computed GOTO.
- Do not flag NAME= as nonstandard in INQUIRE.
- Add standards warning for AND, OR, XOR intrinsics.
- VOLATILE attribute now honored for COMMON variables.
- Allow COMPLEX expression in variable format expression.
- Allow adjustable array to be declared AUTOMATIC (AUTOMATIC
declaration is ignored.)
- Honor
-automatic
(/RECURSIVE) in main program.
- Fix incorrect parsing error when DO-loop has bounds of -32768,32767.
- Fix compiler abort when extending generic intrinsic.
- Fix SAVEd variable in inlined routine that didn't always get SAVEd.
- Fix compiler abort with initialization of CHARACTER(LEN=0) variable
- Correct values of PRECISION, DIGITS, etc. for floating types.
- Fix incorrect value of INDEX with zero-length strings.
- Correct value for SELECTED_REAL_KIND in PARAMETER statement.
- Correct compile-time result of VERIFY.
- For OpenVMS only, routine using IARGPTR or IARGCOUNT corrupts
address of passed CHARACTER argument.
- Standards warning for CMPLX() in initialization expression.
- Fix compiler abort when %LOC(charvar) used in statement function.
- Fix incorrect initialization of STRUCTURE array.
- Fix compiler abort with large statement function.
- RESHAPE of array with a zero bound aborts at runtime.
- For OpenVMS only, /INTEGER_SIZE now correctly processed.
- SIZEOF(SIZEOF()) is now 8.
- Fix error parsing a derived type definition with a field name
starting with "FILL_".
- With OPTIONS /NOI4, compiler complained of IAND with arguments of
an INTEGER*4 variable and a typeless PARAMETER constant.
- Fix incorrect standards warning for DABS.
- Add error message for ambiguous generic.
- Corrected error parsing field array reference in IF.
- Bit constants in argument lists are typed based on value, not
"default integer".
- Allow module to use itself.
- Fix standards warning for Hollerith constant.
- For OpenVMS only, FOR$RAB is always INTEGER*4.
- For OpenVMS only, wrong values for TINY, HUGE for VAX floating.
- For OpenVMS only, EXPONENT() with /FLOAT=D_FLOAT references
non-existent math routine.
- The DIGITAL Fortran run-time library incorrectly failed to release
previously allocated memory when padding Fortran 90 input.
- The DIGITAL Fortran run-time library would incorrectly go into an
infinite loop when an embedded NULL character value was found while
performing a list-directed read operation.
- The DIGITAL Fortran run-time library would incorrectly treat an
end-of-record marker as a value separator while performing a
list-directed read operation.
- The DIGITAL Fortran run-time library incorrectly produced a
"recursive I/O operation" error after a user has made a call to flush()
to flush a unit which was not previously opened, then attempted to
perform any I/O operation on the unit
- The DIGITAL Fortran run-time library would incorrectly fail to
return an end-of-record error for certain non-advancing I/O operations.
This occurred when attempting to read into successive array elements
while running out of data.
- The DIGITAL Fortran run-time library, when it encountered the ":"
edit descriptor at the end of the input record did not stop reading the
next record, causing errors like "input conversion".
- The DIGITAL Fortran run-time library did not handle implied DO
loops on I/O lists when non-native file support (
-convert
or equivalent conversion method) was in use.
The following are corrections for HPF users in this version:
- Expanded I/O Support, including support for all features,
including: complicated I/O statements containing function calls,
assumed size arrays, or variables of derived types with pointer
components, and array inquiry intrinsics using the implied DO loop
index.
In addition, non-advancing I/O (except on stdin and stdout)
now works correctly if every PSE peer in the cluster has a recent
version of the Fortran run-time library (fortrtl_371 or higher).
- NUMBER_OF_PROCESSORS and PROCESSORS_SHAPE in EXTRINSIC(HPF_SERIAL)
routines
- Restriction lifted on user-defined types in some FORALLs
- Declarations in the specification part of a module
- EXTRINSIC(SCALAR) changed to EXTRINSIC(HPF_SERIAL)
These new corrections are described in more detail in the Parallel
Software Environment (PSE) release notes.
2.2 New Features in Version 4.0
The following
f90
command options were added for DIGITAL Fortran 90 Version 4.0:
- Specify the
-assume byterecl
option to::
- Indicate that the OPEN statement RECL unit for unformatted files
is in byte units. If you omit
-assume byterecl
, DIGITAL Fortran 90 expects the OPEN statement RECL value for unformatted
files to be in longword (four-byte) units.
- Return the record length value for an INQUIRE by output list
(unformatted files) in byte units. If you omit
-assume byterecl
, DIGITAL Fortran 90 returns the RECL value for an INQUIRE by output list in
longword (four-byte) units.
- The
-check nopower
option allows arithmetic calculations that result in 0**0 or a negative
number raised to an integer power of type real (such as --3**3.0) to be
calculated, rather than stop the program. If you omit
-check nopower
for such calculations, an exception occurs and the program stops
(default is
-check:power
).
For example, if you specified
-check:nopower
, the calculation of the expression 0**0 results in 1 and the
expression --3**3.0 results in --9.
- Specify
-hpf_matmul
to use matrix multiplication from the HPF library. Omitting the
-hpf_matmul
option uses inlined intrinsic code that is faster for small matrices.
For nonparallel compilations, specifying
-hpf_matmul
to use the HPF library routine is faster for large matrices.
- The
-names keyword
option controls how DIGITAL Fortran 90 handles the case-sensitivity of
letters in source code identifiers and external names:
- Using
-names as_is
requests that DIGITAL Fortran 90 distinguish between uppercase and lowercase
letters in source code identifiers (treats uppercase and lowercase
letters as different) and distinguish between uppercase and lowercase
letters in external names.
- Using
-names lowercase
(default) requests that DIGITAL Fortran 90 not distinguish between
uppercase and lowercase letters in source code identifiers (treats
lowercase and uppercase letters as equivalent) and force all letters to
be lowercase in external names.
- Using
-names uppercase
requests that DIGITAL Fortran 90 not distinguish between uppercase
and lowercase letters in source code identifiers (treats lowercase and
uppercase letters as equivalent) and force all letters to be
uppercase in external names.
- The
-noinclude
option prevents searching for include files in the
/usr/include
directory. This option does not apply to the directories
searched for module files or
cpp
files.
- The
-o5
option activates both the software pipelining optimization (
-pipeline
) and the loop transform optimizations (
-transform_loops
). You can also specify
-notransform_loops
or
-nopipeline
with
-o5
.
If you also specify the
-wsf
option to request parallel processing, you cannot use the
-o5
option.
- The
-pipeline
option activates the only software pipelining optimization (previously
done only by
-o5
). The software pipelining optimization applies instruction scheduling
to certain innermost loops, allowing instructions within a loop to
"wrap around" and execute in a different iteration of the loop. This
can reduce the impact of long-latency operations, resulting in faster
loop execution.
Software pipelining also enables the prefetching of
data to reduce the impact of cache misses. In certain cases, software
pipelining improves run-time performance (separate timings are
suggested).
- The following
-reentrancy keyword
options specify the level of thread-safe reentrant run-time library
support needed:
Option Name |
Description |
-reentrancy none
|
Informs the DIGITAL Fortran RTL that the program will not be relying on
threaded or asynchronous reentrancy. Therefore the RTL need not guard
against such interrupts inside the RTL. This is the default.
|
-reentrancy asynch
|
Informs the DIGITAL Fortran RTL that the program may contain
asynchronous handlers that could call the RTL. Therefore the RTL will
guard against asynchronous interrupts inside its own critical regions.
|
-reentrancy threaded
|
Informs the DIGITAL Fortran RTL that the program is multithreaded, such
as those using the DECthreads library. Therefore the RTL will use
thread locking to guard its own critical regions. To use the threaded
libraries, also specify
-threads
.
|
-noreentrancy
|
The same as
-reentrancy none
.
|
- The
-s
option generates a .s file, which can be assembled. This option is
intended for systems running DIGITAL UNIX Version 4.0 or later, which
has certain new Assembler features.
Certain complex programs that
use modules or common blocks compiled with
-s
may not generate code completely acceptable to the Assembler.
- The
-speculate keyword
option supports the speculative execution optimization:
- Use
-speculate all
to perform the speculative execution optimization on all routines in
the program. All exceptions within the entire program will be quietly
dismissed without calling any user-mode signal handler.
- Use
-speculate by_routine
to perform the speculative execution optimization on all routines in
the current compilation unit (set of routines being compiled), but
speculative execution will not be performed for routines in other
compilation units in the program.
- Use
-speculate none
or
-nospeculate
to suppress the speculative execution optimization. This is the default.
The speculative execution optimization reduces instruction latency
stalls to improve run-time performance for certain programs or
routines. This optimization evaluates conditional code (including
exceptions) and moves instructions that would otherwise be executed
conditionally to a position before the test, so they are executed
unconditionally.
Speculative execution does not support some
run-time error checking, since exception and signal processing
(including SIGSEGV, SIGBUS, and SIGFPE) is conditional. When the
program needs debugging or while testing for errors, use
-speculate none
(default).
- Specifying
-threads
requests that the linker use threaded libraries. This is usually used
with
-reentrancy threaded
.
- The
-transform_loops
option supports a group of optimizations that improve the performance
of the memory system and can apply to multiple nested loops. The loops
chosen for loop transformation optimizations are always counted
loops (counted loops include DO or IF loops, but not uncounted
DO WHILE loops). In certain cases, loop transformation improves
run-time performance (separate timings are suggested).
- Specify
-nowsf_main
to indicate that the HPF global routine being compiled will be linked
with a main program that was not compiled with
-wsf
.
For more information on
f90
command options, see the DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems, Chapter 3, or f90(1).
In addition to the
f90
command-line options, the following new or changed features were added
for Version 4.0:
- The random_number intrinsic (as of Version 4.0) uses two separate
congruential generators together to produce a period of approximately
10**18, and produces real pseudorandom results with a uniform
distribution in (0,1). It accepts two integer seeds, the first of which
is reduced to the range [1, 2147483562]. The second seed is reduced to
the range [1, 2147483398]. This means that the generator effectively
uses two 31-bit seeds.
The new algorithm behaves differently from
one provided prior to Version 4.0 in the following ways:
- Both seeds are active and contribute to the random number being
produced.
- If the given seeds are not in the ranges given above, they will be
reduced to be in those ranges.
- The sequences of random numbers produced by the new generator will
be different from the sequences produced by the old generator.
For more information on the algorithm, see:
- Communications of the ACM vol 31 num 6 June 1988, entitled
Efficient and Portable Combined Random Number Generators by
Pierre L'ecuyer
- Springer-Verlag New York, N. Y. 2nd ed. 1987, entitled
A Guide to Simulation by Bratley, P., Fox, B. L., and Schrage,
L. E.
For an example program, see Section 1.10.4.
- The implementation of the MATMUL intrinsic procedure was changed
for this release. Previously the compiler called a routine in the
scalar HPF library to perform the operation. As of this release, the
compiler generates optimized inline code for the MATMUL intrinsic with
a significant increase in the performance when the size of the array
arguments are small.
To use previous implementation of the MATMUL
intrinsic (routine in the scalar HPF library), specify
-hpf_matmul
.
- The cDEC$ ALIAS directive
The cDEC$ ALIAS directive is now
supported in the same manner as in DIGITAL Fortran 77. This directive
provides the ability to specify that the external name of an external
subprogram is different than the name by which it is referenced in the
calling subprogram.
This feature can be useful when porting code
between OpenVMS and UNIX systems where different routine naming
conventions are in use.
For more information on the cDEC$ ALIAS
directive, see the DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems.
- The cDEC$ ATTRIBUTES directive
The cDEC$ ATTRIBUTES directive
lets you specify properties for data objects and procedures. These
properties let you specify how data is passed and the rules for
invoking procedures. This directive is intended to simplify mixed
language calls with DIGITAL Fortran 90 routines written in C or Assembler.
For more information on the cDEC$ ATTRIBUTES directive, see
DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems.
- An additional math library allows use of optimizations for a series
of square root calculations.
The library file
libm_4sqrt
ships on the DIGITAL Fortran 90 Version 4.0 kit (and DIGITAL Fortran 77
Version 4.0). These optimizations improve run-time performance when a
series of square root calculations occur within a counted loop.
- Enhanced support for the FORALL statement and construct
The
FORALL construct now allows the following statements in the forall body:
- Pointer assignment statement
- FORALL statement or construct (nested FORALL)
- WHERE statement or construct
Please note that each statement in the FORALL body is executed
completely before execution begins on the next FORALL body statement.
The compiler now correctly defines the scope of a FORALL subscript
name to be the scope of the FORALL construct. That is, the subscript
name is valid only within the scope of the FORALL. Its value is
undefined on completion of the FORALL construct.
- OPTIONS statement options can now be abbreviated (for compatibility
with DIGITAL Fortran 77).
- The
-vms
option now supports use of /LIST or /NOLIST in an INCLUDE statement
(for compatibility with DIGITAL Fortran 77).
- To improve run-time performance, new optimizations are now
available and certain improvements have been made, including:
- Certain intrinsic procedures specific to Fortran 90 (not available
in FORTRAN-77)
- Subprogram calls with array arguments
- New command-line options that activate new optimizations, including
the loop transformation optimizations (
-transform_loops
or
-o5
) and the speculative execution optimization (
-speculate keyword
). The software pipelining optimization is now activated by using
-pipeline
or
-o5
.
- Variable formats expressions (VFEs) are now allowed in quoted
strings.
- Invalid formats in quoted strings are now detected at compile-time
rather than run-time.
For more information on compatibility with DIGITAL Fortran 77, see the
revised DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems, Appendix A.
2.3 New Features in Version 2.0
New features for Version 2.0 include the LOC intrinsic function. LOC
returns the internal address of its argument (same as the built-in
function %LOC).
In addition, the DIGITAL Ladebug debugger has added support for DIGITAL
Fortran 90 language features (see Section 1.10.8.1).
2.4 New Features in Version 1.3
New features for Version 1.3 include the f90 command options
that support the DIGITAL Parallel Software Environment.
To request parallel execution, specify the
-wsf
or
-wsf nn
option . This compiles the program to run in parallel using the
DIGITAL Parallel Software Environment product. The optional nn parameter specifies the
number of processors on which the program is intended to execute. If
not specified, the program will be compiled to execute on any number of
processors. More efficient code is generated when nn is
specified.
If you specify the
-wsf
or
-wsf nn
option to request parallel execution, you can also use the following
related options:
- The
-assume nozsize
option assumes there are no zero-sized array sections.
- The
-nearest_neighbor
or
-nearest_neighbor nn
option enables or disables the nearest neighbor parallel optimization.
The optional nn parameter specifies the width of the shadow
edge to use. If you omit nn, it is set to 1.
- The
-pprof string
option allows parallel profiling of an application. Valid characters
for string are s for sampling or i for interval. This option
must be used with the
-non_shared
option (as well as
-wsf
or
-wsf nn
). This option must not be used with the
-p1
option.
- The
-show wsfinfo
option includes information about statements which cause interprocessor
communication to be generated or are serialized in the listing file.
Other Version 1.3 new features include the following:
- Support for the DIGITAL Fortran 77 pointers (CRAY® style). This
is an extension to the Fortran 90 and FORTRAN-77 standards. For more
information, see the DEC Fortran Language Reference Manual and Section 1.10.5.
- Bit constants with a trailing B or Z or leading X (a DIGITAL
Fortran extension) are now supported for compatibility with DIGITAL
Fortran 77:
i = '001'B
k = '0ff'Z
j = X'00f'
|
- The SYSTEM_CLOCK intrinsic procedure has been extended to allow
integer arguments of any KIND rather than the default integer KIND .
This allows the use of INTEGER*8 arguments to obtain a higher degree of
magnitude and accuracy in timings (1,000,000 counts per second). For
example:
integer*8 count,count_max,count_rate
call system_clock(count,count_rate,count_max)
|
- When it is passed an INTEGER (KIND=4) value, the SYSTEM_CLOCK
intrinsic procedure now returns a value in terms of 10,000 instead of
1,000,000 counts per second.
- Debugging support has been enhanced to allow breakpoints on
CONTINUE, GOTO, and RETURN statements. Before Version 1.3, breakpoints
could not be set on a CONTINUE statement and only on certain GOTO and
RETURN statements.
- The following DIGITAL Fortran 90 cDEC$ directives are now supported:
- cDEC$ IDENT specifies a string that identifies the object file.
- cDEC$ OPTIONS and cDEC$ END_OPTIONS controls alignment of fields in
common blocks, record structures, and most derived-type structures.
- cDEC$ PSECT modifies certain attributes of a common block,
including the [NO]MULTILANGUAGE attribute for compatibility with
DIGITAL Fortran 77.
- cDEC$ TITLE and cDEC$ SUBTITLE specifies strings for the title and
subtitle of a listing file header.
- Any number raised to a floating point 2.0 (x ** 2.0) is now
transformed to (x ** 2) for compatibility with DIGITAL Fortran 77.
- The Bessel function 3f library (jacket) routines are now supported
(see bessel(3f))
- The following
f90
command options were added for Version 1.3:
- The
-fuse_xref
option requests that DIGITAL Fortran 90 generate a data file that the
DEC FUSE Database Manager uses to create a cross-reference database
file. This improves the performance of the DEC FUSE Call Graph Browser
and Cross-Referencer that use the database file for their operations.
- The
-inline speed
and
-inline size
options have been added in place of
-inline automatic
to provide more control over procedure inlining:
Use
-inline size
(same as
-inline space
) to inline procedures that will likely improve run-time performance
where inlining will not significantly increase program size. This
option is meaningful only at optimization levels
-o1
and higher.
Use
-inline speed
to inline procedures that will likely improve run-time performance
where inlining may significantly increase program size. Using
-inline speed
often results in larger executable program sizes (than
-inline size
). This type of inlining occurs automatically with the
-o4
or
-o5
optimization levels. This option is meaningful only at optimization
levels
-o1
and higher.
Other
-inline xxxx
options include
-inline none
,
-inline manual
, and
-inline all
(see Section 2.5).
- The
-ladebug
option includes additional symbolic information in the object file for
the DIGITAL Ladebug debugger (see ladebug(1). This option enables Ladebug to
print and assign to dynamic arrays using standard Fortran syntax,
including array sections.
- The
-show map
option includes a symbol map in the listing file (also specify
-v
).
- The
-version
option displays DIGITAL Fortran 90 version number information.
For more complete product information, see the DIGITAL Fortran 90
documentation and the f90(1) reference
(man) page.
2.5 New Features in Version 1.2
DIGITAL Fortran 90 Version 1.2 contains the following changes since
Version 1.1:
- Support for REAL (KIND=16) (or REAL*16) X_float (extended
precision) data type and its associated intrinsics (a DIGITAL Fortran
extension). For more information see Section 1.10.
- Support for variable format expressions (VFEs), a DIGITAL Fortran
extension (see Section 1.10).
- Support for OPTIONS statements, which allow you to specify
command-line options in your source files. The OPTIONS statement is a
DIGITAL Fortran extension.
- Intrinsic procedures FP_CLASS and IMAG (a DIGITAL Fortran
extension).
- STATIC and AUTOMATIC declaration attributes and statements (a
DIGITAL Fortran extension).
- The following
f90
command options were added for Version 1.2:
- The
-convert fgx
and
-convert fdx
options allow conversion of unformatted OpenVMS Alpha DIGITAL Fortran
77 data files. Similarly, the FDX and FGX keywords are recognized for
the OPEN statement CONVERT keyword and the FORT_CONVERTn
environment variable names.
Specifying
-convert fdx
indicates the data contains::
- Little endian integer format (INTEGER declarations of the
appropriate size)
- REAL*4 and COMPLEX*8 data in VAX F_float format
- REAL*8 and COMPLEX*16 data in VAX D_float format
- REAL*16 data in native X_float format
Specifying
-convert fgx
indicates the data contains:
- Little endian integer format (INTEGER declarations of the
appropriate size)
- REAL*4 and COMPLEX*8 data in VAX F_float format
- REAL*8 and COMPLEX*16 data in VAX G_float format
- REAL*16 data in native X_float format
- The
-double_size 128
option specifies that DOUBLE PRECISION declarations are implemented as
extended precision REAL (KIND=16) data rather than double precision
REAL (KIND=8) data.
- The
-real_size 128
and
-r16
options allow a REAL declaration to be interpreted using the REAL
(KIND=16) data type.
- The
-inline xxxxx
options can be used to specify the type of inlining done independent of
the
-on
option (optimization level) specified:
- To prevent inlining of procedures (except statement functions), use
-inline none
or
-inline manual
.
This is the type of inlining done with
-o0
,
-o1
,
-o2
, or
-o3
.
- The
-inline automatic
option was replaced at Version 1.3 with
-inline size
and
-inline speed
(see Section 2.4), allowing more control over inlining.
- To inline every call that can possibly be inlined while generating
correct code, including: statement functions, procedures that
DIGITAL Fortran 90 thinks will improve run-time performance, and any other
procedures that can possibly be inlined while generating correct code
(certain recursive routines cannot be inlined), use
-inline all
. This option is meaningful only at optimization levels
-o1
and higher.
- The
-gen_feedback
option requests additional profiling information needed for feedback
file use. You can use
-gen_feedback
with any optimization level up to
-o3
(to avoid inlining procedures). If you omit a
-on
option, the
-gen_feedback
option changes the default optimization level to
-o0
.
A typical command-line sequence to create a feedback file (
profsample.feedback
) follows:
% f90 -gen_feedback -o profsample -O3 profsample.f90
% pixie profsample
% profsample.pixie
% prof -pixie -feedback profsample.feedback profsample
|
- The
-feedback
option now works with
-cord
or separately without
-cord
to specify a previously-created feedback file. For example:
% f90 -feedback profsample.feedback -o profsample -O3 profsample.f90
|
The feedback file provides the compiler with actual execution
information, which the compiler can use to perform such optimizations
as inlining function calls.
The same optimization level (
-on
option) must be specified for the
f90
command with the
-gen_feedback
option and the
f90
command with the
-feedback name
option.
You can use the feedback file as input to the
f90
compiler and
cord
, as follows:
% f90 -cord -feedback profsample.feedback -o profsample -O3 profsample.f90
|
- The
-tune keyword
option selects processor-specific instruction tuning for
implementations of the Alpha architecture. Regardless of the setting of
-tune keyword
, the generated code will run correctly on all implementations of the
Alpha architecture. Tuning for a specific implementation can improve
run-time performance; it is also possible that code tuned for a
specific target may run slower on another target.
Choose one of the
following:
- To generate and schedule code that will execute well for both types
of chips, use
-tune generic
. This provides generally efficient code for those cases where both
types of chips are likely to be used. If you do not specify any
-tune keyword
option,
-tune generic
is used (default).
- To generate and schedule code optimized for the type of chip in use
on the system being used for compilation, use
-tune host
.
- To generate and schedule code optimized for the 21064, 20164A,
21066, and 21068 implementations of the Alpha chip, use
-tune ev4
.
- To generate and schedule code optimized for the 21164
implementation of the Alpha chip, use
-tune ev5
.
- The
-check noformat
option disables the run-time message (number 61) associated with format
mismatches. It also requests that the data item be formatted using the
specified descriptor, unless the length of the item cannot accommodate
the descriptor (for example, it is still an error to pass an INTEGER
(KIND=2) item to an E edit descriptor). Using
-check noformat
allows such format mismatches as a REAL (KIND=4) item formatted with an
I edit descriptor.
If you omit the
-vms
option, the default is
-check noformat
.
If you specify
-vms
and omit
-check noformat
,
-check format
is used.
- The
-check output_conversion
option disables the run-time message (number 63) associated with format
truncation. The data item is printed with asterisks. Error number 63
occurs when a number could not be output in the specified format field
length without loss of significant digits (format truncation).
If
you omit the
-vms
option, the default is
-check nooutput_conversion
.
If you specify
-vms
and omit
-check nooutput_conversion
,
-check output_conversion
is used.
- The
-vms
option now sets defaults for
-check output_conversion
and
-check format
.
For more complete product information, see the DIGITAL Fortran 90
documentation and the f90(1) reference
(man) page.
2.6 New Features in Version 1.1
DIGITAL Fortran 90 Version 1.1 contains the following changes since
Version 1.0:
- The following
f90
command options were added for Version 1.1:
- The
-check bounds
option generates additional code to detect out-of-bounds subscripts for
array operations and character substring expressions at run-time. Use
this option for debugging purposes.
- The
-idir
option specifies an additional directory to be searched for files
specified with an INCLUDE statement or module files. For Version 1.0,
this option specified an additional directory searched for module files
only.
- The
-warn argument_checking
option issues a warning message about argument mismatches between the
calling and the called procedure when both program units are compiled
together.
- The
fsplit
command now accepts DIGITAL Fortran 90 free-form source files (see
fsplit(1)). For example:
% fsplit -f90 -free bigfile.f90
|
For more complete product information, see the DIGITAL Fortran 90
documentation and the f90(1) reference
(man) page.
Chapter 3
Documentation, Corrections, and Other Fortran 90 Documentation
The sections in this chapter:
- List known DIGITAL Fortran 90 documentation corrections ( Section 3.1)
- Describe DIGITAL Fortran 90 documentation and online information
( Section 3.2)
- Describe the main DIGITAL Parallel Software Environment documents ( Section 3.3)
- List other sources of information about Fortran 90 ( Section 3.4)
3.1 DIGITAL Fortran 90 Documentation Corrections
This section contains information that does not appear in the
DIGITAL Fortran 90 documentation. Included in each description is a notation
of the first version to which it applies.
3.1.1 DIGITAL Fortran Installation Guide for DIGITAL UNIX Systems
The following corrections apply to the installation guide, order number
AA--PW82E--TE (December 1998 on the inside title page):
3.1.2 DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems
The following known correction applies to the user manual, order
number AA--Q66TC--TE (March 1998 on the inside title page):
3.1.3 DIGITAL Fortran Language Reference Manual
There are no known corrections to the DIGITAL Fortran Language
Reference Manual, order number AA--Q66SC--TE (April 1997 on the
inside title page).
For a description of language features added since Version 4.1, see
Section 1.5, Section 1.8, and Section 1.9. These additions have
been added to the online documentation CD-ROM HTML version of this
document.
3.2 DIGITAL Fortran 90 Documentation and Online Information
The DIGITAL Fortran 90 documentation set includes the following:
- DIGITAL Fortran Installation Guide for DIGITAL UNIX Systems (AA--PW82E--TE)
Explains how to install DIGITAL
Fortran (DIGITAL Fortran 90 and DIGITAL Fortran 77) on a DIGITAL UNIX Alpha
system, including requirements.
The installation guide is included
with the DIGITAL Fortran 90 document kit, QA-MV2AA-GZ.5.n and
the DIGITAL Fortran 77 kit, QA-MV2AB-GZ.5.n. It is also
included in ASCII and PostScriptTM
form on the Software Product Library CD-ROM (media CD-ROM) and is on the
Online Documentation Library CD-ROM in HTML form.
- DIGITAL Fortran Language Reference Manual (AA--Q66SC--TE)
Describes the DIGITAL Fortran 90
source language for reference purposes, including the format and use of
statements, intrinsic procedures, and other language elements. It also
provides an overview of new Fortran 90 features (not available in
FORTRAN-77).
It identifies extensions to the Fortran 90 standard by
blue-green color in the printed and HTML forms of this
document.
The DIGITAL Fortran Language Reference Manual is
included with the DIGITAL Fortran 90 document kit, QA-MV2AA-GZ and is
available on the Online Documentation Library CD-ROM in
HTML form.
The DIGITAL Fortran Language Reference Manual has been translated into Japanese and is
available.
- DIGITAL Fortran 90 User Manual for DIGITAL UNIX Systems (AA--Q66TC--TE)
Describes the DIGITAL Fortran 90
program development and run-time environment on DIGITAL UNIX Alpha
systems. It describes compiling, linking, running, and debugging
DIGITAL Fortran 90 programs, performance guidelines, run-time I/O and
error-handling support, data types, numeric data conversion, calling
other procedures and library routines, and compatibility with DIGITAL
Fortran 77. It provides information common to DIGITAL Fortran 90 and the
DIGITAL Parallel Software Environment as well as information about using directed parallel
processing using OpenMP and DIGITAL Fortran directives.
The printed
version of this document is included with the DIGITAL Fortran 90
document kit, QA-MV2AA-GZ.5.n and is on the Online
Documentation Library CD-ROM in HTML form.
- Digital Extended Math Libarary Reference Guide
(AA--RFTPA--TE)
Describes the Digital Extended Math Library, a
collection of high-performance subprograms that perform different types
of mathematical operations, including:
- Matrix computations
- Signal processing code
- Code to solve sparse linear systems using direct and iterative
methods
The printed version of this document is included with the DIGITAL
Fortran 90 document kit, QA-MV2AA-GZ.5.n and is on the Online
Documentation Library CD-ROM in PDF form.
- Read Before Installing or Using DIGITAL Fortran Version 5.n for
DIGITAL UNIX Systems (AV--PW83K--TE)
This cover letter
contains information about installing DIGITAL Fortran (DIGITAL Fortran 90
and DIGITAL Fortran 77) that may not be included in the installation
guide or in the release notes.
This cover letter is included with
the DIGITAL Fortran 90 document kit, QA-MV2AA-GZ.5.n, and the
DIGITAL Fortran 77 kit, QA-MV2AB-GZ.5.n. It is also included
on the Software Product Library CD-ROM (media CD-ROM) in ASCII and
PostScript form.
The DIGITAL Fortran 90 Software Product Description (SPD) is provided
as a file on the Software Product Library CD-ROM (media CD-ROM).
The following DIGITAL Fortran 90 online information is available (once
installed on the system):
- DIGITAL Fortran 90 online reference pages
Describe the DIGITAL Fortran 90
software components, including f90(1),
fpr(1), fsplit(1), intro(3f), numerous Fortran library routines
listed in intro(3f), and numerous
parallel High Performance Fortran library routines listed in intro(3hpf).
- DIGITAL Fortran 90 online release notes
Provide more information on
this version of DIGITAL Fortran 90, including known problems and a summary
of the DIGITAL Fortran 90 run-time error messages. These release notes
are also provided on the Software Product Library CD-ROM (media
CD-ROM).
Once installed, the online release notes are located in:
-
/usr/lib/cmplrs/fort90/relnotes90
To view this file, use the
more
command (or
view
) on a system where DIGITAL Fortran 90 is installed:
% more /usr/lib/cmplrs/fort90/relnotes90
|
To initiate a search within
more
, type a slash (/) followed by the appropriate topic. For information
about using the
more
command, see more(1).
- DIGITAL Fortran 90 online help file
This ASCII file provides online
access to DIGITAL Fortran 90 information, which includes error message
descriptions, a summary of the language elements (statements, intrinsic
functions, and so on), a glossary, and other information. The DIGITAL
Fortran 90 help file is located in:
/usr/lib/cmplrs/fort90/decfortran90.hlp
|
Use the more command or the view command to access the information
available in these ASCII files. These help files are large and are not
usually printed on a printer or read sequentially.
The DIGITAL Fortran Installation Guide for DIGITAL UNIX Systems, these online release notes, the "read
first" cover letter, and the SPD are available on the DIGITAL UNIX
Software Product Library CD-ROM (media CD-ROM) in ASCII and PostScript
format.
All DIGITAL Fortran 90 documents except the cover letter, SPD, and
these release notes are available on the DIGITAL UNIX Online
Documentation Library CD-ROM in HTML format.
3.3 DIGITAL Parallel Software Environment Documentation
The DIGITAL Parallel Software Environment product supports the parallel execution of Fortran 90
programs using High Performance Fortran constructs.
For information on the DIGITAL Parallel Software Environment product, see the DIGITAL Parallel Software Environment
document kit, QA-2ATAA-GZ. This kit includes the DIGITAL High Performance Fortran 90 HPF and PSE Manual.
The DIGITAL High Performance Fortran 90 HPF and PSE Manual explains both the Parallel Software Environment (PSE)
and the High Performance Fortran (HPF) programming language. It
describes the installation, set up, administration, and general use of
the PSE software, as well as hardware configuration for a parallel
Alpha Farm. In addition, it also contains a tutorial describing how to
write programs using the HPF extensions to DIGITAL Fortran 90 and
describes how to run, debug, and profile HPF programs in the PSE.
3.4 Other Sources of Information About Fortran 90
This section lists sources of information about Fortran 90 other than
the DIGITAL Fortran 90 documentation.
The following publication is the copywritten standard for Fortran 90:
- American National Standard Fortran 90, ANSI X3.198-1991, and
International Standards Organization standard ISO/IEC 1539:1991.
(Simply referred to in documentation as the "Fortran 90
Standard".)
Tutorial information about the Fortran 90 language is available in
commercially published documents at major book stores or from their
publishers. DIGITAL Fortran 90 documentation does not usually provide such
tutorial information. The following commercially published documents
(listed in alphabetical order by title) in English provide reference or
tutorial information about Fortran 90:
- Fortran 90 Explained by M. Metcalf and J. Reid, Published
by Oxford University Press, ISBN 0-19-853772-7.
- Fortran 90/95 Explained by M. Metcalf and J. Reid,
Published by Oxford University Press, ISBN 0-19-851888-9.
- Fortran 90/95 for Scientists and Engineers by S. Chapman,
Published by McGraw-Hill, ISBN 0-07-011938-4.
- Fortran 90 Handbook by J. Adams, W. Brainerd, J. Martin,
B. Smith, and J. Wagener, Published by Intertext Publications
(McGraw-Hill), ISBN 0-07-000406-4.
- Fortran 90 Programming by T. Ellis, I. Philips, and T.
Lahey, Published by Addison/Wesley, ISBN 0201-54446-6.
- Introduction to Fortran 90/95 by S. Chapman, Published by
McGraw-Hill, ISBN 0-07-011969-4.
- Programmer's Guide to Fortran 90, Second Edition by W.
Brainerd, C. Goldberg, and J. Adams, Published by Unicomp, ISBN
0-07-000248-7.
For information on High Performance Fortran (HPF), see the following:
- High Performance Fortran Language Specification, Version
1.1, Technical Report CRPC-TR-92225, Center for Research on
Parallel Computation, Rice University, Houston, TX USA. Also see the
draft version of the Version 2.0 specification, which at the time of
this writing is out for public comment, but has not been finally
approved.
These specifications are available online on the World
Wide Web as follows:
http://www.crpc.rice.edu/HPFF/home.html
|
DIGITAL provides this list of Fortran 90 documents (books) for the sole
purpose of assisting customers who want to learn more about the Fortran
90 language. This list of documents does not comment---either
positively or negatively---on any of the documents listed or any not
yet listed. Any omissions are not intentional. Publications that become
available after the revision of a DIGITAL Fortran 90 document will be added
at the next revision.