Docsity

Communication Patterns & Cost Analysis in Parallel Computing: One-to-All, All-to-All, Scat, Slides of Parallel Computing and Programming

Partial preview of the text

Download Communication Patterns & Cost Analysis in Parallel Computing: One-to-All, All-to-All, Scat and more Slides Parallel Computing and Programming in PDF only on Docsity!

Communication Patterns in Different

Topologies

  • One-to-All Broadcast and All-to-One

Reduction

  • All-to-All Broadcast and Reduction

& All-Reduce Operations

  • Scatter and Gather (one to all & all to

one personalized comm)

Cost Analysis: one-to-all broadcast

& reduction

-^

Using recursive doubling approach thebroadcast or reduction procedure on all thetopologies (array, mesh, tree, hypercube)involves

log p

point-to-point simple message

transfers, each at a time cost of

t^ s

+ t

w

m

.

-^

The total time (assuming no congestion) istherefore given by:

Reduction Time cost analysis forAll-to-one & All-to-all commniction

on Array, mesh & Hypercube

Topologies.

Scatter and Gather Operations

Scatter and gather operations.

Example of the Scatter Operation^ The scatter operation on an eight-node hypercube.

Scatter/Gather comm time analysis

on different topologies • Scatter

  • Linear array– 2-D Mesh– Hypercube– Tree
    • Gather
      • Linear Array– 2-D Mesh– Hypercube– Tree

Communication Time Complexity:

Matrix-Vector Multiplication

Sequential Matrix-VectorMultiplication Algorithm

-^

We aim to multiply a dense

n

x

n

matrix A with an

n

x

^1

vector

x

to

yield the

n

x

result vector y.

-^

The serial algorithm requires

n

2

multiplications and additions.

Parallel Matrix_Vector Multiplication:

Data Decomposition/Partitoning Approaches

-^

Parallel Matrix-Vector Multiplication– 1_D partitioning

-^

p = n

-^

p < n

  • 2_D partitioning -^

p = n

-^

p < n

Matrix-Vector Multiplication:

Row-wise 1-D Partitioning^ •^

The

n

x

n

matrix is partitioned

among

n

processors, with each

processor storing complete rowof the matrix.

-^

The

n

x

vector

x

is distributed

such that each process ownsone of its elements.

Matrix-Vector Multiplication:

Rowwise 1-D Partitioning

•^

Since each process starts with only one element of

x

an all-to-all broadcast is required to distribute all theelements to all the processes.

-^

Process

P

i^

now computes

•^

The all-to-all broadcast and the computation of

y [

i ]

both

take time

(n)

. Therefore, the parallel time is

(n)

Matrix-Vector Multiplication:

Rowwise 1-D Partitioning

•^

Consider now the case when

p < n

and we use block 1D

partitioning.

-^

Each process initially stores

n / p

complete rows of the

matrix and a portion of the vector of size

n / p

•^

The all-to-all broadcast takes place among p processesand involves messages of size

n / p

•^

This is followed by

n / p

local dot products.

•^

Thus, the parallel run time of this procedure is This is cost-optimal.

Also time complexity for 2-D partitioned Time complexity