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

Memory dealocation is not performed in OMP parallel block

Parshutkin__Konstant
299 Views

Hello everyone,

I have a strange problem with memory allocation/deallocation within OMP parallel block. Bellow there is a very basic program where I just perform allocation, initialization and deallocation of 2-dimensional array.

program test
implicit none
include 'omp_lib.h'
complex*16, allocatable, dimension(:,:) :: A
integer N

!N=2901
N=2902

!$OMP PARALLEL PRIVATE(A) SHARED(N)

allocate( A( 1:N, 1:N ) )
A = 0
deallocate( A )

!$OMP END PARALLEL
end

The code is compiled with Intel(R) Visual Fortran Compiler 17.0.4.210 [Intel(R) 64] in Visual Studio 2015 environment. The code is statically linked to run-time libraries (/libs:static /threads) and processing of OpenMP directives is enabled (/Qopenmp). I run the program in debug mode and monitor Private Working Set parameter in Task Manager.

When compile the program with N=2901, private working set shows that memory allocated within parallel block is not deallocated at the end of the program. When N=2902 the problem is gone. Also the problem cannot be observed when dynamically linking to run-time libraries.

I've tried this code on Intel(R) Visual Fortran Compiler XE 15.0.6.285 [Intel(R) 64] and everything is fine there.

I wonder if this behavior expected?

0 Kudos
0 Replies
Reply