Docsity

Collective Communication - Parallel Computing - Lecture Slides, Slides of Parallel Computing and Programming

Toggle sidebar
bg1
Collective Communication
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download Collective Communication - Parallel Computing - Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Collective Communication

2

Group Communication

  • Motivation: accelerate interaction patterns among groups
  • Approach: collective communication —whole group works together collectively to realize a communication —constructed from pairwise point-to-point communications
  • Implementation strategy —standard library of common collective operations —leverage target architecture for efficient implementation
  • Benefits of standard library implementations —reduce development effort and cost for parallel codes —improve performance through efficient implementations —improve software quality

4

Assumptions

  • Network is bidirectional
  • Communication is single-ported —node can receive only one message per step
  • Communication cost model —message of size^ m,^ no congestion, time =^ ts + tw m —congestion: model by scaling^ tw

5

One-to-All and All-to-One

  • One-to-all broadcast —a processor has m units of data that it must send to everyone
  • All-to-one reduction —each processor has m units of data —data items must be combined using some associative operator - e.g. addition, min, max —result must be available at a target processor 0 1 p-
M
M M

One-to-all broadcast All-to-one reduction 0 1 p-

M

7

One-to-All and All-to-One on a Ring

  • Broadcast —naïve solution - source sends send p - 1 messages to the other p - 1 processors —use recursive doubling - source sends a message to a selected processor yields two independent problems over halves of the machine
  • Reduction — invert the process 0 1 7 6 2 3 5 4 0 1 7 6 2 3 5 4

8

Broadcast on a Balanced Binary Tree

  • Consider processors arranged in a dynamic binary tree —processors are (logically) at the leaves —internal nodes are routing nodes
  • Assume leftmost processor is the root of the broadcast
  • Use recursive doubling strategy: log^ p^ stages 0 1 2 3 4 5 6 7

10

Broadcast and Reduction on a Hypercube

  • Consider hypercube with^^2 d

nodes

—view as d -dimensional mesh with two nodes in each dimension

  • Generalize mesh algorithm to a hypercube — d ( = log p ) steps

11

Broadcast and Reduction Algorithms

  • Each of aforementioned broadcast/reduction algorithms —adaptation of the same algorithmic template
  • Next slide: a broadcast algorithm for a hypercube of 2 d

nodes

—can be adapted to other architectures —in the following algorithm

  • my_id is the label for a node
  • X is the message to be broadcast

13

All-to-One Reduction Algorithm

All-to-One sum reduction on a d -dimensional hypercube Each node contributes msg X containing m words, and node 0 is the destination I am the master of a 2 i^ subcube // odd // even

14

Broadcast/Reduction Cost Analysis

Hypercube

  • Log p point-to-point simple message transfers —each message transfer time: t s + t w m
  • Total time

16

All-to-All Broadcast/Reduction on a Ring

All-to-all broadcast on a p -node ring.

Also works for linear array with bi-directional links message size stays constant

17

All-to-All Broadcast on a Ring

For an all-to-all reduction,

  • combine (rather than append) each incoming message into your local result
  • forward to your successor what you have received

19

All-to-all Broadcast on a Hypercube

  • Generalization of the mesh algorithm to^ log p^ dimensions
  • Message size doubles in each of^ log p^ steps 1 value @ each 2 values @ each 4 values @ each 8 values @ each

20

All-to-all Broadcast on a Hypercube

All-to-all broadcast on a d -dimensional hypercube.