Hi,
I am working on profiling and optimising an application. The application is written in Fortran 2003 and I am using the Intel ifort (IFORT) 16.0.0 20150815 version to build. I have two questions.
In the my profile the following code which has assignment of a pointer takes more than 10 secs (total application runs for 200 seconds). The profile of this function increases with number of threads. The compiler seems to be doing more than just pointer assignment.
My profile shows prominently a function __intel_ssse3_rep memcpy ( or _wordcopy_fwd_aligned ) when compiled with O3 (or O1) optimisation option. What is happening here?
function get_master_dofmap(self,cell) result(map) implicit none class(master_dofmap_type), target, intent(in) :: self integer, intent(in) :: cell integer, pointer :: map(:) map => self%dofmap(:,cell) return end function get_master_dofmap
Also I see that for calls to functions with pointers to array as arguments, the compiler warns that temporary arrays are created.
forrtl: warning (406): fort: (1): In call to COORDINATE_JACOBIAN, an array temporary was created for argument #6
subroutine coordinate_jacobian(ndf, ngp_h, ngp_v, chi_1, chi_2, chi_3, diff_basis, jac, dj)
!-------------------------------------------------------------------------------
! Compute the Jacobian J^{i,j} = d chi_i / d \hat{chi_j} and the
! derterminant det(J)
!-------------------------------------------------------------------------------
integer, intent(in) :: ndf, ngp_h, ngp_v
real(kind=r_def), intent(in) :: chi_1(ndf), chi_2(ndf), chi_3(ndf)
real(kind=r_def), intent(in) :: diff_basis(3,ndf,ngp_h,ngp_v)
real(kind=r_def), intent(out) :: jac(3,3,ngp_h,ngp_v)
real(kind=r_def), intent(out) :: dj(ngp_h,ngp_v)
call coordinate_jacobian( ndf, &
1, &
1, &
chi_cell(1,:), &
chi_cell(2,:), &
chi_cell(3,:), &
dgamma, &
jac, &
dj)
How can I avoid them?