- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I have another question. Thanks everyone.
My computer has 4 cores inside, I really want the fortran compiler can make use of all of them when running the code. For my understanding, when we add, substract or multiple two matrix, the task is possible to be distributed to the CPU-cores in order to improve the speed.
So does the ifort or intel MKL have SMP/OpenMP Support on Linear Algebra Operators? I mean when adding, or substracting, or multiplying two matrix?
Thanks very much.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
Thank you very much firstly. Sorry that I am just a beginner, so could you make it in more detail? For example,
1. if I want to multiply two matrix, how MKL performs this by making use of my 4 cores? Does MKL do this automatically or I need to write special code manually?
2. I prefer MKL, but I really want to know how to operate the matrix with OpenMP. Again, if I want to multiply two matrix, do you mean something like below?
!$OMP PARALLEL DO
c=matmul(A,B)
!$OMP END PARALLEL DO
or you mean add /openmp when compiling the code?
3. how to enable autio-parallel?
Sorry that my questions are silly for you, but they are extremely useful for me.
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For MKL usage, you must call the BLAS library functions. They work the same as other BLAS functions, such as ACML, or the source code from netlib.org. You could read about it in the mkl/docs directory, or in independent references.
gfortran has a facility to generate DGEMM call from MATMUL, in case you are interested. It combines limitations of MATMUL and DGEMM.
If you wish to parallelize with OMP PARALLEL DO, you require a DO loop. This could be quite effective for parallelizing many independent instances of MATMUL.
The OpenMP way of parallelizing an individual MATMUL is with OMP WORKSHARE, but ifort supports this only as a SINGLE region. Thus, if you have a problem large enough to parallelize, MKL BLAS, or even writing it out in nested loops for use with PARALLEL DO, would be preferred.
Intel Fortran and C compilers include the auto-parallelization options -Qparallel. Checking the Windows help file would be a good start.

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