- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

My first post on the forum!

I'm working with an older code written i Fortran at uni. The program consists of several subroutines and I would like to rewrite parts (subroutines) of the code so it runs faster (parallel). My knowledge of Fortran is limited/"ok". The first routine I like to look into is MT:

description:

“Matrix multiplication

B = AA*B*A (AA is the transpose of A)

B = Full, symmetric matrix

A = Unit matrix with an n by n submatrix (argument A) on the diagonal”

For code, please see attachment.

The subroutine is often called like this:

do J = 1,10,3

CALL MT(UM,FS,WE,12,3,J,PU,ER)

continue

Then UM(3,3), FS(12,12) and WE(3)

Is there any way I can use MKL to rewrite the code? Using dgemm? Or maybe use openmp?

Any clues?

Thanks,

Lars

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

The problem is rather small so I would not expect MKL to be of much help. As you show the possibility of executing 2 or 4 of them in parallel, there may be some scope for threading.

Inside MT, it may help to give loop count directives or to assure that the compiler can take advantage of such information through interprocedural analysis. Just in case, you would examine vec-report to assure that the inner loops have vectorized (with the proviso that the loops are rather short and probably do better with minimal unroll).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Tim Prince wrote:

The problem is rather small so I would not expect MKL to be of much help. As you show the possibility of executing 2 or 4 of them in parallel, there may be some scope for threading.

Inside MT, it may help to give loop count directives or to assure that the compiler can take advantage of such information through interprocedural analysis. Just in case, you would examine vec-report to assure that the inner loops have vectorized (with the proviso that the loops are rather short and probably do better with minimal unroll).

Thanks for the answer Tim, but as I wrote, my Fortran knowledge is limited. Are you able to make an example?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I do not understand the problem description. If A is n X n and B is m X m, the matrix pairs (A^{T}, B) and (B, A) are not suitable for multiplication when m is not equal to n. Please explain.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

mecej4 wrote:

I do not understand the problem description. If A is n X n and B is m X m, the matrix pairs (A

^{T}, B) and (B, A) are not suitable for multiplication when m is not equal to n. Please explain.

Mecej4,

For each step J, B is a subset of B : A^{T}(3,3) * B(3,12) and then B(12,3)*A(3,3)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page