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 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