Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Merge PR# 1515 'Larofeticus/fix_config_pool_leak' into develop
Browse files Browse the repository at this point in the history
According to comment in #1501 config_pool entries created in halo
exchanges are no longer used and can be removed. Config_pool entries
when ported to halo data structure reuse also cause a memory leak.

According to comment in #1502 the code builds and passes testing.
  • Loading branch information
mark-petersen committed Mar 14, 2018
2 parents 9e729cd + 833a164 commit cd79751
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/framework/mpas_dmpar.F
Original file line number Diff line number Diff line change
Expand Up @@ -6800,8 +6800,6 @@ subroutine mpas_dmpar_exch_group_add_field(domain, groupName, fieldName, timeLev
do while (associated(exchGroupPtr))
if ( nLen == exchGroupPtr % nLen) then
if ( groupName(1:nLen) == exchGroupPtr % groupName(1:exchGroupPtr % nLen) ) then
call mpas_pool_add_config(exchGroupPtr % fieldPool, fieldName, timeLevelLocal)

! Add field to exchange group's fieldList
if ( associated(exchGroupPtr % fieldList) ) then
! If the field is already added, find it.
Expand Down Expand Up @@ -6923,9 +6921,6 @@ subroutine mpas_dmpar_exch_group_remove_field(domain, groupName, fieldName, iErr
do while (associated(exchGroupPtr))
if ( nLen == exchGroupPtr % nLen) then
if ( groupName(1:nLen) == exchGroupPtr % groupName(1:exchGroupPtr % nLen) ) then
! Remove after the transition to exchange_field_lists is complete
call mpas_pool_remove_config(exchGroupPtr % fieldPool, fieldName)
if ( associated(exchGroupPtr % fieldList) ) then
exchFieldListPtr => exchGroupPtr % fieldList
nullify(prevFieldListPtr)
Expand Down Expand Up @@ -7320,8 +7315,6 @@ subroutine mpas_dmpar_exch_group_reuse_halo_exch(domain, groupName, timeLevel, h
else
exchFieldListPtr % haloLayers(:) = .true.
end if
call mpas_pool_remove_config(exchGroupPtr % fieldPool, exchFieldListPtr % fieldName)
call mpas_pool_add_config(exchGroupPtr % fieldPool, exchFieldListPtr % fieldName, timeLevelLocal)
exchFieldListPtr => exchFieldListPtr % next
end do
end if
Expand Down

0 comments on commit cd79751

Please sign in to comment.