10.07.2015 Views

Is Parallel Programming Hard, And, If So, What Can You Do About It?

Is Parallel Programming Hard, And, If So, What Can You Do About It?

Is Parallel Programming Hard, And, If So, What Can You Do About It?

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents1 Introduction 11.1 Historic <strong>Parallel</strong> <strong>Programming</strong> Difficulties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 <strong>Parallel</strong> <strong>Programming</strong> Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2.2 Productivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2.3 Generality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Alternatives to <strong>Parallel</strong> <strong>Programming</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3.1 Multiple Instances of a Sequential Application . . . . . . . . . . . . . . . . . . . . . . 61.3.2 Make Use of Existing <strong>Parallel</strong> <strong>So</strong>ftware . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3.3 Performance Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.4 <strong>What</strong> Makes <strong>Parallel</strong> <strong>Programming</strong> <strong>Hard</strong>? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4.1 Work Partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4.2 <strong>Parallel</strong> Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4.3 Resource Partitioning and Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4.4 Interacting With <strong>Hard</strong>ware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4.5 Composite Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4.6 How <strong>Do</strong> Languages and Environments Assist With These Tasks? . . . . . . . . . . . . 91.5 Guide to This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5.1 Quick Quizzes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5.2 Sample <strong>So</strong>urce Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 <strong>Hard</strong>ware and its Habits 112.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1.1 Pipelined CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1.2 Memory References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.1.3 Atomic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1.4 Memory Barriers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1.5 Cache Misses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1.6 I/O Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2 Overheads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.1 <strong>Hard</strong>ware System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.2 Costs of Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.3 <strong>Hard</strong>ware Free Lunch? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.3.1 3D Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.3.2 Novel Materials and Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.3.3 Special-Purpose Accelerators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.3.4 Existing <strong>Parallel</strong> <strong>So</strong>ftware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4 <strong>So</strong>ftware Design Implications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!