Part III. High Performance Programming

Table of Contents

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