Part III. High Performance Programming

Table of Contents

13. Computer Hardware
13.. Why Learn about Hardware?
13.. Central Processing Unit
13.. Non-volatile Auxiliary Storage: Disk, Tape and Flash
13.. Electronic Memory
13.. Computer Word Size
13.. Practice
14. Software Development
14.. Goals of a Top-notch Scientific Software Developer
14.. You are the Cause of your own Suffering
14.. Language Levels
14.. Language Selection
14.. Compiled vs Interpreted Languages
14.. Common Compiled Languages
14.. Common Interpreted Languages
14.. Engineering Product Life Cycle
15. Data Representation
15.. What Everyone Should Know About Data Representation
15.. Representing Information
15.. Numeric Limitations of Computers
15.. Fixed Point Number Systems
15.. Modular Number Systems
15.. Binary Data Representation
15.. Metric and Binary Quantities
15.. The Arabic Numeral System
15.. Number Bases
15.. Binary Fixed Point
15.. Binary/Octal/Hexadecimal Conversions
15.. Unsigned Binary Integers
15.. Signed Integers
15.. Sign-Magnitude
15.. One's complement
15.. Two's Complement
15.. Biased Notation
15.. Hex and Octal with Signed Numbers
15.. Floating Point
15.. Character Storage
16. Introduction to High-Performance Programming
16.. Introduction
16.. C Program Structure
16.. Fortran Program Structure
16.. The Compilation Process
16.. Comments
16.. Strings
16.. The C Preprocessor
16.. The Basics of Variable Definitions
16.. Program Statements
16.. Fortran Modules
16.. C Standard Libraries and Fortran Intrinsic Functions
16.. Code Quality
16.. Performance
17. Data Types
17.. Choosing a Data Type
17.. Standard C Types
17.. Standard Fortran Types
17.. Variable Definitions and Declarations
17.. Constants
17.. Math Operators and Expressions
17.. Mixing Data Types
17.. Code Quality
17.. Performance
18. Basic Terminal Input/Output (I/O)
18.. C Terminal Input/Output (I/O)
18.. Fortran Terminal Input/Output (I/O)
18.. Using Standard Error
19. Conditional Execution
19.. Motivation
19.. Design vs. Implementation
19.. Boolean Expressions
19.. If Statements
19.. Switch, Select-Case
19.. Code Quality
19.. Performance
19.. Practice Break Solutions
19.. Code Examples
20. Loops (Iterative Execution)
20.. Motivation
20.. Design vs. Implementation
20.. Anatomy of a Loop
20.. While: The Universal Loop
20.. Fortran Fixed Do Loops
20.. The C for Loop
20.. Unstructured Loops
20.. The C do-while Loop
20.. Fortran cycle and C continue
20.. Infinite Loops
20.. Loops and Round-off Error
20.. Nested Loops
20.. Real Examples
20.. Code Quality
20.. Performance
20.. Solutions to Practice Breaks
21. Subprograms
21.. Motivation
21.. Modular Design
21.. Subprogram Implementation
21.. Fortran Subprograms
21.. Internal vs External Subprograms
21.. Defining Your Own Fortran Functions
21.. Defining Your Own Subroutines
21.. C Subprograms
21.. Scope
21.. Scope
21.. Storage Class
21.. Argument Variables
21.. Top-down Programming and Stubs
21.. C Preprocessor Macros
21.. Recursion
21.. Creating your own Libraries
21.. Self-test
22. Building with Make
22.. Overview
22.. Building a Program
22.. Make Variables
22.. Phony Targets
22.. Building Libraries
22.. Mixing Tool Chains
22.. Mixing C, C++, and Fortran: A Brief Overview
22.. Makefile Generators
23. Memory Addresses and Pointers
24. Arrays
24.. Motivation
24.. Design vs. Implementation
24.. Array Basics
24.. Dynamic Memory Allocation
24.. Array Constants
24.. Static Array Initialization
24.. Arrays as Arguments
24.. Allocate and Subprograms
24.. Sorting
24.. When to Use Arrays
24.. Array Pitfalls
24.. Fortran 90 Vector Operations
24.. Code Quality
24.. The Memory Hierarchy
24.. Performance
24.. Self-test
25. Strings
25.. Motivation
25.. Defining String Variables
25.. String Constants
25.. Truncation and Padding
25.. Common String Operations
25.. Strings as Subprogram Arguments
25.. Command-line Arguments
25.. Code Quality
25.. Performance
25.. Self-test
26. File I/O
26.. Motivation
26.. Filesystem Structure
26.. C File Streams
26.. C Low-level I/O
26.. Fortran File Operations
26.. File Format Standards
26.. Code Quality
26.. Performance
26.. Self-test
27. Matrices
27.. Motivation
27.. Multidimensional Arrays
27.. Reading and Writing Matrices
27.. Importance of Traversal Order
27.. Multidimensional Arrays as Arguments
27.. Fortran Intrinsic Functions
27.. Homework
28. Software Performance
28.. Motivation
28.. Performance Factors
28.. Analysis of Algorithms
28.. Language Selection
28.. Implementation Factors
28.. Hardware Speed
28.. Performance Measurement
28.. Homework
29. Structures
29.. Motivation
29.. C Structures
29.. Fortran Structures
29.. Classes and Object-oriented Programming (OOP)
29.. Homework
30. Object Oriented Programming
31. The Preprocessor
31.. Defined Constants
31.. Conditional Compilation
31.. Homework
32. Software Project Management
32.. Build Systems
32.. Software Deployment
32.. Version Control Systems
32.. Source Code Hosting
32.. Don't Invent your own Package Manager
32.. Follow the Filesystem Hierarchy Standard
32.. Package-friendly Software