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.

Contents


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:

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:


  fortran@digital.com 

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):


  http://www.digital.com/fortran/

1.4 Software Versions

The DIGITAL Fortran 90 Version 5.2 kit consists of the following setld sets:

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:

The HPFLIBS subset contains High Performance Fortran (HPF) support and contains:

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.

  1. Delete any old versions that you wish to delete.
  2. Install PSE160.
  3. Install DIGITAL Fortran 90 Version 5.2 including the HPFLIBS170 subset.
  4. 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:

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:

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:

1.5.2 Version 5.2 Important Information

Some important information to note about this release:

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:

From version FT1 T5.2-682-4289P to FT2 T5.2-695-428AU, the following corrections have been made: From version FT2 T5.2-695-428AU to V5.2-705-428BH, the following corrections have been made:

1.5.4 Version 5.2 Known Problems

The following known problems exist with DIGITAL Fortran Version 5.2:

1.6 Known Limitations

The following limitations exist in Version 5.2:

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:

In addition, the compiler supports many HPF Version 2.0 approved extensions including:

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:

1.7.1.2 Non-Parallel Execution of Code

The following constructs are not handled in parallel:

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 the entire loop nest is encapsulated in an ON HOME RESIDENT region, then only the first two restrictions apply.

For More Information:

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:

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:

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.

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:

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:

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:

  1. by labeling every procedure called by the FORALL or INDEPENDENT DO loop as PURE
  2. 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:

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:

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:

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:

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:

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.


# bad -peers 4 
# 

To see the execution status, type this csh command (other shells require different commands):


# echo $status 

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.


# bad -peers 4 -debug 

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:

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.

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:

1.8.2 Version 5.1 Corrections

Since Version 5.0, the following corrections have been made:

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:

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:

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:

1.8.4 HPF Version 5.1 Corrections

This section lists problems in previous versions that have been fixed in this version.

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 following new High Performance Fortran (HPF) features and corrections have been added for DIGITAL Fortran Version 5.0:

1.9.2 Version 5.0 Corrections

Since Version 4.1, the following corrections have been made:

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:

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:

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:

For more information, see the DIGITAL UNIX system management documentation. For DIGITAL UNIX Version 4.0, you can use the following check list:

  1. Either have a large swap space or use deferred swap allocation. This involves either:
  2. 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:

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:

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:


 J = 5 
 FORMAT (I<J+1>) 

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:


print $MOD$X$_ 

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:

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:

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):

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:

1.10.9 Notes on Fast Math Library Routines

The f90 option -math_library fast provides alternate math routine entry points to the following:

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:

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:

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:

The following new High Performance Fortran features have been added for DIGITAL Fortran 90 Version 4.1:

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:

The following are corrections for HPF users in this version:

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:

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:

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:

Other Version 1.3 new features include the following:

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:

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:

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:

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:

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):

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:

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:

For information on High Performance Fortran (HPF), see the following:

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.

Contents