Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran v2.8 for HP-UX 11.0/11i v1 and 11i v2 Release Note*5990-6773* > Chapter 1 HP Fortran v2.8 for HP-UX 11.0/11i v1 and 11i v2

What’s in This Version

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

HP Fortran v2.8 contains object-oriented feature optimizations, including:

  • Full Fortran 95 compiler (based on International ANSI/ISO standards)

  • Changes/additions to directives and options:
    +Ofaster (revised)
    -ipo
    optimize openmp [on|off
    ]
    +Oautopar (revised description)
    +Ofast (changed implied options)
    +DOosname

  • NEW: Resolving issues with unaligned data

  • Full OpenMP v2.0

  • Linking HP Fortran 90 routines

  • Support for the HP WDB Debugger

  • Support for math intrinsic inlining

  • Standard Fortran library

Recent changes/additions to directives and options

The following reflects recent changes/additions to directives and options:

+Ofaster

For Itanium®-based systems only: Selects the +Ofast option at optimization level +O4. Equivalent to +Ofast +O3 -ipo.

For PA-RISC systems only: +Ofaster drops to +O3.

-ipo   (For Itanium®-based systems only)

Enables interprocedural optimizations across files. Object files produced using this option contain intermediate code in IELF format. At linke time, ld automatically invokes the interprocedural optimizer u2comp if any of the input object files is an IELF file.

This option is ignored at optimization levels +O1 and +O2. It is enabled by default when +O4 or +Ofaster are used.

optimize openmp [on|off]

  • $optimize openmp on
    $optimize openmp off

  • Must be placed between subroutines

  • Turns on or off recognition of OpenMP directives

The behavior of this directive is similar to fsplit’ing a file and selectively choosing +Oopenmp or +Onoopenmp per each file.

+Oautopar

  • +Oparallel inhibits +O4.

  • If automatic parallelization is desired along with +O4, then use +Oautopar (and omit +Oparallel).

  • Is now linked in libcps.

+Ofast

  • +Ofast no longer implies +Oshortdata.

  • +Ofast now passes the following options to the linker:
    -W1,+pi,4M
    -W1,+pd,4M
    -W1,+mergeseg
    (on Itanium®-based systems only)

+DOosname

  • Sets the target operating system for the compiler.

  • Intended for enabling optimizations that are not backward compatible.

  • Can be used at any level of optimization.

  • PA-RISC—based system recognized values for osname are 11.0 and 11.0EP9806. Itanium ®—based system recognized values for osname are 11.20, 11.22, and 11.23. +DOosname selects optimizations that are compatible with operating system version osname and later.

  • Default value for osname is the operating system version of the computer on which the compiler is invoked.

+Oprofile=collect[:<qualifiers>]

In the absence of qualifiers, +Oprofile=collect is the same as +I. <qualifiers> are a comma-separated list of profile collection qualifiers. Supported profile collection qualifiers:

  • arc—collect arc counts (synonym for +Oprofile=collect). This is the default value.

  • stride—collect stride data.

  • all—collect all types of profile data. This is a synonym for +Oprofile-collect:arc, stride.

Interactions and dependencies are not changed with respect to +Oprofile=collect.

+Ofailsafe

This option is now supported for the Itanium® processor family.

HP$OPTIMIZE

HP$OPTIMIZE, as listed below, is now supported for Fortran 90.

  • !$HP$ OPTIMIZE ON

  • !$HP$ OPTIMIZE OFF

  • !$HP$ OPTIMIZE level 1

  • !$HP$ OPTIMIZE level 0

  • !$HP$ OPTIMIZE level 2

  • !$HP$ OPTIMIZE level 1 on

  • !$HP$ OPTIMIZE level 0 on

  • !$HP$ OPTIMIZE level 2 on

  • !$HP$ OPTIMIZE level 1 off

  • !$HP$ OPTIMIZE level 0 off

  • !$HP$ OPTIMIZE level 2 off

  • !$HP$ optimize assume_no_parameters_overlaps on

  • !$HP$ optimize assume_no_parameters_overlaps off

Binary I/O Conversions (for Itanium®-based systems)

This feature enables the specification of a binary conversion to happen to all unformatted sequential data on reads and writes to various units. Both the OPEN and INQUIRE commands accept the CONVERT argument.

Allowable conversions

There are two types of allowable conversions:

  • Native—the default, and no conversions will occur. The user may also specify “Big_Endian”.

  • Little Endian—will convert data from Little_Endian format to the Native format while reading it in and back to Little_Endian format when writing it out to disk.

When the CONVERT argument is specified to the OPEN statement, all I/O to that unit will undergo the specified conversions.

When the CONVERT argument is specified to the INQUIRE statement, a string is returned that describes the conversions being done at runtime for a given unit.

In addition to specifying the CONVERT parameter to the OPEN statement, there are two other methods for specifying the type of conversion to take place:

  • If the environment variable FORT_CONVERT<unit> (where <unit> is the unit number to convert) is specified to either of the accepted conversion types (Native or Little Endian), that unit will undergo conversion as if the CONVERT parameter was passed to each open statement referring to that unit. Many different environment variables may be required to convert every different unit in a program.

  • There is a global FORT_CONVERT environment variable without a unit number, which may be used to refer to all of the units in a program.

