Re: Derived types and allocatable



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
.



Relevant Pages

  • Re: How to refresh Debian to install software set
    ... Fix one machine to function correctly, then duplicate the selections using the method described by "s. ... Fix one machine to function correctly, then use the df/netcat method to duplicate the hard disk partition. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: A very Challenging Question?
    ... Distinct gets rid of all duplicate values, but once again we still have the ... (Named GPSData) ... there TXDates and TXTimes are the same. ... is isolated from all others as the only one with it's own fixdate and fix ...
    (microsoft.public.access.queries)
  • Re: [PATCH] [-mm] FS: file name must be unique in the same dir in procfs
    ... Then I'd say fix the callers. ... duplicate names are totally unusable for user space. ... We should fix this kind of bugs ASAP if there are any. ... Bug report and a simple fix can be found here: ...
    (Linux-Kernel)
  • Re: 2.6.16-rc6-mm2
    ... architectures, which all duplicate this piece of code: ... and to do this fix on the asm-generic headers. ... I've never seen any evidence that the complex and bloated code generated by ...
    (Linux-Kernel)
  • Re: TR 24731 approved
    ... Mr Gwyn offered the fix of an implicit argument that would ... committee had good and proper reasons for leaving gets in C89, ... of what trigraphs are that you can avoid them. ...
    (comp.std.c)