Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

fortran 90 query

anupam_mu
Beginner
775 Views
hi everybody,
fortran 90 implements some intrinsic array functions like "sum, matmul" etc. i wonder does it really improves the performance and speed of the program if i use those type of intrinsic functions rather than writing simple programs.
any comment is appreciated.
thanks
0 Kudos
4 Replies
TimP
Honored Contributor III
775 Views
As the performance of sum(), dot_product(), and matmul() have high importance, much effort has been expended to make them efficient in many cases.
Matmul() has so many possibilities that faster ways are likely to exist for specific situations. This may involve transposing an operand to make it stride 1, outer loop unrolling to match known array dimensions, trying BLAS libraries such as Intel MKL, and the like. MKL has built-in OpenMP; matmul() is not likely to parallelize.
The situation varies for other intrinsics. Fairly fast maxval(), minval(), maxloc(), minloc() for the IPF compiler should appear soon. cshift(), eoshift() and the like nearly always can be written in faster ways, but they have been improved somewhat in recent Intel compilers.
0 Kudos
TimP
Honored Contributor III
775 Views
gfortran performs better than 32-bit Intel Fortran on the maxloc(), eoshift(), and cshift() intrinsics. That doesn't make the shift intrinsics fast. I don't know whether your question related to a specific Intel compiler, or to the general advisability of using the intrinsics.
0 Kudos
tonio
Beginner
775 Views
Hi,

from my tests, mkl is faster than matmul.

Is it possible for ifort to use mkl implicitely when matmul is called ?
0 Kudos
TimP
Honored Contributor III
775 Views
Intel compilers don't provide any automatic way of choosing BLAS or MKL calls when appropriate. In principle, declared dimensions of arrays could be used to determine when to use MKL, but such a scheme would fall down in general. It's left up to the programmer to make the decision.
We may hope for some ability to parallelize MATMUL() in the future, which could take care of some of the cases where MKL is needed currently.
0 Kudos
Reply