Skip to content

Commit

Permalink
Merge branch 'jayeshkrishna/mira_homme_test_update_pio1' (PR #1480)
Browse files Browse the repository at this point in the history
Get HOMME tests to build on Mira. The following merge,

* Brings in the latest version of pio1 (includes changes to pio1
  cmake configure files required for this issue)
* Updates HOMME cmake configure files to include pio2 cmake
  modules

See Issue #1411

[BFB]

* jayeshkrishna/mira_homme_test_update_pio1:
  Add path to pio2 cmake modules for HOMME tests
  Updating PIO1 to latest master
  • Loading branch information
jayeshkrishna committed May 12, 2017
2 parents c8f9cfe + 8c20c40 commit 0a1351f
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 11 deletions.
11 changes: 4 additions & 7 deletions src/externals/pio1/pio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
IF (USER_CMAKE_MODULE_PATH)
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${USER_CMAKE_MODULE_PATH})
ELSE()
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../pio2/cmake")
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
ENDIF()
find_file( TESTFILE NAMES TryCSizeOf.f90 PATHS ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
get_filename_component( TESTFILEPATH ${TESTFILE} PATH)
Expand All @@ -29,9 +29,6 @@ IF(${WITH_CSIZEOF} STREQUAL FALSE)
endif()

# Netcdf is required

SET (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../pio2/cmake" ${CMAKE_MODULE_PATH})

#SET (NETCDF_FIND_COMPONENTS F90)
FIND_PACKAGE(NetCDF "4.3.3" COMPONENTS C Fortran)
IF (${NetCDF_Fortran_FOUND})
Expand All @@ -46,7 +43,7 @@ ENDIF ()
# PNetcdf is optional but used by default
OPTION(WITH_PNETCDF "Whether to build with PnetCDF" TRUE)
IF (${WITH_PNETCDF})
FIND_PACKAGE(PnetCDF REQUIRED)
FIND_PACKAGE(PnetCDF REQUIRED COMPONENTS Fortran)
ELSE ()
MESSAGE(WARNING "Warning: Not building with PNetcdf - cannot run all regression tests.")
ENDIF ()
Expand Down Expand Up @@ -84,8 +81,8 @@ IF(NetCDF_Fortran_FOUND)
ELSE()
SET(bld_PIO_DEFINITIONS ${bld_PIO_DEFINITIONS} -D_NONETCDF)
ENDIF()
IF(PnetCDF_C_FOUND)
SET(pio_include_dirs_ ${pio_include_dirs_} ${PNetCDF_INCLUDE_DIR})
IF(PnetCDF_Fortran_FOUND)
SET(pio_include_dirs_ ${pio_include_dirs_} ${PnetCDF_Fortran_INCLUDE_DIRS})
SET(bld_PIO_DEFINITIONS ${bld_PIO_DEFINITIONS} -D_PNETCDF)
ELSE()
SET(bld_PIO_DEFINITIONS ${bld_PIO_DEFINITIONS} -D_NOPNETCDF)
Expand Down
2 changes: 1 addition & 1 deletion src/externals/pio1/pio/pio.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module pio
! only pio_offset is intended for export from kinds
use pio_kinds, only : pio_offset

use piolib_mod, only : pio_initdecomp, &
use piolib_mod, only : pio_initdecomp, pio_set_rearr_opts, &
pio_openfile, pio_closefile, pio_createfile, pio_setdebuglevel, &
pio_seterrorhandling, pio_setframe, pio_init, pio_get_local_array_size, &
pio_freedecomp, pio_syncfile,pio_numtowrite,pio_numtoread,pio_setiotype, &
Expand Down
2 changes: 1 addition & 1 deletion src/externals/pio1/pio/pio_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module pio_types
!! @defgroup PIO_rearr_comm_fc_options PIO_rearr_comm_fc_options
!! @brief Type that defines the PIO rearranger options
!! @details
!! - enable_hs : Enable handshake (true/false)
!! - enable_hs : Enable handshake (true/false)
!! - enable_isend : Enable Isends (true/false)
!! - max_pend_req : Maximum pending requests (To indicated unlimited
!! number of requests use PIO_REARR_COMM_UNLIMITED_PEND_REQ)
Expand Down
75 changes: 74 additions & 1 deletion src/externals/pio1/pio/piolib_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module piolib_mod
public :: PIO_init, &
PIO_finalize, &
PIO_initdecomp, &
PIO_set_rearr_opts,&
PIO_openfile, &
PIO_syncfile, &
PIO_createfile, &
Expand Down Expand Up @@ -1602,7 +1603,7 @@ subroutine init_iosystem_rearr_options(iosystem)
#ifdef _NO_FLOW_CONTROL
iosystem%rearr_opts%fcd = PIO_rearr_comm_fc_2d_disable
#else
! We ignore the following flags
! We ignore the following flags
! 1) _MPISERIAL : The flow control code is never used when _MPISERIAL is set
! 2) _USE_COMP2IO_FC/_USE_IO2COMP_FC : These flags are not currently used
! (These were experimental flags). The user can explicitly control
Expand All @@ -1622,6 +1623,78 @@ subroutine init_iosystem_rearr_options(iosystem)

