Skip to content

Commit

Permalink
Merge pull request #101 from Goddard-Fortran-Ecosystem/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tclune authored Sep 26, 2023
2 parents 6dfb996 + f7adff6 commit 5d596b3
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 42 deletions.
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@ endif()
include(CheckCompilerCapabilities)
include(check_intrinsic_kinds RESULT_VARIABLE found)

if (MPI MATCHES YES)
if (NOT SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
if (NOT DISABLE_MPI_LOCK MATCHES YES)
message (FATAL_ERROR
"Version of MPI is too old to support MPI_Alloc_mem() with C_PTR argument.
To use MPI use -DDISABLE_MPI_LOCK=YES."
)
endif ()
endif ()
endif ()


add_subdirectory(src)
add_subdirectory(doc EXCLUDE_FROM_ALL)

Expand Down
32 changes: 18 additions & 14 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Workarounds for MPICH C_LOC missing interface (https://github.com/pmodels/mpich/issues/6691)

## [1.10.0] - 2023-04-17

### Added
Expand All @@ -28,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.9.4] - 2023-04-12

### Fixed

- Formatter logic to get simulation time was broken if the default date format is used.

## [1.9.3] - 2023-01-25
Expand Down Expand Up @@ -118,7 +122,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Pervasive return codes for all procedures with potentially failing branch.
Added as optional arguments for backward compatibility.

### Changed

- Introduced CMake namespace. Upstream projects should now specify dependency
Expand Down Expand Up @@ -172,7 +176,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Modified name of Pair type in gFTL maps. These are not used within
pFlogger outside of their host modules, but it is more consistent with
the latest gFTL-shared and may help anyone that tries to port with XLF.


## [1.4.1] - 2020-05-01

Expand All @@ -195,7 +199,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- minor bug in default fmt_ for MpiFormatter
"rank" should have been "mpi_rank".

## [1.3.6] - 2020-04-16

### Fixed
Expand All @@ -207,7 +211,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Mostly workarounds for gFortran
- Also corrections for Cmake for some configurations

## [1.3.4] - 2020-04-08

### Added
Expand All @@ -217,13 +221,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A problem with link-time dependency injection for mock MPI was
fixed with generator expressions. Previously the fix for tests broke
the examples


## [1.3.3] - 2020-04-06

### Changed
- Must use true/false instead of .true./.false. for YAML

### Fixed
- Fixed CMake test for support of MPI_ALLOC_MEM
- Improved Cmake handling of mock to allow tests to compile
Expand All @@ -245,10 +249,10 @@ Bugfix
### Added

### Changed

### Fixed
- Needed to enable cmake testing.

## [1.3.0] - 2020-03-11

### Added
Expand All @@ -263,21 +267,21 @@ Bugfix
. eliminates redundant code
. makes container types are consistent across projects
- Now uses yafyaml for YAML processing (much more complete YAML subset)

### Fixed

## [1.2.0] - 2018-12-18

Releasing as open source.

- including NOSA COPYRIGHT (soon to be changed to Apache)
- including LICENSE
- adding forgotten compiler-specific cmake files (oops)

## [1.1.0] - 2018-08-08

Mists of time ...

## [1.0.0] - 2018-08-03

Mists of time ...
14 changes: 7 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,13 @@ set(SRCS
FormatTokenVector.F90
)

if (MPI_FOUND)
if (MPI_FOUND)
list (APPEND SRCS
MpiFilter.F90
MpiFormatter.F90
MpiCommConfig.F90
MpiLock.F90
)
if (SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
list (APPEND SRCS MpiLock.F90)
endif ()

endif ()

set (bin ${CMAKE_CURRENT_BINARY_DIR} )
Expand All @@ -73,6 +70,9 @@ if (MPI_FOUND)
target_link_libraries (${this} PRIVATE
$<INSTALL_INTERFACE:MPI::MPI_Fortran>)
target_compile_definitions(${this} PRIVATE _LOGGER_USE_MPI)
if (SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
target_compile_definitions(${this} PRIVATE SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
endif ()
endif ()


Expand Down Expand Up @@ -100,10 +100,10 @@ if (MPI_FOUND)
else ()
target_link_libraries (pflogger PRIVATE MPI::MPI_Fortran)
endif ()

endif()


set (dest "PFLOGGER-${PFLOGGER_VERSION_MAJOR}.${PFLOGGER_VERSION_MINOR}")

target_include_directories(${this} PUBLIC
Expand Down
12 changes: 9 additions & 3 deletions src/MpiLock.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ subroutine init(this, rc)

integer :: status
integer :: sizeof_logical
integer(kind=MPI_ADDRESS_KIND) :: sz
integer(kind=MPI_ADDRESS_KIND) :: sz, int64handle
integer :: old_comm

if (this%is_initialized()) then
_RETURN(_SUCCESS,rc)
endif

old_comm = this%comm
call MPI_Comm_dup(old_comm, this%comm, status)
_VERIFY(status,'',rc)
Expand Down Expand Up @@ -96,8 +96,14 @@ subroutine init(this, rc)
call MPI_Type_extent(MPI_LOGICAL, sizeof_logical, status)
_VERIFY(status,'',rc)
sz = this%npes * sizeof_logical
#if defined(SUPPORT_FOR_MPI_ALLOC_MEM_CPTR)
call MPI_Alloc_mem(sz, MPI_INFO_NULL, this%locks_ptr, status)
_VERIFY(status,'',rc)
#else
call MPI_Alloc_mem(sz, MPI_INFO_NULL, int64handle, status)
_VERIFY(status,'',rc)
this%locks_ptr = transfer(int64handle, this%locks_ptr)
#endif

call c_f_pointer(this%locks_ptr, scratchpad, [this%npes])
scratchpad = .false.
Expand Down Expand Up @@ -190,7 +196,7 @@ subroutine release(this, rc)
end if
end do
end if

if (next_rank /= -1) then
call MPI_Send(buffer, 0, MPI_LOGICAL, next_rank, &
& LOCK_TAG, this%comm, status)
Expand Down
8 changes: 2 additions & 6 deletions src/pflogger.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ module pflogger
use PFL_FastFormatter
use PFL_WrapArray
#ifdef _LOGGER_USE_MPI
# ifdef SUPPORT_FOR_MPI_ALLOC_MEM_CPTR
use PFL_MpiLock
use PFL_MpiFilter
use PFL_MpiFormatter
# endif
#endif
use PFL_RotatingFileHandler
use gFTL2_StringUnlimitedMap
Expand Down Expand Up @@ -58,12 +56,10 @@ module pflogger
public :: finalize_severity_levels

#ifdef _LOGGER_USE_MPI
# ifdef SUPPORT_FOR_MPI_ALLOC_MEM_CPTR
public :: MpiLock
public :: MpiFilter
public :: MpiFormatter
# endif
#endif
#endif

public :: set_throw_fptr
public :: StringUnlimitedMap
Expand All @@ -77,7 +73,7 @@ subroutine initialize()
call set_last_resort(StreamHandler())

end subroutine initialize


subroutine finalize()

Expand Down

0 comments on commit 5d596b3

Please sign in to comment.