Problem using nested type-bound procedures and coarrays

Problem using nested type-bound procedures and coarrays

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

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

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

The above code can be compiled with the following commands:

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

Thanks

附件尺寸
下载 test-coarray.tar.gz731 字节
5 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

Annalee

 

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

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

September.

Steve - Intel Developer Support

发表评论

登录添加评论。还不是成员?立即加入