Changes between Initial Version and Version 1 of Ticket #409


Ignore:
Timestamp:
03/04/10 18:32:06 (14 years ago)
Author:
arango
Comment:

Yes, good catch!!! This type of bugs are very difficult to find.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #409

    • Property ResolutionFixed
    • Property Status newclosed
    • Property Summary swan - mct coupling memory bugSWAN - MCT coupling memory bug
  • Ticket #409 – Description

    initial v1  
    1 During the coupling of roms to swan, in the file SWAN/Src/waves_coupler.F, there is a call
     1During the coupling of ROMS to SWAN, in the file '''SWAN/Src/waves_coupler.F''', there is a call
    22
     3{{{
    34      CALL GlobalSegMap_Ordpnts (GSMapSWAN, MyRank, points)
     5}}}
    46
    5 This call uses MCT to obtain the local grid points for each tile. The corresponding mct routine allocates memory for the variable 'points', and then computes those values. In the waves_coupler routine, I also had allocated the variable points and then deallocated the memory. However, since both mct and I were allocating the memory, it led to a slow but steady increase in memory cache. This only seemed to occur on some compilers for certain applications, and was extremely difficult to identify. The correction is to comment out lines 295 and 297 in waves_coupler.F. This changes the code from
     7This call uses '''MCT''' to obtain the local grid points for each tile. The corresponding mct routine allocates memory for the variable '''points''', and then computes those values. In the '''waves_coupler''' routine, I also had allocated the variable '''points''' and then deallocated the memory. However, since both '''MCT''' and I were allocating the memory, it led to a slow but steady increase in memory cache. This only seemed to occur on some compilers for certain applications, and was extremely difficult to identify. The correction is to comment out lines 295 and 297 in '''waves_coupler.F'''. This changes the code from
    68
     9{{{
     10!
    711!  Allocate attribute vector array used to export/import data.
    812!
     
    1115      avdata=0.0_r8
    1216      points=0
     17}}}
    1318
     19change to:
    1420
    15 change to ::::
    16 
     21{{{
     22!
    1723!  Allocate attribute vector array used to export/import data.
    1824!
    1925      allocate ( avdata(gsmsize),stat=ierr )
    20 !     allocate ( points(gsmsize),stat=ierr )
     26!!    allocate ( points(gsmsize),stat=ierr )
    2127      avdata=0.0_r8
    22 !     points=0
     28!!    points=0
     29}}}
    2330
    2431I tried this on ifort and pgi and it works fine.