diff --git a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 index f5b459801..565e7adbb 100644 --- a/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 +++ b/cicecore/cicedyn/infrastructure/io/io_pio2/ice_pio.F90 @@ -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 @@ -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 diff --git a/configuration/scripts/options/set_env.iopio1p b/configuration/scripts/options/set_env.iopio1p deleted file mode 100644 index 1a92353ce..000000000 --- a/configuration/scripts/options/set_env.iopio1p +++ /dev/null @@ -1,2 +0,0 @@ -setenv ICE_IOTYPE pio1 -setenv ICE_CPPDEFS -DUSE_PIO1 diff --git a/configuration/scripts/options/set_env.iopio2p b/configuration/scripts/options/set_env.iopio2p deleted file mode 100644 index 415005ac4..000000000 --- a/configuration/scripts/options/set_env.iopio2p +++ /dev/null @@ -1 +0,0 @@ -setenv ICE_IOTYPE pio2