Skip to content

Commit

Permalink
Merge pull request #1934 from GEOS-ESM/hotfix/bmauer/fix_extdatadrive…
Browse files Browse the repository at this point in the history
…r_with_dedicted_oserver

Reenable use of multi group server in ExtDataDriver.x
  • Loading branch information
mathomp4 authored Jan 19, 2023
2 parents 5d0c6ec + 5cdc3ad commit cfad78e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.34.2] - 2023-01-19

### Fixed

- Fixed bug with ExtDataDriver.x when enabling oserver on dedicated resources

## [2.34.1] - 2023-01-13

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_policy (SET CMP0054 NEW)

project (
MAPL
VERSION 2.34.1
VERSION 2.34.2
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the default build type to release
Expand Down
41 changes: 30 additions & 11 deletions Tests/ExtDataDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ module ExtDataDriverMod
character(:), allocatable :: name
type(ServerManager) :: cap_server
type (ESMF_LogKind_Flag) :: esmf_logging_mode = ESMF_LOGKIND_NONE
type(MpiServer), pointer :: i_server=>null()
type(MpiServer), pointer :: o_server=>null()
type(DirectoryService) :: directory_service
type (MAPL_CapOptions) :: cap_options
type(SplitCommunicator) :: split_comm

contains
procedure :: run
procedure :: initialize_io_clients_servers
procedure :: finalize_io_clients_servers
procedure :: initialize_mpi
end type ExtDataDriver

Expand Down Expand Up @@ -60,7 +58,7 @@ function newExtDataDriver(name,set_services, unusable, cap_options, rc) result(d
driver%cap_options = MAPL_CapOptions()
endif
call driver%initialize_mpi()
call MAPL_Initialize(rc=status)
call MAPL_Initialize(comm=MPI_COMM_WORLD,rc=status)
_VERIFY(status)
_RETURN(_SUCCESS)
end function newExtDataDriver
Expand All @@ -86,7 +84,7 @@ subroutine run(this,RC)
character(len=:), pointer :: cname
type(StringVector) :: cases
type(StringVectorIterator) :: iter
type(SplitCommunicator) :: split_comm
type(SplitCommunicator) :: split_comm

CommCap = MPI_COMM_WORLD

Expand Down Expand Up @@ -136,11 +134,8 @@ subroutine run(this,RC)
call iter%next()
enddo

call this%cap_server%finalize()
end select

call MPI_Barrier(CommCap,status)
_VERIFY(STATUS)
! Finalize framework
! ------------------

Expand All @@ -151,7 +146,8 @@ subroutine run(this,RC)
open(99,file='egress',form='formatted')
close(99)
end if


call this%finalize_io_clients_servers()
call MAPL_Finalize(rc=status)
_VERIFY(status)
call mpi_finalize(status)
Expand All @@ -172,19 +168,42 @@ subroutine initialize_io_clients_servers(this, comm, unusable, rc)
integer :: status

_UNUSED_DUMMY(unusable)

call this%cap_server%initialize(comm, &
application_size=this%cap_options%npes_model, &
nodes_input_server=this%cap_options%nodes_input_server, &
nodes_output_server=this%cap_options%nodes_output_server, &
npes_input_server=this%cap_options%npes_input_server, &
npes_output_server=this%cap_options%npes_output_server, &
rc=status)
oserver_type=this%cap_options%oserver_type, &
npes_backend_pernode=this%cap_options%npes_backend_pernode, &
isolate_nodes = this%cap_options%isolate_nodes, &
fast_oclient = this%cap_options%fast_oclient, &
with_profiler = this%cap_options%with_io_profiler, &
rc=status)
_VERIFY(status)
_RETURN(_SUCCESS)

end subroutine initialize_io_clients_servers

subroutine finalize_io_clients_servers(this, unusable, rc)
class (ExtDataDriver), target, intent(inout) :: this
class (KeywordEnforcer), optional, intent(in) :: unusable
integer, optional, intent(out) :: rc
type(SplitCommunicator) :: split_comm

_UNUSED_DUMMY(unusable)
call this%cap_server%get_splitcomm(split_comm)
select case(split_comm%get_name())
case('model')
call i_Clients%terminate()
call o_Clients%terminate()
end select
call this%cap_server%finalize()
_RETURN(_SUCCESS)

end subroutine finalize_io_clients_servers

subroutine initialize_mpi(this, unusable, rc)
class (ExtDataDriver), intent(inout) :: this
class (KeywordEnforcer), optional, intent(in) :: unusable
Expand Down

0 comments on commit cfad78e

Please sign in to comment.