Skip to content

Commit

Permalink
Update pio iotask default after further testing. There is a problems
Browse files Browse the repository at this point in the history
with PIO2 for some iotask values, see NCAR/ParallelIO#1986.
The current implementation is a little less conservative in setting iotasks
but still should be robust.

Delete set_env for iopio1p and iopio2p, no longer used.
  • Loading branch information
apcraig committed Feb 20, 2024
1 parent a4d37c8 commit 2546726
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
14 changes: 8 additions & 6 deletions cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ subroutine ice_pio_init(mode, filename, File, clobber, fformat, &
nprocs = get_num_procs()
lstride = 4
lroot = min(1,nprocs-1)
liotasks = max(1,(nprocs-lroot)/lstride)
! Adjustments for PIO2 iotask issue, https://github.com/NCAR/ParallelIO/issues/1986
! liotasks = max(1,(nprocs-lroot)/lstride) ! very conservative
liotasks = max(1,nprocs/lstride - lroot/lstride) ! less conservative (note integer math)
! liotasks = 1 + (nprocs-lroot-1)/lstride ! optimal

if (present(iotasks)) then
if (iotasks /= -99) liotasks=iotasks
Expand All @@ -160,11 +163,10 @@ subroutine ice_pio_init(mode, filename, File, clobber, fformat, &

! adjust to fit in nprocs, preserve root and stride as much as possible
lroot = min(lroot,nprocs-1) ! lroot <= nprocs-1
! tcraig, should work better but aborts in pio2
!liotasks = min(liotasks, 1 + (nprocs-lroot-1)/lstride)
if (lroot + (liotasks-1)*lstride > nprocs-1) then
liotasks = max(1,(nprocs-lroot)/lstride)
endif
! Adjustments for PIO2 iotask issue, https://github.com/NCAR/ParallelIO/issues/1986
! liotasks = max(1,min(liotasks, (nprocs-lroot)/lstride)) ! very conservative
liotasks = max(1,min(liotasks,nprocs/lstride - lroot/lstride)) ! less conservative (note integer math)
! liotasks = max(1,min(liotasks, 1 + (nprocs-lroot-1)/lstride)) ! optimal

!--- initialize ice_pio_subsystem

Expand Down
2 changes: 0 additions & 2 deletions configuration/scripts/options/set_env.iopio1p

This file was deleted.

1 change: 0 additions & 1 deletion configuration/scripts/options/set_env.iopio2p

This file was deleted.

0 comments on commit 2546726

Please sign in to comment.