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

derived type as a PRIVATE variable in parallel region - ifort crashes!

butette
Beginner
416 Views
So I have a simple program that allocate a derived type as a PRIVATE variable in a parallel region.
When I compile it with ifort 12.0.4, the compiler crashes with an internal error. As far as I know what I am
doing is legal, and the IBM xlf2003 compiler handles it without any problem.
Attached is the small example that illustrate the problem.

>cat omp_private_type.F90

module junk_mod

type junk

integer :: threadid=-1

contains

procedure setID

procedure getID

end type junk

contains

subroutine setID( this, id )

class(junk) :: this

integer :: id

this%threadid = id

end subroutine setID

function getID( this ) result( id )

class(junk) :: this

integer :: id

id = this%threadid

end function getID

end module junk_mod

program test

use omp_lib

use junk_mod

type(junk), allocatable :: junktype

integer nthreads

!$omp parallel default(shared), private(junktype,id,idjunk)

allocate(junktype)

id=omp_get_thread_num()

call junktype%setid(id)

idjunk=junktype%getid()

print *, id, idjunk

deallocate(junktype)

!$omp end parallel

end program test

>ifort -v

Version 12.0.4

>ifort -openmp omp_private_type.F90

0_1855

omp_private_type.F90(27): catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

compilation aborted for omp_private_type.F90 (code 1)

Thanks.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
416 Views
Thanks for the nice example. I can reproduce it in 12.0.4 but not in an engineering version planned for release later this year. One doesn't even have to do anything inside the parallel region, and the type-bound procedures are not relevant - just declaring the allocatable derived type and having a parallel region is enough.
0 Kudos
Reply