Module 3
Module 3
Subject In-charge
Sonali Suryawanshi
Assistant Professor, Department of Information Technology, SFIT
Room No. 328
email: [email protected]
Problem Statement
• Given,
n × n matrix M, whose element in row i and column j will be denoted
𝑚𝑖𝑗 .
• a vector v of length n.
Assume that
– the row-column coordinates of each matrix element will be discoverable, either
from its position in the file, or because it is stored with explicit coordinates, as a
triple (i, j, 𝑚𝑖𝑗).
– the position of element 𝑣𝑗 in the vector v will be discoverable in the analogous
way
St. Francis Institute of Technology
Department of Information Technology 3
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
Case 1: n is large, but not so large that vector v cannot fit in main memory
● Case 1 Continued …
● The ith stripe of the matrix multiplies only components from the ith
stripe of the vector.
● Divide the matrix into one file for each stripe, and do the same for the
vector.
● Each Map task is assigned a chunk from one of the stripes of the
matrix and gets the entire corresponding stripe of the vector.
● The Map and Reduce tasks can then act exactly as was described, as
case 1.
Matrix-Vector Multiplication
by MapReduce
Vij
Matrix-Matrix Multiplication:
Matrix-Matrix Multiplication:
Matrix-Matrix Multiplication:
Matrix-Matrix Multiplication:
Matrix-Matrix Multiplication:
Q.4) Write pseudo code for Matrix vector Multiplication by MapReduce. Illustrate with an
example showing all the steps ( 10 Marks)
1. Which of the following options must aptly explains the reason behind the
creation of Mapreduce?
a) Need to increase the processing power of new hardware
b) Need to perform complex analysis of structured data
c) Need to increase number of users
d) Need to spread distributed computing resources