From 25467263df7c5b61e94d55b7c73208fa08a67127 Mon Sep 17 00:00:00 2001 From: apcraig Date: Tue, 20 Feb 2024 14:55:52 -0700 Subject: [PATCH] Update pio iotask default after further testing. There is a problems with PIO2 for some iotask values, see https://github.com/NCAR/ParallelIO/issues/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. --- .../cicedyn/infrastructure/io/io_pio2/ice_pio.F90 | 14 ++++++++------ configuration/scripts/options/set_env.iopio1p | 2 -- configuration/scripts/options/set_env.iopio2p | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 configuration/scripts/options/set_env.iopio1p delete mode 100644 configuration/scripts/options/set_env.iopio2p 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