Chapter 4. Optimization, Porting, and Tuning Tools and Documentation

Several different books document how to port code from older versions of compilers to newer versions, how to tune programs for best use, and how to optimize code for use on different hardware systems. The books discussed in this chapter focus primarily on those topics.

In addition to the books discussed in this chapter, the books for each compiling system also contain information about optimization and tuning. You may wish to check those books first for information that is specific to your compiling system before checking the books mentioned here, which are more general in nature.

Optimization and tuning are terms that are often used interchangeably. As used in this document, both terms mean a focus on exploiting the features of hardware and software to extract the best performance from the system and the code.

The topic of porting code from older systems is often combined with information about how to fine-tune that code for the newer systems. Thus, “porting and tuning” guides often also discuss some optimization topics in the course of discussing tuning.

All documentation mentioned in this chapter is available online or can be ordered. See the SGI Technical Publications Library at for details.

Optimization Guides

The following books discusses optimization topics in detail (but do not discuss porting code in any detail):

  • The Origin 2000 and Onyx2 Performance Tuning and Optimization Guide describes tuning and optimization in the context of specific hardware architectures; it includes the following topics:

    • Details about the SNO hardware architecture

    • SNO memory management

    • Tuning for a single process

    • Using basic compiler optimizations

    • Optimizing cache utilization

    • Tuning for parallel processing

  • The Application Programmer's I/O Guide discusses features that can affect I/O in your Fortran program; it includes the following topics:

    • Fortran I/O extensions provided by SGI

    • The assign environment

    • File structures

    • Using FFIO (Flexible File I/O)

    • I/O optimizaton

Porting and Tuning Guides

The following books focus on porting code from older systems and also focus on tuning issues for that code:

  • MIPSpro N32/64 Compiling and Performance Tuning Guide (formerly entitled MIPSpro Compiling, Debugging, and Performance Tuning Guide) describes the components of the MIPSpro compiling systems and includes the following topics:

    • How to use dynamic shared objects (DSOs)

    • How to use interprocedural analysis (IPA) and loop nest optimization (LNO) for optimization

    • How to code 64-bit programs

    • How to port code from the older (ucode) 32-bit mode to the N32 and 64-bit modes

  • The MIPSpro N32 ABI Handbook describes the 32-bit Application Binary Interface (ABI) and includes the following topics:

    • ABI overview

    • Calling convention implementations

    • N32 compatibility

    • Porting issues

    • Assembly language programming issues

  • The MIPS O32 Compiling and Performance Tuning Guide describes how to use tools to optimize older O32 code; it includes the following topics:

    • How to use dynamic shared objects (DSOs)

    • How to use performance tools for profiling and PC sampling

    • How to optimize performance with object libraries and compiler options