end subroutine init_iosystem_rearr_options

function PIO_set_rearr_opts(iosystem, comm_type, fcd,&
enable_hs_c2i, enable_isend_c2i,&
max_pend_req_c2i,&
enable_hs_i2c, enable_isend_i2c,&
max_pend_req_i2c) result(ierr)

use pio_types

type (iosystem_desc_t), intent(inout) :: iosystem
integer, intent(in) :: comm_type, fcd
logical, intent(in) :: enable_hs_c2i, enable_hs_i2c
logical, intent(in) :: enable_isend_c2i, enable_isend_i2c
integer, intent(in) :: max_pend_req_c2i, max_pend_req_i2c

integer :: ierr

ierr = PIO_NOERR

if(max_pend_req_c2i < 0) then
if(max_pend_req_c2i /= PIO_REARR_COMM_UNLIMITED_PEND_REQ) then
call piodie(__PIO_FILE__,__LINE__,&
"Invalid max pend req (comp to io) specified")
end if
end if
if(max_pend_req_i2c < 0) then
if(max_pend_req_i2c /= PIO_REARR_COMM_UNLIMITED_PEND_REQ) then
call piodie(__PIO_FILE__,__LINE__,&
"Invalid max pend req (io to comp) specified")
end if
end if

iosystem%rearr_opts%comm_type = comm_type

! Reset to defaults
iosystem%rearr_opts%comm_fc_opts_comp2io%enable_hs = .false.
iosystem%rearr_opts%comm_fc_opts_comp2io%enable_isend = .false.
iosystem%rearr_opts%comm_fc_opts_comp2io%max_pend_req = DEF_P2P_MAXREQ

iosystem%rearr_opts%comm_fc_opts_io2comp%enable_hs = .false.
iosystem%rearr_opts%comm_fc_opts_io2comp%enable_isend = .false.
iosystem%rearr_opts%comm_fc_opts_io2comp%max_pend_req = DEF_P2P_MAXREQ
if(iosystem%rearr_opts%comm_type == PIO_REARR_COMM_COLL) then
! Init/Reset rest of the structure to valid values
iosystem%rearr_opts%fcd = PIO_REARR_COMM_FC_2D_DISABLE
else if(iosystem%rearr_opts%comm_type == PIO_REARR_COMM_P2P) then
iosystem%rearr_opts%fcd = fcd
if(iosystem%rearr_opts%fcd == PIO_REARR_COMM_FC_2D_DISABLE) then
! Nothing to do here - the opts are already reset to defaults above
else if(iosystem%rearr_opts%fcd == PIO_REARR_COMM_FC_1D_COMP2IO) then
iosystem%rearr_opts%comm_fc_opts_comp2io%enable_hs = enable_hs_c2i
iosystem%rearr_opts%comm_fc_opts_comp2io%enable_isend = enable_isend_c2i
iosystem%rearr_opts%comm_fc_opts_comp2io%max_pend_req = max_pend_req_c2i
else if(iosystem%rearr_opts%fcd == PIO_REARR_COMM_FC_1D_IO2COMP) then
iosystem%rearr_opts%comm_fc_opts_io2comp%enable_hs = enable_hs_i2c
iosystem%rearr_opts%comm_fc_opts_io2comp%enable_isend = enable_isend_i2c
iosystem%rearr_opts%comm_fc_opts_io2comp%max_pend_req = max_pend_req_i2c
else if(iosystem%rearr_opts%fcd == PIO_REARR_COMM_FC_2D_ENABLE) then
iosystem%rearr_opts%comm_fc_opts_comp2io%enable_hs = enable_hs_c2i
iosystem%rearr_opts%comm_fc_opts_comp2io%enable_isend = enable_isend_c2i
iosystem%rearr_opts%comm_fc_opts_comp2io%max_pend_req = max_pend_req_c2i

iosystem%rearr_opts%comm_fc_opts_io2comp%enable_hs = enable_hs_i2c
iosystem%rearr_opts%comm_fc_opts_io2comp%enable_isend = enable_isend_i2c
iosystem%rearr_opts%comm_fc_opts_io2comp%max_pend_req = max_pend_req_i2c
else
call piodie(__PIO_FILE__,__LINE__, "Invalid flow control dir specified")
end if
else
call piodie(__PIO_FILE__,__LINE__, "Invalid comm type specified")
end if

end function PIO_set_rearr_opts

!>
!! @public
Expand Down
1 change: 0 additions & 1 deletion src/externals/pio1/pio/pionfput_mod.F90.in
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ contains
ierr = nfmpi_begin_indep_data(File%fh)

if(Ios%io_rank==0 .and. (ierr==NF_EINDEP .or. ierr==PIO_NOERR)) then
print *,__PIO_FILE__,__LINE__,index,count,trim(ival)
ierr = nfmpi_put_vara (File%fh, varid, int(index,kind=PIO_OFFSET), &
int(count,kind=PIO_OFFSET), ival, int(count,kind=PIO_OFFSET), &
MPI_CHARACTER)
Expand Down

0 comments on commit 0a1351f

Please sign in to comment.