• 03-13-2010, 12:05 PM
hedonist
Hi,
I am very curious to implement threading for very large 2-D matrix multiplication, matrix size greater than 1000. I am new to this concept so I have googled and read few articles but it would be nicer if a guru from here would help and point me in the write direction.(some links maybe or ideas, even better)
I appreciate the help.
Thank you.
• 03-13-2010, 12:23 PM
JosAH
Quote:

Originally Posted by hedonist
Hi,
I am very curious to implement threading for very large 2-D matrix multiplication, matrix size greater than 1000. I am new to this concept so I have googled and read few articles but it would be nicer if a guru from here would help and point me in the write direction.(some links maybe or ideas, even better)
I appreciate the help.
Thank you.

Matrix multiplication can be easily parallelized: matrix multiplication is taking dot products of a row vector of the left matrix and a column vector or the rigth matrix. All rows and all columns have to be (dot) multiplied.

If you have n cores in your processor divide this multiplication in n subtasks where the rows are all disjoint and multply away; the tasks all use disjoint rows and only read the columns from the right matrix. The results (scalars) are stored at disjoint locations so no thread synchronization is necessary.

The scenario gives you a speedup of at most a factor n.

kind regards,

Jos
• 03-13-2010, 03:06 PM
hedonist
Thank you JosAH
Its very informative. Can you practically illustrate it further using an example of matrix?
• 03-13-2010, 03:21 PM
JosAH
Quote:

Originally Posted by hedonist
Thank you JosAH
Its very informative. Can you practically illustrate it further using an example of matrix?

No because I would be doing your job.

kind regards,

Jos