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

Commit

Permalink
Moved finalization of infrastructure (streams) etc before closing the…
Browse files Browse the repository at this point in the history
… log files.

Removed comments stating that certain log messages are printed to fort.1, since
this is no longer the case.
  • Loading branch information
climbfuji committed Sep 6, 2017
1 parent 9ca359c commit a5f8931
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/driver/mpas_subdriver.F
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,19 @@ subroutine mpas_finalize()
call mpas_timer_write()
call mpas_timer_finalize(domain_ptr)

!
! Finalize infrastructure
!
call MPAS_stream_mgr_finalize(domain_ptr % streamManager)

! Print out log stats and close log file
! (do this after timer stats are printed)
! (Do this after timer stats are printed and stream mgr finalized,
! but before framework is finalized because domain is destroyed there.)
call mpas_log_finalize(iErr)
if ( iErr /= 0 ) then
call mpas_dmpar_global_abort('ERROR: Log finalize failed for core ' // trim(domain_ptr % core % coreName))
end if

!
! Finalize infrastructure
!
call MPAS_stream_mgr_finalize(domain_ptr % streamManager)

call mpas_framework_finalize(domain_ptr % dminfo, domain_ptr)

deallocate(corelist % domainlist)
Expand Down
3 changes: 0 additions & 3 deletions src/framework/mpas_stream_manager.F
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ subroutine MPAS_stream_mgr_finalize(manager, ierr)!{{{

threadNum = mpas_threading_get_thread_num()

! DH* note that this is written to fort.1 if STREAM_DEBUG_WRITE is enabled (log file already closed?)
STREAM_DEBUG_WRITE('-- Called MPAS_stream_mgr_finalize()')

if (present(ierr)) ierr = MPAS_STREAM_MGR_NOERR
Expand All @@ -208,7 +207,6 @@ subroutine MPAS_stream_mgr_finalize(manager, ierr)!{{{
!
stream_cursor => manager % streams % head
do while (associated(stream_cursor))
! DH* note that this is written to fort.1 if STREAM_DEBUG_WRITE is enabled (log file already closed?)
STREAM_DEBUG_WRITE(' -- deleting stream '//trim(stream_cursor % name))
call MPAS_stream_mgr_destroy_stream(manager, stream_cursor % name, ierr=err_local)
stream_cursor => manager % streams % head
Expand Down Expand Up @@ -440,7 +438,6 @@ subroutine MPAS_stream_mgr_destroy_stream(manager, streamID, ierr)!{{{

threadNum = mpas_threading_get_thread_num()

! DH* note that this is written to fort.1 if STREAM_DEBUG_WRITE is enabled (log file already closed?)
STREAM_DEBUG_WRITE('-- Called MPAS_stream_mgr_destroy_stream()')

if (present(ierr)) ierr = MPAS_STREAM_MGR_NOERR
Expand Down

0 comments on commit a5f8931

Please sign in to comment.