Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
46 Views

openMP + polymorphism (ifort 19.1 on Linux)

Dear all,

if I remember correctly, mixing Fortran 2003 polymorphism and openMP was not fully supported in the past (is this still the case?).

However, some functionality apparently degraded with ifort 19.1 (compared to previous versions, at least from ifort 17 upwards). Here is a snipped that no longer works in ifort 19.1.0 for Linux:

program test
    implicit none

    type :: t
    end type

    class(t), allocatable :: x
    allocate(x)

    !$OMP parallel
    select type(x)
    class default
    end select
    !$OMP end parallel
end program

Here is some exemplary output (e.g. with export OMP_NUM_THREADS=1); but the crash is not deterministic and manifests only sporadically:

$ ifort test.f90 -qopenmp -trace
$ ./a.out
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source        
a.out              0000000000404E4A  Unknown               Unknown  Unknown
libpthread-2.17.s  00002B6CC94D6630  Unknown               Unknown  Unknown
a.out              000000000041DDB8  Unknown               Unknown  Unknown
a.out              0000000000403EB7  MAIN__                     10  test.f90

I would appreciate your input on whether this code is supposed to work, and whether I should consider filing a bug report with Intel.
Also, suggestions on fixes that make this type-selection work in an openMP-clause are appreciated.

Kind regards
Ferdinand

0 Kudos
2 Replies
Highlighted
Moderator
46 Views

I checked with an Intel representative to the OpenMP standards committee. OpenMP 5.0 supports this use of polymorphic entities. OpenMP 4.5 does not define how they work together.

I filed a bug (moth?) for this, CMPLRIL0-32771.

 

0 Kudos
Highlighted
New Contributor II
46 Views

Barbara,

Thank you!

0 Kudos