Re: Derived types and allocatable
- From: Damian <damian@xxxxxxxxxx>
- Date: Thu, 8 May 2008 19:56:55 -0700 (PDT)
On May 8, 9:52 am, Steve Lionel <Steve.Lio...@xxxxxxxxxxxxx> wrote:
On Thu, 8 May 2008 09:05:09 -0700 (PDT), Damian <dam...@xxxxxxxxxx> wrote:
I will e-mail you my contact information. I can probably give you
enough information offline so that you could track down the issue
number.
Please do. It is probable that the fix went into an update to 10.1. Your
name and email address (at the time) should be all I need.
--
Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH
For email address, replace "invalid" with "com"
User communities for Intel Software Development Products
http://softwareforums.intel.com/
Intel Fortran Support
http://support.intel.com/support/performancetools/fortran
My Fortran blog
http://www.intel.com/software/drfortran
Name: Damian Rouson. At that time, my e-mail address was
damian.rouson@xxxxxxxxxxxxx That address is no longer active and
someone else submitted it on my behalf so it might be under her name
and e-mail address.
I found this code that I *think* was submitted with the bug report
(can't recall if this was for the first bug report, which was fixed,
or for the second, which was not fixed in the initial release of 10.1
but might be fixed in a more recent release):
MODULE Vector_Module
IMPLICIT NONE
PRIVATE ! hide all types & procedures by default
PUBLIC :: Vector ! expose type
PUBLIC :: Vector_ ! expose constructor
TYPE Vector
PRIVATE
REAL ,DIMENSION(:), ALLOCATABLE :: component
END TYPE Vector
CONTAINS
! ___________ Vector constructor: allocate/initialize state
variables _______
FUNCTION Vector_(num_elements) RESULT(this)
INTEGER ,INTENT(IN) :: num_elements
TYPE(Vector) :: this
ALLOCATE(this%component(num_elements))
this%component = 0.0
END FUNCTION Vector_
END MODULE Vector_Module
MODULE Double_Vector_Module
USE Vector_Module
IMPLICIT NONE
PRIVATE ! hide all types & procedures by default
PUBLIC :: Double_Vector ! expose type
PUBLIC :: Double_Vector_ ! expose constructor
TYPE Double_Vector
PRIVATE
TYPE(Vector) :: first_vector
TYPE(Vector) :: second_vector
END TYPE Double_Vector
CONTAINS
! ___________ Vector constructor: allocate/initialize state
variables _______
FUNCTION Double_Vector_(num_elements) RESULT(this)
INTEGER ,INTENT(IN) :: num_elements
TYPE(Double_Vector) :: this
this%first_vector = Vector_(num_elements)
this%second_vector = Vector_(num_elements)
END FUNCTION Double_Vector_
END MODULE Double_Vector_Module
PROGRAM main
USE Double_Vector_Module
IMPLICIT NONE
INTEGER ,PARAMETER :: loop_length=150
INTEGER ,PARAMETER :: vector_length=2**22 ! x 4 bytes/real = 16 MB
vectors
INTEGER :: i
TYPE(Double_Vector) :: duplicate
DO i=1,loop_length
PRINT *, i
duplicate = Double_Vector_(vector_length)
END DO
END PROGRAM main
These files are all time-stamped April 15, 2007. I named the file
containing the above main program "leak.f90." I named the following
file "noleak.f90":
PROGRAM main
USE Vector_Module
IMPLICIT NONE
INTEGER ,PARAMETER :: loop_length=1500
INTEGER ,PARAMETER :: vector_length=2**22 ! x 4 bytes/real = 16 MB
vectors
INTEGER :: i
TYPE(Vector) :: duplicate
DO i=1,loop_length
PRINT *, i
duplicate = Vector_(vector_length)
END DO
END PROGRAM main
So apparently the allocatable components have to be nested a couple of
levels deep to demonstrate the leak. In my application, I'm
interested in even deeper nesting, so I hope the leak fix is general
enough to handle arbitrarily deeply nested types.
Damian
.
- Follow-Ups:
- Re: Derived types and allocatable
- From: Steve Lionel
- Re: Derived types and allocatable
- References:
- Derived types and allocatable
- From: Gib Bogle
- Re: Derived types and allocatable
- From: Gib Bogle
- Re: Derived types and allocatable
- From: Kurt Kallblad
- Re: Derived types and allocatable
- From: Richard Maine
- Re: Derived types and allocatable
- From: Damian
- Re: Derived types and allocatable
- From: Steve Lionel
- Re: Derived types and allocatable
- From: Damian
- Re: Derived types and allocatable
- From: Steve Lionel
- Derived types and allocatable
- Prev by Date: Re: MPI code error raises a question
- Next by Date: Re: hillary's files
- Previous by thread: Re: Derived types and allocatable
- Next by thread: Re: Derived types and allocatable
- Index(es):
Relevant Pages
|
|