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

no automatic deallocation with -g -openmp

lcoul
Beginner
279 Views

In attachment, you will find a short program demonstrating the problem.

A private allocatable array is created when calling a subroutine. The array is passed as argument with the attributes ALLOCATABLE and INTENT(out). It means that the array is first automatically deallocated at the entrance of the subroutine if it is already allocated.

For the sequential version, all seems OK, with or without the flag -g :

coul@b10p5001:~/test$ ifort demo.f90
coul@b10p5001:~/test$ ./a.out
   1.00000000000000     
   2.00000000000000     
   3.00000000000000     
   4.00000000000000     
   5.00000000000000


But with the compilation flags -g -openmp, I get :

coul@b10p5001:~/test$ ifort -g -openmp demo.f90
coul@b10p5001:~/test$ ./a.out
forrtl: severe (151): allocatable array is already allocated
forrtl: severe (151): allocatable array is already allocated

Notice that all seems OK if I delete the flag -g

64 bit version :

coul@b10p5001:~/test$ ifort --version
ifort (IFORT) 13.0.0 20120731
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.



0 Kudos
3 Replies
Kevin_D_Intel
Employee
279 Views
I do not see the attachment. At your convenience, could you try attaching again please?
0 Kudos
Kevin_D_Intel
Employee
279 Views

The issue occurs in conjunction with de-optimizing (to -O0) implicit with -g or explicitly with -O1 or -O0. You can avoid the error by explicitly asserting -O2 when using -g. I reported this defect to Development (internal tracking id below) and will update the thread as I learn more. Thank you for the convenient reproducer also.

(Internal tracking id: DPD200237628)

(Resolution Update on 04/05/2013): This defect is fixed in the Intel Fortran Composer XE 2013 Update 3 (2013.3.163 - Linux)

0 Kudos
Kevin_D_Intel
Employee
279 Views

This defect is fixed in the Intel Fortran Composer XE 2013 Update 3 (2013.3.163 - Linux)

0 Kudos
Reply