diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a029f3bad0c..07b86dd295ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.6] - 2020-04-15 + +### Fixed + +- Added code to suppress (seemingly) spurious MPI_Finalize errors at end + of model run. Suppression does not happen if built with + `-DCMAKE_BUILD_TYPE=Debug` + ## [2.0.5] - 2020-04-13 ### Fixed diff --git a/MAPL_Base/CMakeLists.txt b/MAPL_Base/CMakeLists.txt index 15e162f0ab71..548133241a1d 100644 --- a/MAPL_Base/CMakeLists.txt +++ b/MAPL_Base/CMakeLists.txt @@ -67,6 +67,10 @@ esma_add_library(${this} SRCS ${srcs} DEPENDENCIES GMAO_pFIO MAPL_cfio_r4 gftl-s target_compile_options (${this} PRIVATE $<$:${OpenMP_Fortran_FLAGS}>) target_compile_definitions (${this} PRIVATE TWO_SIDED_COMM MAPL_MODE) +if (NOT (CMAKE_BUILD_TYPE MATCHES Debug)) + target_compile_definitions(${this} PRIVATE BUILD_TYPE_IS_NOT_DEBUG) +endif () + # Kludge for OSX security and DYLD_LIBRARY_PATH ... foreach(dir ${OSX_EXTRA_LIBRARY_PATH}) target_link_libraries(${this} PUBLIC "-Xlinker -rpath -Xlinker ${dir}") diff --git a/MAPL_Base/MAPL_Cap.F90 b/MAPL_Base/MAPL_Cap.F90 index cdcc33a50333..ee55696df912 100644 --- a/MAPL_Base/MAPL_Cap.F90 +++ b/MAPL_Base/MAPL_Cap.F90 @@ -582,6 +582,13 @@ subroutine finalize_mpi(this, unusable, rc) _UNUSED_DUMMY(unusable) if (.not. this%mpi_already_initialized) then +#ifdef BUILD_TYPE_IS_NOT_DEBUG + ! Intel MPI at NCCS seems to have spurious MPI_Finalize errors that do + ! not affect the answer or even the finalize step. This call suppresses + ! the errors. + call MPI_Comm_set_errhandler(this%comm_world,MPI_ERRORS_RETURN,ierror) + _VERIFY(ierror) +#endif call MPI_Finalize(ierror) _VERIFY(ierror) end if