Coding for Performance

Brandon Barker, Steve Lantz
Cornell Center for Advanced Computing

Revisions: 8/2023, 2/2019, 7/2015, 10/2014 (original)

In this topic, we introduce the reader to certain steps that one might take to enhance an application's performance as it progresses through the different stages of software development, from a conceptual model to a runnable program. We focus on the middle stages in which the high-level code is being written and compiled, identifying some broad considerations that should help the ultimate application to run well. These coding strategies are contrasted with the in-depth performance tuning that may be applied later.

Objectives

After you complete this topic, you should be able to:

  • Explain the importance of learning code optimization as a developer
  • List different stages of the scientific application building process and possible ways of improving performance during that stage
  • Describe the concept of rough tuning
  • List the steps involved in in-depth tuning
Prerequisites

The Code Optimization roadmap assumes only that the reader has some basic familiarity with programming in any language. The HPC languages C and Fortran are used in examples. Necessary concepts are introduced as one progresses through the roadmap.

In parallel programming, the key consideration for optimizing large-scale parallel performance is the scalability of a code's algorithm(s). Therefore, readers who are developing parallel applications may want to peruse the roadmap for Scalability first.

More advanced references on performance optimization include the Virtual Workshop roadmaps on Profiling and Debugging and Vectorization. For those interested in programming for advanced HPC architectures, such as TACC's clusters built with Intel processors, the roadmap Case Study: Profiling and Optimization on Advanced Cluster Architectures is relevant. The present roadmap should make a good starting point for diving into any of those.

 
©   Cornell University  |  Center for Advanced Computing  |  Copyright Statement  |  Inclusivity Statement