Skip to content

Commit

Permalink
Fix MockMpi.
Browse files Browse the repository at this point in the history
  • Loading branch information
tclune committed Mar 12, 2024
1 parent 645af7a commit e856c54
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Another fix for MockMpi layer. With the workaround for NAG in previous release, GFortran 13 detects some inconsistencies that are now resolved.

## [1.13.1] - 2024-03-07

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions src/MockMpi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module mpi
public :: MPI_ANY_SOURCE

integer, parameter :: MPI_ADDRESS_KIND = INT64
integer, parameter :: MPI_STATUS_SIZE = 1
integer, parameter :: MPI_STATUS_IGNORE(MPI_STATUS_SIZE) = [0]
integer, parameter :: MPI_STATUS_SIZE = 6
integer, parameter :: MPI_STATUS_IGNORE(MPI_STATUS_SIZE) = spread(0, dim=1, ncopies=MPI_STATUS_SIZE)
integer, parameter :: MPI_LOGICAL = 9
integer, parameter :: MPI_SUCCESS = 0
integer, parameter :: MPI_INFO_NULL = 0
Expand Down
10 changes: 6 additions & 4 deletions tests/Test_MpiCommConfig.pf
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
module Test_MpiCommConfig
use mpi
use funit
use PFL_MpiCommConfig
use gftl2_StringUnlimitedMap, only: StringUnlimitedMap
use PFL_FormatString
implicit none


contains

@test
subroutine test_default()
use mpi
! use mpi_comm_world if necessary.
! Note that the usage is
! read-only, so does not violate encapsulation of MPI
Expand All @@ -35,7 +34,8 @@ contains

@test
subroutine test_override_keywords()
! use mpi_comm_world if necessary.
use mpi
! use mpi_comm_world if necessary.
! Note that the usage is
! read-only, so does not violate encapsulation of MPI
! communicators.
Expand All @@ -58,7 +58,8 @@ contains

@test
subroutine test_with_comm()
! Note this test is a bit weak, as the mock layer does not actually
use mpi
! Note this test is a bit weak, as the mock layer does not actually
! use comm. But it ensures the interface is in place,
! and the implementation is trivial extension.
character(len=:), allocatable :: s
Expand All @@ -80,6 +81,7 @@ contains

@test
subroutine test_with_multi_comm()
use mpi
! Note this test is a bit weak, as the mock layer does not actually
! use comm. But it ensures the interface is in place,
! and the implementation is trivial extension.
Expand Down
10 changes: 7 additions & 3 deletions tests/Test_MpiFormatter.pf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Test_MpiFormatter
use funit
use mpi
use PFL_MpiFormatter
use PFL_LogRecord
use PFL_SeverityLevels
Expand All @@ -10,6 +9,7 @@ contains

@test
subroutine test_no_reference()
use mpi
type (MpiFormatter) :: f
type (LogRecord) :: rec
integer :: comm ! not really used due to mock
Expand All @@ -24,6 +24,7 @@ contains

@test
subroutine test_one_comm()
use mpi
type (MpiFormatter) :: f
type (LogRecord) :: rec

Expand All @@ -43,7 +44,8 @@ contains

@test
subroutine test_multi_comm()
type (MpiFormatter) :: f
use mpi
type (MpiFormatter) :: f
type (LogRecord) :: rec

integer :: comm = 1 ! not really used due to mock
Expand All @@ -62,6 +64,7 @@ contains

@test
subroutine test_multi_comm_default_fmt()
use mpi
type (MpiFormatter) :: f
type (LogRecord) :: rec

Expand All @@ -80,7 +83,8 @@ contains

@test
subroutine test_alt_names()
type (MpiFormatter) :: f
use mpi
type (MpiFormatter) :: f
type (LogRecord) :: rec

character(len=:), allocatable :: fmt
Expand Down

0 comments on commit e856c54

Please sign in to comment.