DIGITAL Software Product Description ___________________________________________________________________ PRODUCT NAME: KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® DESCRIPTION KAP[TM] for Digital Fortran for OpenVMS® from DIGITAL is developed by Kuck and Associates, Incorporated (KAI), and is distributed under the Standard Terms and Conditions from Digital Equipment 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 Digital Fortran compiler for seamless operation. Major capabilities of the KAP Fortran optimizer includes: 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 1997 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® The KAP Fortran product provides true shared memory multiprocessing capabilities for AlphaServer Symmetric Multiprocessing (SMP) systems from DIGITAL, 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 parallelization; 3. determine if the selected loops can be safely executed in parallel; 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 performing automatic parallel decomposition, supplying missing information through the use of directives, assertions, and command line options. 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 manage all necessary synchronization. KAP scalar optimizations are disabled 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 option when compiling to automatically parallelize the remaining regions. 2 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® Parallel Run Time Environment The KAP optimizers from DIGITAL for Fortran 77, and C all share a com- mon run time environment based on DECthreads. Programs may be composed of modules written in one or more of the three languages, and may be parallelized by use of the appropriate KAP optimizers. A program processed with a DIGITAL KAP optimizer may be given one or more of the following options at run time by setting environment vari- ables: 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 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® 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 Digital 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 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® 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 supplied, if relevant: o Line numbers 5 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® 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 parallel decomposition o Syntax Error/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 settings. While the default settings make the KAP products easier to use, they may not provide optimal performance for every program. And since some transformations change the order of computation, some numerical 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 customize the applied transformations for a particular application program. For cases where the application is sensitive to accumulated rounding 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 77 standard syntax. In addition, KAP accepts Digital Fortran extensions to ANSI Fortran 77, 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 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® 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 (the "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 software media; o do not use the name, logo, or trademarks from DIGITAL or KAI to market your application; o agree to indemnify, hold harmless, and defend both DIGITAL 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: o KMP.OLB HARDWARE REQUIREMENTS The KAP Fortran Preprocessor from DIGITAL will operate on any AlphaS- tation or AlphaServer capable of running OpenVMS. ___________________________________________________________________ Table_1:__Disk_Space_Requirements_(block_Cluster_size_=_1)_________ TASK________SIZE___________________________________________________ Installation18,000 blocks (9 MB) Permanent:__18,000_blocks_(9_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 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® 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.1 o Digital Fortran for OpenVMS Alpha V6.0 For Workstations Running DECwindows: o OpenVMS Alpha Operating System V7.1 o Digital Fortran for OpenVMS Alpha V6.0 For Workstations Running DECwindows Using Motif[R]: o OpenVMS Alpha Operating System V7.1 o DECwindows Motif V1.2 for OpenVMS Alpha o Digital Fortran for OpenVMS Alpha V6.0 Note: Versions 7.0-7.1 of Digital Fortran contain both Fortran 77 and Fortran 90 compilers. KAP for DEC Fortran uses the Digital Fortran 77 compiler. Note: KAP for DEC Fortran does not perform transformations on program units that contain DICTIONARY statements accessing data structures de- clared using the CDD/Repository product. OpenVMS Tailoring The following OpenVMS classes are required for full functionality of this layered product: o OpenVMS Required Saveset 8 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® o Programming support o Utilities OPTIONAL SOFTWARE o Digital Extended Math Library V2.9 for OpenVMS Alpha GROWTH CONSIDERATIONS The minimum hardware/software requirements for any future version of this product may be different from the requirements for the current version. DISTRIBUTION MEDIA These products are distributed on the DIGITAL CD-ROM Software Library for OpenVMS, and are also available as an individual product CD-ROM. The software documentation for these products is available as part of the Digital OpenVMS Online Documentation Library on CD-ROM (QA-0HAAA- H8). A separate printed documentation set may also be ordered. ORDERING INFORMATION KAP For Digital 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. 9 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® SOFTWARE LICENSING This software is furnished only under a license. Traditional licenses are available. For more information about licensing terms and poli- cies from DIGITAL, contact your local DIGITAL office or DIGITAL part- ner. 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, refer to the OpenVMS Operating System Software Product Description or documentation. SOFTWARE PRODUCT SERVICES A variety of service options are available from DIGITAL. For more information, contact your local DIGITAL office or DIGITAL partner. SOFTWARE WARRANTY Warranty for this software product is provided by DIGITAL with the purchase of a license for the product as defined in the Software Warranty Addendum of this SPD. The above information is valid at time of release. Please contact your local DIGITAL office or DIGITAL partner for the most up-to-date in- formation. ® OpenVMS is a registered trademark in the United States and other countries [TM] KAP is a trademark of Kuck and Associates, Inc. 10 KAP[TM] for Digital Fortran SPD 38.50.05 for OpenVMS® [TM] The DIGITAL Logo, DEC, DECthreads, Digital Fortran, and DIGITAL are trademarks of Digital Equipment Corporation. ©1997 Digital Equipment Corporation. All Rights Reserved. 11