Multithreading in SGEMM?

Post here if you have a question about LAPACK performance

Multithreading in SGEMM?

Postby andrefaraujo » Fri Jan 15, 2016 12:47 pm

Hello,

I am timing two algorithms which make use of SGEMM for matrix multiplications. In both cases, a matrix multiplication is performed, but in one case the matrix is much larger than in the other case. I would like to be sure that in both cases SGEMM is only using one thread, so that the timing I get from each is comparable and reflect their complexities. My guess is that SGEMM executes one thread only, but I am not sure. When I run the program on gdb (I am using C) and put a breakpoint on the line that calls SGEMM, I systematically see two threads being created, independently of the size of the data fed to it (but my current guess is that these two threads are not used to parallelize computation, but rather due to some interfacing between Fortran and C, not sure). I looked at the original "sgemm.f" code (from http://archive.ubuntu.com/ubuntu/pool/main/b/blas/blas_1.2.20110419.orig.tar.gz) in Fortran (which reads easily even if I do not know Fortran) and I found no indication that it would be doing multithreading. So, my current hypothesis is that both algorithms are indeed using only one thread when SGEMM is called, but I am not 100% sure.

Could anyone help me, please? Thanks!
andrefaraujo
 
Posts: 2
Joined: Thu Jan 14, 2016 11:49 pm

Return to Performance

Who is online

Users browsing this forum: No registered users and 1 guest