DIGITAL Software Product Description ___________________________________________________________________ PRODUCT NAME: KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] 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 C product sup- ports only the DEC C compiler (cc -migrate) on Digital UNIX systems. 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. When installed, the KAP optimizer integrates with Dig- ital's C compiler for seamless operation. Major capabilities of Dig- ital'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 January 1997 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] The KAP products provide true shared memory multiprocessing capabil- ities for Digital's AlphaServer Symmetric Multiprocessing (SMP) sys- tems, providing the ability to do automatic and guided automatic de- composition of Fortran codes. 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; 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. The advanced programmer can often improve parallel efficiency by guiding the KAP optimizer in performing automatic parallel decom- position, supplying missing information through the use of directives, assertions, and command line options. 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 2 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] o Allocate additional thread stack 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 o Loop splitting o Loop rerolling o Loop distribution o Loop peeling 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 the cache o Natural data alignment Function Inlining The KAP optimizer can selectively insert both function and subroutine code into the main code stream, a capability referred to as "inlin- ing". 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 optimizer can perform only the IPA operation 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 3 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] 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 The KAP optimizer can perform many standard scalar compiler optimiza- tions, including: o Dead code elimination o Induction variable recognition o Invariant IF restructuring o Reciprocal substitution o Global forward substitution 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 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, summarizing number of loops transformed o Transformed program listing Control of KAP Options 4 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] 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 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 Digital UNIX V3.2C-V3.2G, the RTL images are designated as: o libkmp_osf.a o libkio.a For Digital UNIX V4.0-V4.0B, the RTL images are designated as: o libkmp_osfp10.a 5 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] o libkio.a HARDWARE REQUIREMENTS KAP for C V3.1 for Digital UNIX will operate on any AlphaStation or AlphaServer capable of running Digital UNIX. Disk Space Requirements Disk space required for installation: Root file system: / 0 KB Other file systems: /usr 9,000 KB /tmp 3 KB /var 0 KB Disk space required for use (permanent): Root file system: / 0 KB Other file systems: /usr 9,000 KB /var 0 KB 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 For Digital UNIX Systems: o Digital UNIX Operating System, V3.2C-V3.2G or V4.0-V4.0B o Digital UNIX C Developers' Extensions V3.2C-V3.2G (SPD 44.36), if using Digital UNIX V3.2C-V3.2G o Developer's Toolkit for Digital UNIX V4.0-V4.0B (SPD 44.36), if us- ing Digital UNIX V4.0-V4.0B 6 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] Note: When KAP for C V3.1 is installed on Digital UNIX V4.0-V4.0B, the executable images produced will execute only on versions 4.0-V4.0B of Digital UNIX. When KAP for C V3.1 is installed on Digital UNIX V3.2C- V3.2G, the executable images produced will execute on versions V3.2C- V3.2G and will also execute on versions V4.0-V4.0B of Digital UNIX, although a small performance difference may be experienced. This for- ward compatibility to V4.0 and later versions is dependent on support in Digital UNIX that will be deleted in the next major release of Dig- ital UNIX. See the Digital UNIX Software Product Description (SPD 41.61) for details and limitations. 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 on the Digital CD-ROM Software Library for Digital UNIX and is also available as an individual product CD-ROM. The software documentation for this product is available as part of the Digital UNIX Online Documentation Library on CD-ROM (QA-054AA-H8), and is also available as a printed documentation set. ORDERING INFORMATION Unlimited Use Software Licenses: QL-0HHA*-AA Concurrent Use Software License: QL-0HHAM-3B Software Media/Documentation: QA-0HHAA-H8 Software Documentation: QA-0HHAA-GZ Software Product Services: QT-0HHA*-** * Denotes variant fields. For additional information on available li- censes, services, and media, refer to the appropriate price book. 7 KAP[TM] for C Version 3.1 SPD 45.73.06 for Digital UNIX[R] SOFTWARE LICENSING This software is furnished only under a license. For more information about Digital's licensing terms and policies, contact your local Dig- ital office or Digital partner. License Management Facility Support This layered product supports the Digital UNIX License Management Fa- cility. License units for this product are allocated on an Unlimited System Use basis. For more information on the Digital UNIX License Management Facility, refer to the Digital UNIX Operating System Software Product Descrip- tion (SPD 41.61.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. 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 War- ranty 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. [R] UNIX is a registered trademark in the United States and other countries licensed exclusively through X/Open Company Limited [TM] KAP is a trademark of Kuck and Associates, Inc. [TM] The DIGITAL Logo, DEC, Digital, and DECthreads are trademarks of Digital Equipment Corporation. ©1997 Digital Equipment Corporation. All Rights Reserved. 8