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.
README.rst in NEMO/branches/UKMO/dev_fix_mpp_prep/MPP_PREP – NEMO

source: NEMO/branches/UKMO/dev_fix_mpp_prep/MPP_PREP/README.rst @ 10265

Last change on this file since 10265 was 10265, checked in by mathiot, 5 years ago

update src/mpp_optimiz_zoom_nc.f90 and namelist to NEMO4 beta + add README.rst + add python script to scan the processor.layout output

File size: 7.1 KB
Line 
1============
2MPP_PREP
3============
4
5Description
6===========
7MPP_PREP proposes possible domain decompositions for a given
8bathymetric file, which is particularly intersting when
9we want to eliminate land-only domain.
10All solution are proposed and written to output file.
11The ratio between the effective number of computed
12point and the total number of points in the domain is
13given and is probably a major criteria for choosing a
14domain decomposition.
15
16Tools mpp_optimiz_zoom_nc.exe as been tested on one eORCA12 and one eORCA025 configuration at trunk@10036
17
18Tools mppopt_showproc_nc.exe has not been tested.
19
20Method
21======
22Use mpp_init like code for setting up the decomposition
23and evaluate the efficiency of the decomposition.
24
25How to compile it
26=================
27MPP_PREP is compiled in the same manner as all the other tools.
28The compilation script is maketools and the option are very similar to makenemo.
29
30Here an example of how to compile MPP_PREP on the MetOffice XC40 HPC:
31
32.. code-block:: console
33                     
34        $ ./maketools -n MPP_PREP -m XC40_METO
35
36Usage
37=====
38
39the MPP_PREP executable is named mpp_optimiz_zoom_nc.exe. The input file needed are:
40
41 * a netcdf file containing a variable with 0 on land and data > 0 on ocean (typically a bathymetry file)
42
43 * a namelist to specify the number of vertical levels, netcdf input file, variable and dimension names (...).
44   A namelist template is available in the file 'namelist'
45
46Default namelist assume a file named domain_cfg.nc with a variable bottom_level
47
48.. code-block:: console
49
50 $ ./mpp_optimiz_zoom_nc.exe -h
51   usage : mpp_optimize [ -h ]  [-keep jpni jpnj] [ -o file out ]
52                [ -modulo val ] [-r ratio] [-minocean procs] -n namelist
53       
54      PURPOSE :
55          This program is build to optimize the domain beakdown into
56          subdomain for mpp computing.
57          Once the grid size, and the land/sea mask is known, it looks
58          for all the possibilities within a range of setting parameters
59          and determine the optimal.
60 
61          Optimization is done with respect to the maximum number of
62          sea processors and to the maximum numbers of procs (nn_procmax)
63                 
64          Optional optimization can be performed taking into account
65          the maximum available processor memory rn_ppmcal. This is
66          activated if ln_memchk is set true in the namelist
67       
68          Additional criteria can be given on the command line to reduce
69          the amount of possible choices.
70       
71      ARGUMENTS :
72          -n namelist : indicate the name of the namelist to use
73       
74      OPTIONS :
75          -h : print this help message
76          -keep jpni jpnj : print a file suitable for plotting,
77                  corresponding to the given decomposition
78          -o output file : give the name of the output file
79                  default is processor.layout
80          -modulo val : only retain decomposition whose total number
81                  of util processors (sea) are a multiple of val
82          -r ratio : only retain decomposition with a ratio computed/global
83                  less or equal to the given ratio
84          -minocean procs : only retain decomposition with a number of
85                  ocean procs greater of equal to procs
86       
87      REQUIRED FILES :
88        A bathymetric file and an ad-hoc namelist are required.
89        The file name of the bathymetry is specified in the namelist
90       
91      OUTPUT :
92        processor.layout : an ascii file with all found possibilities
93       
94      SEE ALSO :
95        script screen.ksh helps a lot in the analysis of the output file.
96       
97 STOP 
98
99Example
100=======
101
102Here is an example of usage of ./mpp_optimiz_zoom_nc.exe on the the eORCA025 bathymetry. We keep in the output only domain decomposition with a ratio (computed/global) lower than 1, using namelist_eORCA025 and output the list of domain decomposition in processor.layout_eORCA025
103
104.. code-block:: console
105
106 $ ./mpp_optimiz_zoom_nc.exe -r 1 -n namelist_eORCA025 -o processor.layout_eORCA025
107 
108  ocean/land file used is: domcfg_eORCA025.nc
109  variable used to find ocean domain is: bottom_level
110  Dimensions (jpi x jpj) are:  1442 x 1207
111 
112 Loop over all the decompositions (can take a while) ...
113 
114 STOP
115
116The output for one specific decomposition contains this information:
117
118.. code-block:: console
119
120  iresti= 14  irestj= 9
121 --> Total number of domains  1612
122
123  jpni= 31  jpnj= 52
124  jpi=  49  jpj=  26
125  Number of ocean processors        1074
126  Number of land processors         538
127  Mean ocean coverage per domain    0.7542637596508307
128  Minimum ocean coverage            7.849293761E-4
129  Maximum ocean coverage            1.
130  nb of proc with coverage         < 10 %  68
131  nb of proc with coverage 10 < nb < 30 %  99
132  nb of proc with coverage 30 < nb < 50 %  59
133  Number of computed points         1368276
134  Overhead of computed points       -372218
135  % sup (computed / global)         0.786142349
136
137Sorting phase
138=============
139The processor.layout can be very long and hard to exploit.
140To sort out what is the best model decomposition for a specific application, there is a suggestion at the end of the processor.layout file. Otherwise you can use the python script find_layout.py to dig into it.
141
142.. code-block:: console
143
144 $ python2.7 find_layout.py                                                       
145 usage: find_layout.py [-h] -f layout_file --rmax max_ratio --noce min/max_noce
146
147Below an example to extract all decomposition with a ratio (computed/global) < 0.8 and a number of ocean domain between 300 and 350. All the decomposition fitting the criterions are listed. At the end, a summary of the one with the smallest ratio, the largest number of ocean domains and the smallest computed domain.
148
149.. code-block:: console
150
151 $ python2.7 find_layout.py -f processor.layout_eORCA025 --rmax 0.8 --noce 300 350
152 Domain decomposition 0
153 domain decomposition (jpni, jpnj) = (13, 32)
154 number of ocean domain            = 300
155 ratio computed/global             = 0.779089153
156 domain size (jpi, jpj)            = (113, 40)
157 ...
158 Domain decomposition 76
159 domain decomposition (jpni, jpnj) = (37, 13)
160 number of ocean domain            = 350
161 ratio computed/global             = 0.783254623
162 domain size (jpi, jpj)            = (41, 95)
163 
164 =====================================================================
165 
166 Among the layouts fitting the constraint on : ratio (computed/global) < 0.8 and 300 <= number of ocean domain <= 350
167
168  3 layouts are highlighted :
169
170 Domain decomposition SMALLEST RATIO
171 domain decomposition (jpni, jpnj) = (24, 18)
172 number of ocean domain            = 310
173 ratio computed/global             = 0.761956096
174 domain size (jpi, jpj)            = (62, 69)
175 
176 Domain decomposition LARGEST NUMBER OF OCEAN DOMAINS
177 domain decomposition (jpni, jpnj) = (21, 23)
178 number of ocean domain            = 350
179 ratio computed/global             = 0.785265565
180 domain size (jpi, jpj)            = (71, 55)
181 
182 Domain decomposition SMALLEST COMPUTED DOMAIN
183 domain decomposition (jpni, jpnj) = (18, 27)
184 number of ocean domain            = 350
185 ratio computed/global             = 0.775009871
186 domain size (jpi, jpj)            = (82, 47)
Note: See TracBrowser for help on using the repository browser.