- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to compile and run the following code:
``` fortran
program openmmp_with_associate_to_allo
implicit none
integer, allocatable, dimension(:) :: allocatable_array
integer :: static_array(5), i
allocate(allocatable_array(5))
do i = 1, 5
allocatable_array(i) = i
static_array(i) = i
end do
!$omp parallel do
do i = 1, 5
associate(a=>static_array, b=>allocatable_array)
write(*, *) "i, a(i)", i, a(i)
write(*, *) "i, b(i)", i, b(i)
end associate
end do
!$omp end parallel do
end program openmmp_with_associate_to_allo
```
Using gfortran 12.1 (with or without -fopenmp) the code compiles and runs succesfully and prints both a and b as asked.
Using itel fortran compiler 2022.2.0: Without using -qopenmp - the code compiles and runs successfully.
When using -qopenmp - the code compiles but crashes when tryihnjg to print b which associates to an allocatable array. a - which is ascociated to a static array is printed successfully.
Does any one know if this code is written with a problem or is there a problem in ifort?
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed a bug report on this for you, CMPLRIL0-34840.
Interestingly, it compiles and runs OK with ifx. That's your workaround: use ifx. Object files created with ifx are compatible with those created by ifort. You can mix and match.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Barabara
I can not seem to enter the bug report
Can you please give a link to the bug report?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Klein__Ygal We don't have a mechanism for you to see the actual bug report. I'll post here when a fix is available to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler team researched this and determined another workaround.
program openmmp_with_associate_to_allocatable
implicit none
integer, allocatable, dimension(:) :: allocatable_array
integer :: static_array(5), i
allocate(allocatable_array(5))
do i = 1, 5
allocatable_array(i) = i
static_array(i) = i
end do
associate(a=>static_array, b=>allocatable_array)
!$omp parallel do
do i = 1, 5
write(*, *) "i, a(i)", i, a(i)
write(*, *) "i, b(i)", i, b(i)
end do
!$omp end parallel do
end associate
end program openmmp_with_associate_to_allocatable
Can you use these workarounds: ifx or move the ASSOCIATE outside the parallel do?
ifx is the way of the future for Intel Fortran.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page