Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

matrix multiplication

rdabra
Beginner
94 Views
I am a newbie in thread programming, so sorry if my following question sounds stupid. I made a single threaded routine that multiplies two 5x5 matrices. I made another routine, 25 threaded, multiplying the pairs mat_1(line_i) x mat_2(column_j) for the same two matrices (I have a dual core processor). Why the multi-threaded routine is slower than the first one ? Is this true or have I made something wrong ?
0 Kudos
2 Replies
TimP
Black Belt
94 Views
A short answer: the problem is too small to overcome the overhead of threading. Probably too small to time accurately, if you did it efficiently without threading. If you test a professionally written function, such as DGEMM from Intel MKL library, you will see that it drops to a single thread for problems of this size.
ashoksaravanan
Beginner
94 Views
hello sir,
its advisable to use as many no. of software threads as there are hardware threads..
since your machine has only 2 hardware threads, its more than enough to use 2 threads..
Also, we can see a significant increase in performance only in the case of bigger programs or applications.. So dont get confused if the parallel run time is higher for ur multiplication..
Reply