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

Problem with coarrays of derived types with allocatable components

sliska314
Beginner
192 Views

Hello,The release notes ofFortran Composer XE 2011 Update 6 suggest that coarrays of derived types with allocatable components are allowed (therelease notes ofprevious version listed 'Coarrays of derived type where the type contains an ultimate component that isALLOCATABLE or POINTER'under 'Coarray Known Issues').
Yet, this still seems to be a problem in my Update 6 version.
For example:
[bash]program test implicit none type :: new_type integer :: a(2) integer,allocatable :: b(:) end type new_type type(new_type) :: t

  • integer :: k,tmp(2) allocate(t%b(2)) t%a = [1:2]+2*(this_image()-1) t%b = [1:2]+2*(this_image()-1) sync all if (this_image().eq.1) then do k=1,num_images() print *, 'img: ', k tmp = t%a print *, ' a: ', tmp end do do k=1,num_images() print *, 'img: ', k tmp = t%b print *, ' b: ', tmp end do end if end program test[/bash] The first loop executes without any problems, but problem terminates with 'segmentation fault' on line 27 ('tmp = t%b') when the number of images is greater than 1.I copied the arrays 't%a' and 't%b' to 'tmp' before printing because of the known issues with writing anarray slice (or entire array) of a coarray referencing another image.I'm new to coarrays, but I believe the above example compiled with Update 6 should work.
    Thanks,Sebastian Liska
  • 0 Kudos
    3 Replies
    Steven_L_Intel1
    Employee
    192 Views
    Thanks - we'll take a look at this.
    0 Kudos
    Steven_L_Intel1
    Employee
    192 Views
    We have another open issue with a similar look - the issue ID is DPD200173725. I have added your test case to that - thanks.
    0 Kudos
    Steven_L_Intel1
    Employee
    192 Views

    This problem is fixed in the current compiler version.

    0 Kudos
    Reply