ABSTRACT

This chapter discusses steps needed to create shared memory parallel programs. It focuses on identifying parallel tasks by analyzing the code or algorithm, how to determine the scope of variables, coordinate the parallel tasks, and express parallelism to the compiler. The chapter helps the readers to learn basic shared memory parallel programming techniques. Dependence analysis identifies parallelism at the code-level using only information embedded in the source code. Dependence analysis is useful not just for shared memory parallel programming which is the focus in this chapter, but also message passing parallel programming. A variable that is read-only should be declared as shared to avoid storage overheads that may reduce performance. The program is still correct if a read-only variable is declared as private and is initialized to a correct value.