New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 2462 for branches/DEV_r2460_v3_3beta_NOL/NEMOGCM/EXTERNAL/XMLIO_SERVER/src/IOSERVER/mod_ioclient_para.F90 – NEMO

Ignore:
Timestamp:
2010-12-07T18:56:19+01:00 (13 years ago)
Author:
acc
Message:

DEV_r2460_v3_3beta_NOL. Changes to v3.3beta to improve assignment of ocean processes to ioserver processes when discarding land-only regions. See ticket #776

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r2460_v3_3beta_NOL/NEMOGCM/EXTERNAL/XMLIO_SERVER/src/IOSERVER/mod_ioclient_para.F90

    r2281 r2462  
    1717#endif 
    1818  USE mpi_mod 
     19  USE mod_event_parameters 
    1920  IMPLICIT NONE 
    2021    INTEGER :: NEW_COMM 
     
    2627    INTEGER :: nb_server_io   
    2728    INTEGER,ALLOCATABLE :: proc_color(:)  
    28     INTEGER :: i 
     29    INTEGER :: i, ix, jpni_reg, jpnj_reg 
    2930    INTEGER :: div,remain 
    3031    INTEGER :: group_color 
    3132    INTEGER :: Comm_client_server 
    3233    CHARACTER(LEN=6) :: oasis_server_id 
     34    LOGICAL :: ln_around, ln_use_allproc 
    3335     
    3436    IF (using_oasis) THEN 
     
    5153 
    5254    nb_server_io=global_size-mpi_size 
    53     div=mpi_size/nb_server_io 
    54     remain=MOD(mpi_size,nb_server_io) 
    55      
    56     IF (mpi_rank<remain*(div+1)) THEN 
    57       group_color=mpi_rank/(div+1) 
     55!    
     56! Need to be cleverer at setting group_colour when jpni*jpnj /= jpnij 
     57! nregproc_in holds the list of equivalent ranks in a jpni by jpnj decomposition 
     58! which has retained the land-only areas. If jpni*jpnj= jpnij then nregproc_in(mpi_size) 
     59! should equal mpi_size-1 and nregproc_in(mpi_rank+1) = mpi_rank for all mpi_rank. 
     60! 
     61    ln_use_allproc = .true. 
     62    ALLOCATE(nregproc_in(mpi_size)) 
     63    INQUIRE (file='layout.dat', exist=ln_around) 
     64    IF (ln_around) THEN 
     65! use it 
     66     OPEN(UNIT=123,FILE='layout.dat') 
     67     READ(123,'(48X,2i8,/)',ERR=606,END=606) jpni_reg, jpnj_reg 
     68     do ix = 1,mpi_size 
     69      READ(123,'(45X,I5)',ERR=606,END=606) nregproc_in(ix) 
     70     end do 
     71     ln_use_allproc = .false. 
     72 606 CLOSE(123) 
     73    ENDIF 
     74    IF ( ln_use_allproc ) THEN 
     75! 
     76! Either layout.dat does not exist or the reading of nregproc_in has failed. 
     77! Default to regular decomposition with no omitted land-only regions. 
     78! 
     79     do ix = 1,mpi_size 
     80      nregproc_in(ix) = ix - 1 
     81     end do 
     82! 
     83! jpni_reg and jpnj_reg are not known; just have to make sure jpni_reg*jpnj_reg=mpi_size 
     84! 
     85     jpni_reg=mpi_size 
     86     jpnj_reg=1 
     87    ENDIF 
     88 
     89    div=(jpni_reg*jpnj_reg)/nb_server_io 
     90    remain=MOD(jpni_reg*jpnj_reg,nb_server_io) 
     91  
     92! 
     93! Note need to add 1 to mpi_rank when indexing nregproc_in since nregproc_in is  
     94! indexed 1 to mpi_size but mpi_rank ranges from 0 to mpi_size-1 
     95! 
     96    IF (nregproc_in(mpi_rank+1)<remain*(div+1)) THEN 
     97      group_color=nregproc_in(mpi_rank+1)/(div+1) 
    5898    ELSE 
    59       group_color=(nb_server_io-1)-(mpi_size-1-mpi_rank)/div 
     99      group_color=(nb_server_io-1)-(jpni_reg*jpnj_reg - 1 -nregproc_in(mpi_rank+1))/div 
    60100    ENDIF 
    61101 
Note: See TracChangeset for help on using the changeset viewer.