COMPAQ Software Product Description ___________________________________________________________________ PRODUCT NAME: KAP[TM] Fortran Version 3.2 SPD 38.50.07 for OpenVMS DESCRIPTION KAP[TM] Fortran Version 3.2 for OpenVMS[R] from Compaq is developed by Kuck & Associates, Incorporated (KAI), and is distributed under the Standard Terms and Conditions from Compaq Computer Corporation. The KAP Fortran optimizer is a FORTRAN-language, source-to-source pre- processor that restructures code for improved performance on serial and parallel processors. The KAP optimizer performs an interprocedu- ral dependence analysis (IPA), allowing it to use advanced optimiza- tions safely. When installed, the KAP optimizer integrates with the Compaq Fortran compiler for seamless operation. Major capabilities of the KAP Fortran optimizer include: o Automatic and directed parallel decomposition for SMP o Loop optimizations o Memory management optimizations o Scalar optimizations o Function inlining o BLAS recognition o "Dusty Deck" transformations o Informational program listings Parallel Decomposition Support April 1999 The KAP Fortran product provides true shared memory multiprocessing capabilities for AlphaServer Symmetric Multiprocessing (SMP) systems from Compaq, providing the ability to do automatic, guided automatic and directed parallel decomposition of Fortran codes. When performing automatic parallel decomposition, the KAP Fortran op- timizer will: 1. Analyze the code; 2. Identify the compute intensive loops that are candidates for par- allelization; 3. Determine if the selected loops can be safely executed in paral- lel; 4. Transform the code, creating and managing the parallel threads; 5. Insert all necessary synchronization points. Because a primary objective of the automatic parallel decomposition is to produce a correct parallel program, the KAP optimizer will skip loops that cannot be properly analyzed, whether due to lack of infor- mation at compile time or to complex program structure. The advanced programmer can often improve parallel efficiency by guiding KAP in per- forming automatic parallel decomposition, supplying missing informa- tion through the use of directives, assertions, and command-line op- tions. When performing directed decomposition, the KAP optimizer accepts a subset of the ANSI X3H5 parallel directives. Directed decomposition requires the programmer to identify parallel regions and loops and man- age all necessary synchronization. KAP scalar optimizations are dis- abled within parallel regions. It is possible to combine both directed and automatic decomposition within one program by defining specific parallel regions with directives, and then using the concurrent op- tion when compiling to automatically parallelize the remaining regions. Parallel Run-Time Environment 2 The KAP optimizers from Compaq for Fortran and C all share a common run-time environment based on DECthreads. Programs may be composed of modules written in one or more of the three languages, and may be par- allelized by use of the appropriate KAP optimizers. A program processed with a KAP optimizer may be given one or more of the following options at run time by setting environment variables: o Set number of threads to use (normally set to number of processors) o Schedule for fastest turnaround or maximum throughput o Allocate additional thread stack Loop Optimizations The KAP Fortran optimizers provide a variety of loop transformations intended to improve execution performance. These include: o Inner loop unrolling o Loop interchange o Loop fusion o Loop splitting o Loop rerolling o Loop distribution o Loop peeling Memory Management Optimizations The KAP Fortran optimizers perform several optimizations that conserve memory resources and improve data locality. These include: o Outer loop (two-dimensional) unrolling to block data for the cache o COMMON block padding o COMMON block alignment 3 o Storage order specification Function and Subroutine Inlining The KAP Fortran optimizers can selectively insert both function and subroutine code into the main code stream, a capability referred to as "inlining." Inlining a function allows the KAP optimizer to include the function code in its IPA, resulting in a more thorough analysis and optimization. Inlining also eliminates the call overhead and may enable better code scheduling by the compiler. In addition to inlining, the KAP Fortran optimizers can perform only the IPA operation on a function or subroutine. When this option is se- lected, the function or subroutine is temporarily inlined while IPA is performed, and then is removed. The IPA analysis option provides the benefit of an improved interprocedural analysis without the code size expansion that results from inlining. The source of function and subroutine code for inlining or IPA can be a specific set of files, or a special inline library that is built and maintained by the KAP optimizer. BLAS Recognition The KAP Fortran optimizers can recognize common linear algebra algo- rithms and substitute function calls to the industry-standard Basic Linear Algebra Subroutines (BLAS). The program can then be linked against a library containing an optimized version of the BLAS, such as the Dig- ital Extended Math Library. The KAP optimizers recognize most Level 1, 2, and 3 BLAS. Scalar Optimizations The KAP Fortran optimizers perform many standard scalar compiler op- timizations, including: o Dead code elimination o Induction variable recognition o Invariant IF restructuring o Reciprocal substitution 4 o Global forward substitution o Lifetime analysis "Dusty Deck" Transformations The KAP Fortran optimizers transform many obsolete and inefficient code structures into more modern structures. These older constructs often inhibit compiler optimizations and interfere with code scheduling. The KAP optimizers perform the following transformations: o Convert logical IF-GOTO to block IF. o Convert IF branches to DO loop. o Convert adjacent IFs to IF-THEN-ELSE. o Remove zero-trip IFs from around DO loops. Informational Program Listings The KAP Fortran optimizers optionally provide an informational list- ing file of the program, outlining the results of its processing. The content of the listing file may be controlled through an option switch. Content options include: o Annotated original program listing o Call tree of entire program o KAP options used for each program unit o Loop optimization table for each program unit o Program unit names inserted in error output as they are processed o Compilation performance statistics o Loop summary table o Transformed program listing In each program listing produced, the following information is sup- plied, if relevant: o Line numbers 5 o DO loop markings o INCLUDE file markings o Footnotes detailing important actions taken or conditions that may require attention, such as data dependences that inhibit par- allel decomposition o Syntax Error or Warning messages o Questions generated by the KAP optimizer o Summary of actions taken by the KAP optimizer Control of KAP Options The KAP Fortran products are provided with a set of default option set- tings. While the default settings make the KAP products easier to use, they may not provide optimal performance for every program. And be- cause some transformations change the order of computation, some nu- merical differences in results may occur in sensitive programs. The KAP Fortran products provide a large set of command qualifiers and in- source directives and assertions that allow the advanced user to cus- tomize the applied transformations for a particular application pro- gram. For cases where the application is sensitive to accumulated round- ing error, the optimization level may need to be reduced. Consult the product documentation for advice on using the many options provided. Supported Language Dialects The KAP Fortran product supports the ANSI Fortran standard syntax. In addition, KAP accepts Compaq Fortran extensions to ANSI Fortran, with the following known exceptions: o I/O statement UNLOCK o Use of quotation mark character (") as delimiter for character con- stants o Compilation control statements OPTIONS and DICTIONARY Run-Time Library Distribution 6 The KAP Fortran product kits include one or more Run-Time Libraries that are needed to support the execution of certain KAP functions. You may copy and distribute royalty-free the Run-Time Libraries ("RTLs") with your application, provided that you: o Distribute the RTLs only in conjunction with and as a part of your application. o Include KAI's copyright notice on each copy of the application soft- ware media. o Do not use the name, logo, or trademarks from Compaq or KAI to mar- ket your application. o Agree to indemnify, hold harmless, and defend both Compaq and KAI from and against any claims or lawsuits, including attorney's fees, that arise or result from the use or distribution of your appli- cation. For OpenVMS Alpha systems, the parallel library is designated as KMP.OLB. HARDWARE REQUIREMENTS The KAP Fortran Preprocessor from Compaq will operate on any AlphaS- tation or AlphaServer capable of running OpenVMS. Table 1 lists the disk space requirements. ___________________________________________________________________ Table_1:_Disk_Space_Requirements_(block_Cluster_size_=_1)__________ TASK________SIZE___________________________________________________ Installation24,000 blocks (12 MB) Permanent:__24,000_blocks_(12_MB)__________________________________ These counts refer to the disk space required on the system disk. The sizes are approximate; actual sizes may vary depending on the user's system environment, configuration, and software options. Parallel Processing Hardware Requirements: 7 Multiprocessor Alpha systems are required for proper operation of par- allel loops. However, an application compiled using KAP's parallel de- composition option will run on single-processor systems for compata- bility purposes, but may run slower than the serial version compiled without the option. SOFTWARE REQUIREMENTS For systems using terminals (no DECwindows interface): o OpenVMS Alpha Operating System V7.2 o Compaq Fortran for OpenVMS Alpha V7.2 For workstations running DECwindows: o OpenVMS Alpha Operating System V7.2 o Compaq Fortran for OpenVMS Alpha V7.2 For Workstations Running DECwindows using Motif[R]: o OpenVMS Alpha Operating System V7.2 o DECwindows Motif V1.2 for OpenVMS Alpha o Compaq Fortran for OpenVMS Alpha V7.2 Note that Versions 7.0-7.2 of Compaq Fortran contain both Fortran 77 and Fortran 90 compilers. KAP Fortran uses the Compaq Fortran 90 com- piler. Fortran 77 code can still be processed; however, the KAP out- put may include Fortran 90 constructs that the Fortran 77 compiler can- not handle. Note that KAP Fortran does not perform transformations on program units that contain DICTIONARY statements accessing data structures declared using the CDD/Repository product. OpenVMS Tailoring 8 The following OpenVMS classes are required for full functionality of this layered product: o OpenVMS Required Saveset o Programming support o Utilities OPTIONAL SOFTWARE o Digital Extended Math Library V2.9 for OpenVMS Alpha SOFTWARE LICENSING This software is furnished only under a license. Traditional licenses are available. For more information about licensing terms and poli- cies from Compaq, contact your local Compaq office or Compaq partner. License Management Facility Support This layered product supports the OpenVMS License Management Facil- ity. License units for this product are allocated on an Unlimited System Use basis. For more information on the OpenVMS License Management Facility, re- fer to the OpenVMS Operating System Software Product Description or documentation. GROWTH CONSIDERATIONS The minimum hardware and software requirements for any future version of this product may be different from the requirements for the cur- rent version. 9 DISTRIBUTION MEDIA These products are distributed on the Compaq CD-ROM Software Library for OpenVMS, and are also available as an individual product CD-ROM. The software documentation for this product is available as part of the Compaq OpenVMS Online Documentation Library on CD-ROM (QA-0HAAA- H8). A separate printed documentation set may also be ordered. YEAR 2000 READY This product is Year 2000 Ready. Year 2000 Ready is defined: "Year 2000 Ready" products are defined by Compaq as products capable of accurately processing, providing, and /or receiving date data from, into and between the twentieth and the twenty-first centuries, and the years 1999 and 2000, including leap year calculations, when used in accordance with the associated prod- uct documentation and provided that all hardware, firmware, and soft- ware used in combination with such products properly exchange accu- rate date data with the products. For additional information visit the DIGITAL Brand area on Compaq's Year 2000 Ready web site located at http://www.compaq.com/year2000/warranties3.html. SOFTWARE WARRANTY This software is provided by Compaq with a 90 day conformance warranty in accordance with the Compaq warranty terms applicable to the license purchase. 10 ORDERING INFORMATION KAP Fortran: Unlimited Use Software Licenses: QL-0HAA*-** Software Media/Documentation: QA-0HAAA-H8 Software Documentation: QA-0HAAA-GZ Software Product Services: QT-0HAA*-** * Denotes variant fields. For additional information on available li- censes, services, and media, refer to the appropriate price book. SOFTWARE PRODUCT SERVICES A variety of service options are available from Compaq. For more in- formation, contact your local Compaq office or Compaq partner. The above information is valid at time of release. Please contact your local Compaq office or Compaq partner for the most up-to-date infor- mation. TRADEMARK INFORMATION COMPAQ and the Compaq logo are registered in the U.S. Patent and Trade- mark Office. DECthreads and OpenVMS are trademarks of Compaq Computer Corporation. Motif is a registered trademark of Open Software Foundation, Inc. ©1999 Digital Equipment Corporation. All Rights Reserved. 11