Diagnostic 7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.

Diagnostic 7617: This host associated object appears in a 'defining' context in a PURE procedure or in an internal procedure contained in a PURE procedure.

In Fortran, A PURE procedure has restrictions on side-effects that allow parallelization and better optimization. PURE procedures are not allowed to define or change the definition status of variables that are host or use associated, or in COMMON. In the following example, hostvar is host associated inside PURE subroutine puresub. When this source is compiled, the assignment to hostvar causes error 7617 to be reported.

program F7617
implicit none

integer hostvar

call puresub

contains

pure subroutine puresub
hostvar = 1
end subroutine puresub
end program F7617

Note that ELEMENTAL procedures are also PURE, unless they are also given the IMPURE prefix (a Fortran 2008 feature supported by Intel Fortran Compiler 16.0 and above.)

To resolve this error, do not use host associated variables in a definition context within a PURE procedure.

If you have further questions about this diagnostic, please ask in the Intel Fortran User Forums.

For more complete information about compiler optimizations, see our Optimization Notice.

2 comments

Top
sblionel's picture

Daniel, yes this bug was fixed a while ago. The current version 16.0 compiles your source without errors.

If you have more questions, please ask in our user forum.

DanielIlie@mcskenny.com's picture

Dear Steve,

I came across this diagnostics message, when I tried to compile the code below. There are two such messages issued: one for variable i and one for variable j, both on the do concurrent line.

I compiled with 12.1.1.258 [IA-32] and VS 2010 SP1.

I noticed that the following issue was fixed in w_fcompxe_2013.1.119. So this could be have been also fixed already.

DPD200233820Fortranerror #7617, DO CONCURRENT iterator erroneously flagged as illegal in elemental function

Thank you for your help with this.

Kind regards,

Daniel Ilie.

pure subroutine sub1(m,n,a,b,c)
  implicit none

  integer, intent(in) :: m,n
  real(8), intent(in), dimension(m,n) :: a,b
  real(8), intent(out), dimension(m,n) :: c

  integer :: i, j

  do concurrent( i=1:m, j=1:n )
    c(i,j) = a(i,j) + b(i,j)
  end do

end subroutine sub1

program main
  implicit none

  integer :: m, n
  real(8), dimension(2,3) :: a, b, c
  
  m = ubound(a,1)
  n = ubound(a,2)

  a = 1.d0
  b = 2.d0

  call sub1(m,n,a,b,c)



end program main

 

 

 

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.