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 10422 for NEMO – NEMO

Changeset 10422 for NEMO


Ignore:
Timestamp:
2018-12-19T22:34:53+01:00 (5 years ago)
Author:
smasson
Message:

dev_r10164_HPC09_ESIWACE_PREP_MERGE: improve mppini messages, see #2133

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/LBC/mppini.F90

    r10409 r10422  
    149149      INTEGER ::   iarea0                     !   -       - 
    150150      INTEGER ::   ierr, ios                  !  
    151       INTEGER ::   inbi, inbj, iimax,  ijmax  !  
     151      INTEGER ::   inbi, inbj, iimax,  ijmax, icnt1, icnt2 
     152      LOGICAL ::   llbest 
    152153      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   iin, ii_nono, ii_noea          ! 1D workspace 
    153154      INTEGER, ALLOCATABLE, DIMENSION(:)     ::   ijn, ii_noso, ii_nowe          !  -     - 
     
    184185      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
    185186         CALL mpp_init_bestpartition( mppsize, jpni, jpnj ) 
     187         llbest = .TRUE. 
    186188      ELSE 
    187          CALL mpp_init_bestpartition( mppsize, inbi, inbj ) 
     189         CALL mpp_init_bestpartition( mppsize, inbi, inbj, icnt2 ) 
    188190         CALL mpp_basic_decomposition( jpni, jpnj, jpimax, jpjmax ) 
    189191         CALL mpp_basic_decomposition( inbi, inbj,  iimax,  ijmax ) 
    190192         IF( iimax*ijmax < jpimax*jpjmax ) THEN 
    191             WRITE(ctmp1,*) '   The chosen domain decomposition ', jpni, jpnj 
    192             WRITE(ctmp2,*) '   has larger MPI subdomains ', jpimax, jpjmax, jpimax*jpjmax 
    193             WRITE(ctmp3,*) '   than the following domain decompostion ', inbi, inbj 
    194             WRITE(ctmp4,*) '   which MPI subdomains size is ', iimax, ijmax, iimax*ijmax 
    195             CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, '    --- YOU ARE WASTING CPU... ---' ) 
     193            llbest = .FALSE. 
     194            icnt1 = jpni*jpnj - mppsize 
     195            WRITE(ctmp1,9000) '   The chosen domain decomposition ', jpni, ' x ', jpnj, ' with ', icnt1, ' land sub-domains' 
     196            WRITE(ctmp2,9000) '   has larger MPI subdomains (jpi = ', jpimax, ', jpj = ', jpjmax, ', jpi*jpj = ', jpimax*jpjmax, ')' 
     197            WRITE(ctmp3,9000) '   than the following domain decompostion ', inbi, ' x ', inbj, ' with ', icnt2, ' land sub-domains' 
     198            WRITE(ctmp4,9000) '   which MPI subdomains size is jpi = ', iimax, ', jpj = ', ijmax, ', jpi*jpj = ', iimax*ijmax, ' ' 
     199            CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, ' ', '    --- YOU ARE WASTING CPU... ---', ' ' ) 
     200         ELSE 
     201            llbest = .TRUE. 
    196202         ENDIF 
    197203      ENDIF 
     
    203209 
    204210      IF( mppsize < inijmin ) THEN 
    205          WRITE(ctmp1,*) '   With this specified domain decomposition: jpni =', jpni, ' jpnj =', jpnj 
    206          WRITE(ctmp2,*) '   we can eliminate only ', jpni*jpnj - inijmin, ' land mpi subdomains therefore ' 
    207          WRITE(ctmp3,*) '   the number of ocean mpi subdomains (', inijmin,') exceed the number of MPI processes:', mppsize 
     211         WRITE(ctmp1,9001) '   With this specified domain decomposition: jpni = ', jpni, ' jpnj = ', jpnj 
     212         WRITE(ctmp2,9002) '   we can eliminate only ', jpni*jpnj - inijmin, ' land mpi subdomains therefore ' 
     213         WRITE(ctmp3,9001) '   the number of ocean mpi subdomains (', inijmin,') exceed the number of MPI processes:', mppsize 
    208214         WRITE(ctmp4,*) '   ==>>> There is the list of best domain decompositions you should use: ' 
    209215         CALL ctl_stop( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 ) 
     
    213219 
    214220      IF( mppsize > jpni*jpnj ) THEN 
    215          WRITE(ctmp1,*) '   The number of mpi processes: ', mppsize 
    216          WRITE(ctmp2,*) '   exceeds the maximum number of subdomains (ocean+land) = ', jpni*jpnj 
    217          WRITE(ctmp3,*) '   defined by the following domain decomposition: jpni =', jpni, ' jpnj =', jpnj 
     221         WRITE(ctmp1,9003) '   The number of mpi processes: ', mppsize 
     222         WRITE(ctmp2,9003) '   exceeds the maximum number of subdomains (ocean+land) = ', jpni*jpnj 
     223         WRITE(ctmp3,9001) '   defined by the following domain decomposition: jpni = ', jpni, ' jpnj = ', jpnj 
    218224         WRITE(ctmp4,*) '   ==>>> There is the list of best domain decompositions you should use: ' 
    219225         CALL ctl_stop( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 ) 
     
    224230      jpnij = mppsize   ! force jpnij definition <-- remove as much land subdomains as needed to reach this condition 
    225231      IF( mppsize > inijmin ) THEN 
    226          WRITE(ctmp1,*) '   The number of mpi processes: ', mppsize 
    227          WRITE(ctmp2,*) '   exceeds the maximum number of ocean subdomains = ', inijmin 
    228          WRITE(ctmp3,*) '   we suppressed ', jpni*jpnj - mppsize, ' land subdomains ' 
    229          WRITE(ctmp4,*) '   BUT we had to keep ', mppsize - inijmin, ' land subdomains that are useless...' 
    230          CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4 ) 
     232         WRITE(ctmp1,9003) '   The number of mpi processes: ', mppsize 
     233         WRITE(ctmp2,9003) '   exceeds the maximum number of ocean subdomains = ', inijmin 
     234         WRITE(ctmp3,9002) '   we suppressed ', jpni*jpnj - mppsize, ' land subdomains ' 
     235         WRITE(ctmp4,9002) '   BUT we had to keep ', mppsize - inijmin, ' land subdomains that are useless...' 
     236         CALL ctl_warn( 'mpp_init:', '~~~~~~~~ ', ctmp1, ctmp2, ctmp3, ctmp4, ' ', '    --- YOU ARE WASTING CPU... ---', ' ' ) 
    231237      ELSE   ! mppsize = inijmin 
    232238         IF(lwp) THEN 
    233             WRITE(numout,*) 'mpp_init: You use an optimal domain decomposition' 
     239            IF(llbest) WRITE(numout,*) 'mpp_init: You use an optimal domain decomposition' 
    234240            WRITE(numout,*) '~~~~~~~~ ' 
    235             WRITE(numout,*) '   Number of mpi processes: ', mppsize 
    236             WRITE(numout,*) '   Number of ocean subdomains = ', inijmin 
    237             WRITE(numout,*) '   Number of suppressed land subdomains = ', jpni*jpnj - inijmin 
    238          ENDIF 
    239       ENDIF 
     241            WRITE(numout,9003) '   Number of mpi processes: ', mppsize 
     242            WRITE(numout,9003) '   Number of ocean subdomains = ', inijmin 
     243            WRITE(numout,9003) '   Number of suppressed land subdomains = ', jpni*jpnj - inijmin 
     244            WRITE(numout,*) 
     245         ENDIF 
     246      ENDIF 
     2479000  FORMAT (a, i4, a, i4, a, i7, a) 
     2489001  FORMAT (a, i4, a, i4) 
     2499002  FORMAT (a, i4, a) 
     2509003  FORMAT (a, i5) 
    240251 
    241252      IF( numbot /= -1 )   CALL iom_close( numbot ) 
     
    722733 
    723734 
    724    SUBROUTINE mpp_init_bestpartition( knbij, knbi, knbj, ldlist ) 
     735   SUBROUTINE mpp_init_bestpartition( knbij, knbi, knbj, knbcnt, ldlist ) 
    725736      !!---------------------------------------------------------------------- 
    726737      !!                 ***  ROUTINE mpp_init_bestpartition  *** 
     
    732743      INTEGER,           INTENT(in   ) ::   knbij         ! total number if subdomains               (knbi*knbj) 
    733744      INTEGER, OPTIONAL, INTENT(  out) ::   knbi, knbj    ! number if subdomains along i and j (knbi and knbj) 
     745      INTEGER, OPTIONAL, INTENT(  out) ::   knbcnt        ! number of land subdomains 
    734746      LOGICAL, OPTIONAL, INTENT(in   ) ::   ldlist        ! .true.: print the list the best domain decompositions (with land) 
    735747      ! 
     
    831843         knbi = inbi1(ii) 
    832844         knbj = inbj1(ii) 
     845         IF(PRESENT(knbcnt))   knbcnt = 0 
    833846         DEALLOCATE( inbi1, inbj1, inbij1, iszi1, iszj1, iszij1 ) 
    834847         RETURN 
     
    897910      knbi = inbi0(ii) 
    898911      knbj = inbj0(ii) 
     912      IF(PRESENT(knbcnt))   knbcnt = knbi * knbj - inbij 
    899913      DEALLOCATE( inbi0, inbj0 ) 
    900914      ! 
Note: See TracChangeset for help on using the changeset viewer.