Specifying a binary conversion

There are three ways to specify what file/unit should be converted, and which conversion to apply (in priority, with highest priority listed first):

  • Environment variable: “FORT_CONVERT<unit_num>”—specifies unit number

  • Environment variable: “FORT_CONVERT”—specifies for all I/O

  • Argument to OPEN: “CONVERT=”—specifies for this particular file opened

Typically, code is written via the CONVERT=argument to OPEN and INQUIRE. Therefore, this option was given the higher priority status to allow overriding “normal” coding via the environment variable.

NOTE: The CONVERT parameter to OPEN is only available via f90 version 2.7 or later, and is only accepted for UNFORMATTED files.

Resolving issues with unaligned data

The following suggestions will aid with issues regarding unaligned data:

For Itanium®—based applications

As a quick fix, add the following call to the main program:

call allow_unaligned_data_access( )

Then, link in an additional library that fixes these alignment issues at runtime:

-lunalign

Longer term, try compiling with the following flag:

+allow_unaligned

An example would be:

PROGRAM bs30
INTEGER*2 i2(10)
INTEGER*4 i4
EQUIVALENCE (i2(2), i4)
DATA I4 /z’FFFF0000’/
i4=12
    call allow_unaligned_data_access()

print *,i4
END

Then compile with:

/opt/fortran90/bin/f90 foo.f -lunalign +noppu

If you need to drop the +noppu, then add an alias directive as follows:

!$HP$ALIAS allow_unaligned_data_access=’allow_unaligned_data_access’

PROGRAM bs30
INTEGER*2 i2(10)
INTEGER*4 i4
EQUIVALENCE (i2(2), i4)
DATA I4 /z’FFFF0000’/
i4=12
    call allow_unaligned_data_access()

print *,i4
END

Then compile with:

/opt/fortran90/bin/f90 foo.f -lunalign

NOTE: Nothing new is required to use the aforementioned -lunalign runtime fix approach; however, you do need the latest patch for the +allow_unaligned compile flag.

If the misaligned data might be passed to routines which are not compiled with +allow_unaligned (for example, Fortran runtime IO and F90 libraries), then having the call will allow the runtime fixes to happen which will prevent bus errors in your application.

To realize optimum performance, try and measure the following two options:

1. Compile with +allow_unaligned and insert the call to allow_unaligned_data_access()
2. Only insert the call to allow_unaligned_data_access()

Option #1 may perform faster with very few references to misaligned data and a handler is invoked for these misaligned references. #2 may perform faster with many references.

Full OpenMP v2.0

HP Fortran now supports full OpenMP v2.0. OpenMP is a portable, scalable model that gives shared-memory parallel programmers a simple and flexible interface for developing parallel applications on platforms ranging from the desktop to the supercomputer.

More information

Complete information about this feature is available in the Parallel Programming Guide for HP-UX Systems.

Linking HP Fortran 90 routines

When calling HP Fortran 90 routines on the HP 9000 Series 700/800, you must include the appropriate run-time libraries by adding certain arguments to the aCC command when linking your program.These arguments depend on how the Fortran 90 routines were compiled.

32-bit PA-RISC 1.1 code

-L/opt/fortran90/lib/ -lF90 -lisamstub

32-bit PA-RISC 2.0 code

-L/opt/fortran90/lib/pa2.0/ -lF90 -lisamstub

64-bit PA-RISC 2.0 code

-L/opt/fortran90/lib/pa20_64/ -lF90 -lisamstub

HP WDB Debugger

The HP WDB debugger is an HP-supported implementation of the GDB debugger. It supports source-level debugging of object files written in HP Fortran, HP C, and HP aC++ on HP-UX Release 10.20 and later. For additional information, please visit http://www.hp.com/go/wdb.

HP Caliper v3.0 (for Itanium®—based applications only)

HP Caliper 3.0 is a new general-purpose performance analysis and performance improvement tool for Itanium®-based applications bundled with HP Fortran, HP ANSI C, and HP aC++. HP Caliper helps you analyze and improve the performance of your native Itanium®-based programs in three ways:

  • A simple and quick way to optimize the performance of your program by providing information for compiler profile-based optimization.

  • Commands to measure the overall performance of your program.

  • Commands to drill down to identify performance parameters of specific functions in your program.

A significant advantage of HP Caliper is that it requires no special compilation, link options, or libraries for your Itanium-based programs.

HP Caliper dynamically measures performance on:

  • Fortran, C, and C++ binaries

  • 32- or 64-bit binaries

  • Shared or archive libraries

  • Debug or optimized programs

Another advantage is that HP Caliper performs its measurements with low overhead and for well-behaved executables, HP Caliper does not alter the semantic behavior of the target program.

Required disk space is 12 MB. Memory requirements vary with settings used for performance measurement.

Documentation

HP Caliper 3.0 includes the following documentation:

  • On-line User Guide in HTML format available in the /opt/caliper/doc subdirectory

  • Printable User Guide in PDF format

  • Command-line option summary available with --help option

  • The caliper (1) man page

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1979-2003 Hewlett-Packard Development Company, L.P.