Top Banner
Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR
32

Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Dec 24, 2015

Download

Documents

Bryan Morton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Thinking in Parallel – Pipelining

New Mexico Supercomputing Challengein partnership with Intel Corp. and NM EPSCoR

Page 2: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Copyrights and Acknowledgments

Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States or other countries.

New Mexico EPSCoR Program is funded in part by the National Science Foundation award #0814449 and the State of New Mexico. Any opinions, findings, conclusions, or recommendations expressed in the material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

For questions about the Supercomputing Challenge, a 501(c)3 organization, contact us at: consult @ challenge.nm.org

Page 3: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Agenda

Definition review of pipelining

Steps involved in pipelining

Conceptual example of pipelining

Hands-on pipelining parallel activities

Page 4: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Methodology

Domain decomposition – Used when the same operation is performed on a large number of similar data items.

Task decomposition – Used when some different operations can be performed at the same time.

Pipelining – Used when there are sequential operations on a large amount of data.

Page 5: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Pipelining

Special kind of task decomposition

“Assembly line” parallelism

Example: 3D rendering in computer graphics

Page 6: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 1 Data Set (Step Definitions)

Model: Determine position, size,

shape of objects in virtual world.

Project:Flatten 3D virtual world onto a 2D

plane, for a given point of view.

Clip:Constrain 2D

plane to logical window size.

Rasterize: Transfer logical window

contents to physical device.

Page 7: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 1 Data Set (Step 1)

Processing one data set in 4 steps

RasterizeClipProjectModel

Page 8: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 1 Data Set (Step 2)

RasterizeClipProjectModel

Page 9: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 1 Data Set (Step 3)

RasterizeClipProjectModel

Page 10: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 1 Data Set (Step 4)

RasterizeClipProjectModel

Page 11: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 2 Data Sets (Step 1)

Using pipelining to process 2 data sets in 5 steps

RasterizeClipProjectModel RasterizeClipProjectModel

Page 12: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 2 Data Sets (Step 2)

RasterizeClipProjectModel

Page 13: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 2 Data Sets (Step 3)

RasterizeClipProjectModel

Page 14: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 2 Data Sets (Step 4)

RasterizeClipProjectModel

Page 15: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 2 Data Sets (Step 5)

RasterizeClipProjectModel

Page 16: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 1)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 17: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 2)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 18: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 3)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 19: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 4)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 20: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 5)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 21: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 6)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 22: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 7)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 23: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Processing 5 Data Sets (Step 8)

Data set 0

Data set 1

Data set 2

Data set 3

Data set 4

CPU 0 CPU 1 CPU 2 CPU 3

Page 24: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 1 – Domain Decomposition

Your team will explore how to use domain decomposition to accomplish the job of stuffing, sealing, addressing, stamping, and mailing multiple envelopes.

*See handout for detailed instructions

Page 25: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 1 – Setup

1. Cut up sample address table, giving each processor a portion of the addresses.

2. Divide up the envelopes, stamps, and address labels so that each processor gets has the materials needed for their assigned sample addresses.

3. Give a pen or pencil to each processor.

4. Designate an area of the room to be the mailbox.

Page 26: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 1 – Execution

1. After all of the processors are given the instructions, start timer.

2. Each processor should perform these steps as quickly as possible:

a. Fold scrap paper.

b. Stuff paper into envelope.

c. Pretend to seal envelope (so we can re-use them later).

d. Fix a stamp to the envelope.

e. Complete an address label, for the next sample address.

f. Fix address label to the envelope.

g. Place envelope in the mail box.

h. Repeat steps a - g for all sample addresses.

3. Stop timer.

Page 27: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 1 – Debrief

1. Which task(s) took the longest?

2. Which task(s) took the shortest?

3. Were any processors idle for periods of time?

Page 28: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 2 – Task Decomposition and Pipelining

Your team will explore how to use a pipeline task decomposition of the job of folding, stuffing, sealing, addressing, stamping, and mailing multiple envelopes.

Page 29: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 2 – Setup

1. Number the four team members as processor 1, 2, 3, and 4.

2. Give 16 pieces of scrap paper and 16 envelopes to processor 1.

3. Give 16 stamps to processor 2.

4. Give processor 3 sample addresses, 16 address labels, and a pen or pencil.

Page 30: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 2 – Execution

1. After all of the processors are given the instructions, start timer.

2. Each processor should perform their required steps as quickly as possible, forwarding their completed work to the next processor, and repeating until all envelopes are stuffed, stamped, addressed, and mailed:

1. Stop Timer

Processor 1 Processor 2 Processor 3 Processor 4

– Fold scrap paper.

– Stuff paper into envelope.

– Pretend to seal envelope (so we can re-use them later).

– Fix a stamp to the envelope.

– Complete an address label, for the next sample address.

– Fix address label to the envelope.

– Place envelope in the mail box.

Page 31: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Activity 2 – Debrief

1. Which task(s) took the longest?

2. Which task(s) took the shortest?

3. Were any processors idle for periods of time?

4. Was this approach faster than activity 1?

a. If so, discuss reasons why.

b. If not, discuss reasons why.

5. Do you think it would be possible to speed up this approach? How?

Page 32: Thinking in Parallel – Pipelining New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.

Optional Activity – Task Decomposition and Pipelining

If time permits, have teams redistribute the tasks among the processors, to decrease idle time and overall time required for completion.

For example:

Multiple processors assigned to the same task.

Multiple tasks assigned to one processor.

Note: To ensure pipeline processing, a processor may not be assigned every task.