Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Issue with loop for allocatable array in private (openmp)

$
0
0

Dear community,

​I am encountering a weird problem involving OpenMP. This simple code snippet

integer :: elem_no

integer :: no_nod_elem

real(dp), allocatable, dimension(:) :: fiss_den

 

!$OMP PARALLEL DO &

!$OMP& DEFAULT(none) &

!$OMP& SHARED(mesh) &

!$OMP& PRIVATE(no_nod_elem,fiss_den)

 

do elem_no=1,mesh%no_active_elem

 

  no_nod_elem = 5

  allocate(fiss_den(no_nod_elem)) ! X

 

  fiss_den = 0.0_dp

 

  deallocate(fiss_den)

enddo

 

!$OMP END PARALLEL DO

 

fails with the message that fiss_den is already allocated (on line marked X).

Mesh is a complex data_type with the entry no_active_elem an integer. If I replace mesh%no_active_elem by some new integer variable that was set to the correct value, then it does work (at least running on single thread). So something fishy going on. Are there any restrictions I am not aware of?

Any ideas why this would happen? I have seen similar questions posted before, but I believe these issues were fixed in previous versions (I am using 17.0.4 on linux).

Thanks for any pointers you might have.

Danny.

 

 

 


Viewing all articles
Browse latest Browse all 2746

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>