I am using intel fortran compiler and intel mkl for a performance check. I am passing some array sections to Fortran 77 interface with calls like
<code>call dgemm( transa,transb,sz_s,P,P,& a, Ts_tilde,& sz_s,R_alpha,P,b,tr(:sz_s,:),sz_s)</code>
as evident, tr(:sz_s,:) is not contiguous in memory and the Fortran 77 interface is expecting a continuous block and creating a temporary for this.
What I was wondering is that will there be a difference if I create my temporary array explicitly in the code for tr and copy information from that temporary back and forth before and after the operation, or will that be the same as compiler itself creating the temporary from a performance point of view? I guess compiler will always be more efficient.
And of course any more suggestions to eliminate these temporaries are welcome.
One more point, If I use the Fortran 95 interface of the library apparently, with a similar call on a simpler test problem, no warning is issued for the creation of a temporary. Then I read in the manual of mkl that Fortran 95 interface uses assumed shape arrays which explains why temporaries are not created. Is this the logical way to continue if I can not reshape the above code to work with contiguous blocks?
However at that point, while testing the Fortran95 interfaces, I run into a problem with the support function dsecnd. With the below code using mkl_service module I am getting
dgemm95_test.f90(30): error #6404: This name does not have a type, and must have an explicit type. [DSECND]
t1 = dsecnd()
-----^
Any idea for this problem is also welcome. The simple code for the dsecnd problem is
<code>program dgemm95_test ! some modules for Fortran 95 interface use mkl_service use mkl95_precision use mkl95_blas ! implicit none ! double precision, dimension(4,3) :: a double precision, dimension(6,4) :: b double precision, dimension(5,5) :: r ! result array double precision, dimension(3,2) :: dummy_b ! character(len=1) :: transa character(len=1) :: transb ! double precision :: alpha, beta, t1, t2, t integer :: sz1, sz2 ! initialize some variables alpha = 1.0 beta = 0.0 a = 2.3 b = 4.5 r = 0.0 transa = 'n' transb = 'n' dummy_b = 0.0 ! Fortran 95 interface t1 = dsecnd() call gemm( a, b(4:6,1:3:2), r(2:5,3:4),& transa, transb, alpha, beta ) t2 = dsecnd() ! write(*,*) r dummy_b = r(2:4,4:5) ! end program dgemm95_test</code>
Any help and advice on these points are highly appreciated.
Best regards,
Umut