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 126.96.36.199 [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 188.8.131.525 [Intel(R) 64] and everything is fine there.
I wonder if this behavior expected?