Introduction Evaluation Memory-Bound Code I/O Bound Code CPU-Bound Code

Optimizing Code on Cray PVP Systems

Abstract

This guide provides information about techniques you can use to optimize Fortran, C, or C++ code on Cray Research parallel vector processing (PVP) systems. This is a task-oriented guide for programmers with working knowledge of either the UNICOS or UNIX operating system and experience in working with CF90, Cray C++, or Cray Standard C compilers.

This guide contains material copyrighted by Cray Research, Inc. and is reproduced here as permitted by contract with Cray Research, Inc.

About This Course

This guide describes an optimization process for a single CPUs in Cray PVP systems. After you optimize the code for single-CPU performance, you might find that the code will benefit from multiple-CPU execution.

The following information is provided in this course:

Introduction

Optimization is the process of changing a program or the environment in which it runs to improve its performance. Performance gains generally fall into one of two categories of measured time:
user CPU time:
Time accumulated by a user process when it is attached to a CPU and executing. When running on a single CPU, CPU time is a fraction of elapsed time. When multitasked, CPU time is a multiple of elapsed time.
Elapsed (wall-clock) time:
The amount of time that passes between the start and termination of a user process. Elapsed time includes user CPU time, UNICOS system CPU time, I/O wait time, and sleep or idle time.

During the optimization process you will need to execute your code repeatedly to assess performance and measure performance gain. To save execution time, we encourage you to work with smaller, sample data sets that exercise all of the code within your program. The code should run at least 30 seconds to give performance tools adequate time to measure performance.

Each area of optimization involves a three-step method, which includes the following general steps:

  1. Identify a problem.
  2. Evaluate the problem.
  3. Apply a technique.

Check your answers after each code modification to avoid regression, then compare the new performance against the initial performance to decide where to proceed. If you want to continue optimizing for single-CPU performance, return to the initial analysis.

Next | Section 1: Evaluating code to determine where to focus optimization efforts.


Contact webmaster@asc.edu with questions or comments regarding this page.
Last updated Sept. 30, 1999 -- (c)1999 Alabama Supercomputer Authority