introduction to parallel computingkarypis/parbook...all-reduce & prefix-sum scatter and gather...

27
Introduction to Parallel Computing George Karypis Basic Communication Operations

Upload: others

Post on 29-Aug-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Introduction to Parallel Computing

George KarypisBasic Communication Operations

Page 2: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

OutlineImportance of Collective Communication OperationsOne-to-All BroadcastAll-to-One ReductionAll-to-All Broadcast & ReductionAll-Reduce & Prefix-SumScatter and GatherAll-to-All Personalized

Page 3: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Collective Communication Operations

They represent regular communication patterns that are performed by parallel algorithms.

Collective: Involve groups of processorsUsed extensively in most data-parallel algorithms.The parallel efficiency of these algorithms depends on efficient implementation of these operations.They are equally applicable to distributed and shared address space architecturesMost parallel libraries provide functions to perform themThey are extremely useful for “getting started” in parallel processing!

Page 4: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

MPI Names

Page 5: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

One-to-All Broadcast &All-to-One Reduction

Page 6: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Broadcast on a Ring Algorithm

Page 7: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Reduction on a Ring Algorithm

Page 8: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Broadcast on a Mesh

Page 9: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Broadcast on a Hypercube

Page 10: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Code for the BroadcastSource: Root

Page 11: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Code for BroadcastArbitrary Source

Page 12: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-All Broadcast & Reduction

Page 13: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-All Broadcast for Ring

Page 14: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-All Broadcast on a Mesh

Page 15: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-All Broadcast on a HCube

Page 16: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-Reduce & Prefix-Sum

Page 17: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Scatter & Gather

Page 18: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Scatter Operation on HCube

Page 19: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-All Personalized (Transpose)

Page 20: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-all Personalized on a Ring

Page 21: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-all Personalized on a Mesh

Page 22: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-all Personalized on a HCube

Page 23: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

All-to-all Personalized on a HCubeImproved Algorithm

Perform log(p) point-to-pointcommunication steps

Processor i communicates with processor iXORj duringthe jth communication step.

Page 24: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations

Complexities

Page 25: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations
Page 26: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations
Page 27: Introduction to Parallel Computingkarypis/parbook...All-Reduce & Prefix-Sum Scatter and Gather All-to-All Personalized. Collective Communication Operations