From 0cc5d0240b90b8b7c02c15c7ecdd5dbc5b6fa93e Mon Sep 17 00:00:00 2001 From: apcraig Date: Thu, 16 May 2024 11:01:48 -0600 Subject: [PATCH] Update a decomp check, allocate return code check, and documentation --- cicecore/cicedyn/infrastructure/ice_memusage.F90 | 2 +- cicecore/shared/ice_distribution.F90 | 5 ----- doc/source/user_guide/ug_implementation.rst | 6 ++++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cicecore/cicedyn/infrastructure/ice_memusage.F90 b/cicecore/cicedyn/infrastructure/ice_memusage.F90 index 1170bd4e2..45b882879 100644 --- a/cicecore/cicedyn/infrastructure/ice_memusage.F90 +++ b/cicecore/cicedyn/infrastructure/ice_memusage.F90 @@ -50,7 +50,7 @@ logical function ice_memusage_allocErr(istat, errstr) character(*),parameter :: subname = '(ice_memusage_allocErr)' ice_memusage_allocErr = .false. - if (istat > 0) then + if (istat /= 0) then ice_memusage_allocErr = .true. if (present(errstr)) then write(nu_diag,*) 'ERROR: '//trim(errstr) diff --git a/cicecore/shared/ice_distribution.F90 b/cicecore/shared/ice_distribution.F90 index 007660ae5..d0768fc5a 100644 --- a/cicecore/shared/ice_distribution.F90 +++ b/cicecore/shared/ice_distribution.F90 @@ -933,11 +933,6 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) end do newDistrb%numLocalBlocks = newDistrb%blockCnt(my_task+1) - if (newDistrb%numLocalBlocks < 0) then - call abort_ice(subname//'ERROR: processors left with no blocks', & - file=__FILE__, line=__LINE__) - return - endif ! set local blockGlobalID array allocate(newDistrb%blockGlobalID(newDistrb%numLocalBlocks), stat=istat) diff --git a/doc/source/user_guide/ug_implementation.rst b/doc/source/user_guide/ug_implementation.rst index 246b2f76e..e5c197f32 100644 --- a/doc/source/user_guide/ug_implementation.rst +++ b/doc/source/user_guide/ug_implementation.rst @@ -215,8 +215,10 @@ four subdomains. The user sets the ``NTASKS`` and ``NTHRDS`` settings in **cice.settings** and chooses a block size, ``block_size_x`` :math:`\times`\ ``block_size_y``, and decomposition information ``distribution_type``, ``processor_shape``, -and ``distribution_type`` in **ice_in**. ``max_blocks`` is computed -automatically if set to a value of -1, but it can also be set by the user. +and ``distribution_wgt`` in **ice_in**. If ``max_blocks=-1``, the model +will calculate the number of blocks needed for each task. ``max_blocks`` +can also be set by the user, although this may use extra memory and the +model will abort if ``max_blocks`` is set too small for the decomposition. This information is used to determine how the blocks are distributed across the processors, and how the processors are distributed across the grid domain. The model is parallelized over blocks