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

Problem using nested type-bound procedures and coarrays

FlyingHermes
New Contributor I
813 Views

Hi,

I'm having some problems with a deried-type coarray and type-bound procedure.

What I'm basically trying to do

I've defined a derived-type coarray which has 2 type-bound procedures (Sub1 and Sub2), one (Sub2) calling the other (Sub1).

When I'm calling the Sub2, a segmentation fault error.

The code is given below, and it is also attached

[fortran]

Program Main
 
  use MyType_Module              ,only:  MyType

  implicit none
 
  type(MyType)  ,codimension

  • ::      CoVar
     
      write(*,"(2x,'[Main]:',i0,'/',i0,': Starting')") This_Image(),Num_Images()
     
      write(*,"(2x,'[Main]:',i0,'/',i0,': Calling CoVar%Sub1')") This_Image(),Num_Images()
      call CoVar%Sub1()
     
      write(*,"(2x,'[Main]:',i0,'/',i0,': Calling CoVar%Sub2')") This_Image(),Num_Images()
      call CoVar%Sub2()

    End Program
  • [/fortran]

    [fortran]

    Module MyType_Module


      implicit none
      private
      public        ::      MyType


      Type          ::      MyType
      contains
        procedure   ::      Sub1
        procedure   ::      Sub2
      End Type


      contains


    Subroutine Sub1( This )
      implicit none
      class(MyType)  ,codimension

  •   ,intent(in)  :: This
      write(*,"(6x,'[Sub1]:',i0,'/',i0,': Do nothing')") This_Image(),Num_Images()
    End Subroutine

  • Subroutine Sub2( This )
      implicit none
      class(MyType)  ,codimension

  •   ,intent(in)  :: This
      write(*,"(4x,'[Sub2]:',i0,'/',i0,': Calling This%Sub1')") This_Image(),Num_Images()
      call This%Sub1()
      write(*,"(4x,'[Sub2]:',i0,'/',i0,': Exiting')")
    End Subroutine

  • End Module

    [/fortran]

    The above code can be compiled with the following commands:

    [bash]ifort -coarray -coarray-num-images=2 -c mytype_module.f90 -o mytype_module.o
    ifort -coarray -coarray-num-images=2 -c main.f90 -o main.o
    ifort -coarray -coarray-num-images=2 main.o mytype_module.o -o a.out[/bash]

    Thanks

    0 Kudos
    4 Replies
    Anonymous66
    Valued Contributor I
    813 Views

    I have escalated this to the developers. The issue number is DPD200243988. I will keep you informed of any updates I receive.

    Annalee

     

    0 Kudos
    Anonymous66
    Valued Contributor I
    813 Views

    A fix has been found for this issue. We are currently planning to include it in the next major release which is currently scheduled for later this year.

    Annalee

    0 Kudos
    FlyingHermes
    New Contributor I
    813 Views

    Hi,

    This error is still present in ifort version 13.1.3.

    Any idea when the next major release you are mentioning will be available  ?

    Thanks

    0 Kudos
    Steven_L_Intel1
    Employee
    813 Views

    September.

    0 Kudos
    Reply