DESCRIPTION DIGITAL'S KAP [TM] for C product is developed by Kuck and Associates, Incorporated (KAI), and is distributed under Digital Equipment Cor- poration's Standard Terms and Conditions. The KAP for DEC C product supports the DEC C compiler on OpenVMS Alpha systems only. DIGITAL'S KAP for C optimizer is a C-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. It integrates with DIGITAL's C compiler for seamless op- eration. Major capabilities of DIGITAL'S KAP optimizer include: o Automatic parallel decomposition for SMP o Loop optimizations o Memory management optimizations o Scalar optimizations o Function inlining o Informational program listings Parallel Decomposition Support The KAP product provides true shared memory multiprocessing capabil- ities for DIGITAL'S AlphaServer Symmetric Multiprocessing (SMP) sys- tems, providing the ability to do automatic decomposition of C. When performing automatic parallel decomposition, the KAP optimizer 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 April 1997 5. insert all necessary synchronization points Because a primary objective of the automatic parallel decomposition facility is to produce a correct parallel program, the KAP optimizer must often pass up opportunities to parallelize loops that cannot be properly analyzed due to lack of information or complex program struc- ture. Parallel Run Time Environment DIGITAL's KAP optimizers for C, Fortran 77, and Fortran 90 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 parallelized by use of the appropriate KAP optimizers. A program parallelized with DIGITAL's 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 space Loop Optimizations The KAP optimizer provides a variety of loop transformations intended to improve execution performance. These include: o Inner loop unrolling o Loop interchange o Loop fusion/splitting o Loop rerolling o Loop distribution o Loop peeling 2 Memory Management Optimizations The KAP optimizer provides several optimizations to conserve memory resources and improve data locality. These include: o Outer loop (two-dimensional) unrolling to block data for improved cache performance o Natural data alignment Function Inlining The KAP optimizer can selectively insert both function and subroutine code into the main code stream, a capability known as "inlining". In- lining a function allows the KAP optimizer to include the function code in its IPA, resulting in a more thorough analysis and optimiza- tion. Inlining also eliminates the function call overhead and may enable better code scheduling by the compiler. In addition to inlining, the KAP optimizer can perform selective IPA operations on a function or subroutine. When this option is selected, the function or subroutine is temporarily inlined while IPA is per- formed, and then is removed. The IPA 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 in- line library file that is built and maintained by the KAP optimizer. Scalar Optimizations KAP can perform many standard scalar compiler optimizations, includ- ing: o Dead code elimination o Induction variable recognition o Invariant IF restructuring o Reciprocal substitution o Global forward substitution 3 o Lifetime analysis Informational Program Listings The KAP optimizer optionally provides an informational listing file, outlining the results of its processing. The content of the listing file may be controlled through an option switch. Content options in- clude: o Call tree of entire program o KAP options used for each program unit o Loop 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, summarizing number of loops transformed o Transformed program listing Control of KAP Options The KAP optimizer is provided with a set of default option settings. While the default settings make the optimizer easier to use, they may not provide optimal performance for every program. And, since some of the transformations change the order of computation, some numerical differences in results may occur in sensitive programs. The KAP op- timizer provides a large set of command qualifiers and in-source di- rectives and assertions that allow the advanced user to customize KAP transformations for a particular application program. For cases where the application is sensitive to accumulated rounding error, the op- timization level may need to be reduced. Consult the user documenta- tion for advice on using the many options provided. Run-Time Library Distribution 4 The KAP for C kit includes 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; o do not use DIGITAL's or KAI's name, logo, or trademarks 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 DEC C V5.5, the KAP C I/O library is designated as KIO.OLB. The parallel library is designated as KMP.OLB. HARDWARE REQUIREMENTS Processors Supported: The KAP C optimizer will operate on any AlphaStation or AlphaServer capable of running OpenVMS Alpha Version 7.1. Disk Space Requirements (Block Cluster Size = 1): Disk space required for 16,000 blocks installation: (8MB) Disk space required for 16,000 blocks use (permanent): (8MB) 5 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. SOFTWARE REQUIREMENTS o OpenVMS Alpha Operating System V7.1 o DEC C V5.5 for OpenVMS Alpha Systems OpenVMS Tailoring: For OpenVMS systems, the following OpenVMS classes are required for full functionality of this layered product: o OpenVMS Required Saveset o Programming Support o Utilities 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 This product is distributed only on the Digital CD-ROM Software Li- brary for OpenVMS Alpha (QA-03XAA-H8). The software documentation for this product is also available as part of the OpenVMS Online Documentation Library on CD-ROM, and is also available as a printed documentation set. 6 ORDERING INFORMATION Unlimited Use Software Licenses: QL-0HFA*-** Concurrent Use Software Licenses: QL-0HFA*-3B Software Media/ Documentation: QA-0HFAA-H8 Software Documentation: QA-0HFA*-GZ Software Product Services: QT-0HFA*-** * Denotes variant fields. For additional information on available li- censes, services, and media, refer to the appropriate price book. SOFTWARE LICENSING This software is furnished only under a license. Traditional licenses are available. For more information about DIGITAL's licensing terms and policies, contact your local DIGITAL office or DIGITAL 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 appropriate OpenVMS Operating System Software Product De- scription (SPD 25.01.xx) or documentation. SOFTWARE PRODUCT SERVICES A variety of service options are available from DIGITAL. For more in- formation, contact your local DIGITAL office or DIGITAL partner. 7 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. [TM] KAP is a trademark of Kuck and Associates, Incorporated, Champaign, IL. [TM] The DIGITAL Logo, DEC, DIGITAL, DECthreads, Alpha, are trade- marks of Digital Equipment Corporation. ©1997 Digital Equipment Corporation. All Rights Reserved. 8