Neha Patil (Editor)

Cannon's algorithm

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

In computer science, Cannon's algorithm is a distributed algorithm for matrix multiplication for two-dimensional meshes first described in 1969 by Lynn Elliot Cannon.

It is especially suitable for computers laid out in an N × N mesh. While Cannon's algorithm works well in homogeneous 2D grids, extending it to heterogeneous 2D grids has been shown to be difficult.

The main advantage of the algorithm is that its storage requirements remain constant and are independent of the number of processors.

The Scalable Universal Matrix Multiplication Algorithm (SUMMA) is a more practical algorithm that requires less workspace and overcomes the need for a square 2D grid. It is used by the ScaLAPACK, PLAPACK, and Elemental libraries.

Algorithm overview

When multiplying two N×N matrices A and B, we need N×N processing nodes P arranged in a 2d grid. Initially pi,j is responsible for ai,j and bi,j.

row i of matrix a is circularly shifted by i elements to the left. col j of matrix b is circularly shifted by j elements up. Repeat n times: p[i][j] multiplies its two entries and adds to running total. circular shift each row of a 1 element left circular shift each col of b 1 element up

References

Cannon's algorithm Wikipedia