- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We currently have MS Fortran Powerstation 4.0. We are experiencing an important problem regarding the deallocation of pointers. We would like to know if this problem still persists in Compaq Visual Fortran.
Thanks,
Louis
We currently have MS Fortran Powerstation 4.0. We are experiencing an important problem regarding the deallocation of pointers. We would like to know if this problem still persists in Compaq Visual Fortran.
Thanks,
Louis
C####################################################################### C C This test has been performed with MS Fortran Power Station 4.0 C C This program creates a linked list of "item". C It test the speed of allocation and speed of deallocation C C We found that the deallocation is made from the last item to C the first is adequate. C C But the deallocation becomes very slow when it is made from the first item C to the last. It can be more than 100 times slower!!! C C If additionnal independent linked lists are defined, the deallocation speed C decreases exponentially when made from the first item to the last. C C Can you tell me if this problem still occurs in the new version C of Compaq Visual Fortran 6.5. C C To test this program all you need to do is to create a console application C and change the value of KORDER as follows C C KORDER = 1 ! 1 = Deallocate from first to last C KORDER = 2 ! 2 = Deallocate from last to first C C####################################################################### C Program Test C TYPE item integer KVAL integer KOTHER C TYPE (item),POINTER previous_item TYPE (item),POINTER next_item END TYPE item C INTEGER KORDER,II,KTOT C TYPE (item),POINTER first_item TYPE (item),POINTER last_item C C------------------ type(item), POINTER parent_item type(item), POINTER current_item C------------------ C KORDER = 1 ! 1 = Deallocate from first to last C KORDER = 2 ! 2 = Deallocate from last to first C C Initialization KTOT = 0 NULLIFY(first_item) NULLIFY(last_item) C C Add 50000 Items DO II = 1,50000 allocate(current_item) nullify(current_item%next_item) C IF (KTOT.LE.0) THEN first_item=>current_item nullify(current_item%previous_item) KTOT = 1 ELSE parent_item=>last_item parent_item%next_item=>current_item current_item%previous_item=>parent_item KTOT = KTOT + 1 END IF current_item%KVAL = II last_item=>current_item END DO C IF (KORDER.EQ.1) THEN C SLOW deallocation current_item=>first_item DO II=1,KTOT parent_item=>current_item%next_item if (associated(current_item)) deallocate(current_item) current_item=>parent_item END DO ELSE C QUICK deallocation current_item=>last_item DO II=1,KTOT parent_item=>current_item%previous_item if (associated(current_item)) deallocate(current_item) current_item=>parent_item END DO END IF C END C C#######################################################################
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You also sent this to us at vf-support. My response was as follows:
Compaq Visual Fortran's compiler and language libraries are our own and not
derived from Microsoft's. Visual Fortran 6.5 executes your test program very
quickly, using either value of KORDER.
Steve
Compaq Visual Fortran's compiler and language libraries are our own and not
derived from Microsoft's. Visual Fortran 6.5 executes your test program very
quickly, using either value of KORDER.
Steve
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page