Changeset 2462 for branches/DEV_r2460_v3_3beta_NOL/NEMOGCM/EXTERNAL/XMLIO_SERVER/src/IOSERVER/mod_ioclient_para.F90
- Timestamp:
- 2010-12-07T18:56:19+01:00 (13 years ago)
- 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 17 17 #endif 18 18 USE mpi_mod 19 USE mod_event_parameters 19 20 IMPLICIT NONE 20 21 INTEGER :: NEW_COMM … … 26 27 INTEGER :: nb_server_io 27 28 INTEGER,ALLOCATABLE :: proc_color(:) 28 INTEGER :: i 29 INTEGER :: i, ix, jpni_reg, jpnj_reg 29 30 INTEGER :: div,remain 30 31 INTEGER :: group_color 31 32 INTEGER :: Comm_client_server 32 33 CHARACTER(LEN=6) :: oasis_server_id 34 LOGICAL :: ln_around, ln_use_allproc 33 35 34 36 IF (using_oasis) THEN … … 51 53 52 54 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) 58 98 ELSE 59 group_color=(nb_server_io-1)-( mpi_size-1-mpi_rank)/div99 group_color=(nb_server_io-1)-(jpni_reg*jpnj_reg - 1 -nregproc_in(mpi_rank+1))/div 60 100 ENDIF 61 101
Note: See TracChangeset
for help on using the changeset viewer.