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

class pointer problem with Intel 2020 compiler

Vu__Phuong
Beginner
1,802 Views

It seems the Intel 2020 Fortran compiler has screwed up the handling of class pointer inside a parallel region.  The following code snippet example works fine with Intel 2019 compiler and gfortran.

Program main
type, abstract :: abstype
   integer :: me=0
end type abstype

type, extends(abstype) :: type1
end type type1

type(type1), target :: t1
class(abstype), pointer :: base
integer ix, iy, nx, ny

nx = 2
ny = 2

base => t1

select type(base)
class is (type1)
print *, base%me
!$omp parallel do default(shared) private(iy,ix)
do iy = 1,ny
   do ix = 1,nx
   print *, ix, iy, base%me
   enddo
enddo

class default
end select

print *, "DONE"

end Program

 

0 Kudos
6 Replies
Ferdinand_T_
New Contributor II
1,802 Views
0 Kudos
Vu__Phuong
Beginner
1,802 Views

Thanks for the note.  It could be related (meaning the same code path in the compiler) although I think my situation is more well defined that your situation since I am not doing the select inside a parallel region and in my example when you run it with OMP_NUM_THREADS=1 it always works.  Did they give you an idea when your issue may be fixed?

0 Kudos
Ron_Green
Moderator
1,802 Views

I opened a new bug report.  This code is different enough from the other forum thread.

CMPLRIL0-32859

You asked about a date for fix.  Hard to say, the Fortran developers have a lot of work between now and 2021.  Were I you, I would use 19.0.x for now. 

0 Kudos
Vu__Phuong
Beginner
1,802 Views

Thank you Ron.

Yes, we are staying with the 19.x compiler for now since it would take a lot of work to change our codes to work around this issue because it is a pretty common construct for us.

0 Kudos
JohnNichols
Valued Contributor III
1,802 Views

Hard to say, the Fortran developers have a lot of work between now and 2021.  

----------------------------------------------------------------------------------------------------------

I cannot remember the book - but in some famous novel -- the author wrote that he would love to look into the minds of a particular group -- Fortran Compiler writers must be such a group. 

0 Kudos
Barbara_P_Intel
Employee
1,569 Views

I apologize for not notifying you sooner, but this bug was fixed in an earlier version of the 2021.x.x compiler that is available in the oneAPI HPC Toolkit. 2021.4.0 is the current release.

Can you try the current release that was made available on October 1 and let me know how it works for you?



0 Kudos
Reply