|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Introduction to GEMDMGEMDM is a Distributed Memory version of GEM
The Distributed Memory (DM) implementation of the GEM model is one
whereby a global domain of dimension G_ni x G_nj is split into
subdomains of dimension l_ni x l_nj using a regular block partitioning
technique. This partitioning is itself based on a user choice of
'Ptopo_npex' number of processors to split G_ni and 'Ptopo_npey'
number of processors to split G_nj. This creates an array of subdomains
to which we match an array of processors known as a 'processor
topology' of (Ptopo_npex x Ptopo_npex). Each processor will compute
only on its own local subdomain of dimension l_ni x l_nj.
Note that each PE will see a different value for its own
l_ni,l_nj. The l_ni and l_nj values are determined at run-time based
on the processor topology and the number of gridpoints for the global
domain (G_ni,G_nj).
This DM implementation of GEMDM uses the Message Passing Interface
(MPI) library. In this context, there will be
n = (Ptopo_npex X Ptopo_npey) exact copies of the main program launched
at once at startup. Those are known as the MPI processes to which a
PE will typically be assigned. Through a serie of initial communications
each PE obtains its rank and its position within the processor topology.
Data decomposition can thereafter take place and the computation will
start immediately afterwards. KEEP INFORMED ON CHANGES!!
To be kept informed of current developments and problem-solving related
to GEMDM, one
should subscribe to the "gem" mailing list by sending an e-mail to
"Majordomo@cmc.ec.gc.ca" with the line:
GEMDM ENVIRONMENT To obtain the proper GEMDM environment at the desired version, one must issue the following command for each new window session:
For example:
($ARMNLIB/modeles/GEMDM/v_3.2.0/scripts) adding Model=GEMDM, Version=3.2.0 component bin/IRIX64 to PATH ($ARMNLIB/modeles/GEMDM/v_3.2.0/bin/IRIX64)
/bin:/users/dor/armn/viv/ovbin/IRIX5:/users/dor/armn/viv/ovbin:.:/software/pub/s xf90-2.64/bin:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/usr/bin/X11:/usr/freeware/bin:/ software/host/bin:/software/base/bin:/software/batch/bin:/software/pub/bin:/usr/ bsd:/software/cmc/bin:/usr/local/env/gnu/bin:/usr/sbin:/sbin:/usr/local/env/armn lib/bin:/usr/local/env/armnlib/scripts:/usr/local/env/afsisio/scripts/usr:/usr/l ocal/env/afsisio/scripts/op:/usr/local/env/afsisio/programs:/users/dor/armn/viv/ bin/IRIX5:/users/dor/armn/viv/bin:/usr/etc:/usr/local/env/armnlib/modeles/GEMDM/ v_3.2.0/scripts:/usr/local/env/armnlib/modeles/GEMDM/v_3.2.0/bin/IRIX64
pollux 21% ls Makefile_AIX RCS_DYN_bk20050120/ run_configs/ Makefile_IRIX64 RCS_DYN_bk20050121/ scripts/ Makefile_Linux bin/ scripts_bk20050120/ RCS/ dfiles/ src/ RCS_4DVAR/ doc/ src_4d/ RCS_4DVAR_bk20050121/ lib/ RCS_DYN/ patches/
SETUP TO RUN GEMDM ON BATCH MODE
First, you must create (do not link) directories called 'gem' and
'listings' on your $HOME if they do not exist.
The execution directory (EXECDIR) on the execution machine (mach)
has the generic form:
The launching scripts will require ${HOME}/gem to already exist. The purpose of this is to force the user to provide space for the execution of the model through a proper link of directory ${HOME}/gem. For example:
Example:
pollux 23% ln -s /fs/mrb/02/armn/armnviv azur (for azur) pollux 24% ln -s /data/dormrb03/armn/armnviv/pollux pollux (for pollux) pollux 25% ln -s /data/local2/armn/armnviv/lorentz lorentz (for lorentz) pollux 26% ls -al drwxr-xr-x 2 armnviv armn 4096 Mar 24 10:25 ./ drwxr-xr-x 71 armnviv armn 20480 Sep 12 13:05 ../ lrwxrwxrwx 1 armnviv armn 23 Dec 15 2003 azur -> /fs/mrb/02/armn/armnviv lrwxrwxrwx 1 armnviv armn 19 Mar 24 10:25 lorentz -> /data/local/armnviv lrwxrwxrwx 1 armnviv armn 34 Sep 29 2003 pollux -> /data/dormrb03/armn/armnviv/pollux Example:
pollux 28% cd listings pollux 29% ln -s /fs/mrb/02/armn/armnviv/listings azur (for azur) pollux 30% ln -s /data/local2/armn/armnviv/lorentz/listings lorentz (for lorentz) Structure of GEMDM Look at the structure of data flow in the gemdmflow.pdf. Note that there are two absolutes/binaries (executables) needed to run the model GEMDM. One is for the entrance program (gemntr) and the other is the main program (gemdm). The names of these absolutes are related to the platform from where they have been created and they have the following structure: (a) maingemntr_${ARCH}_${version}.Abs (for the entry program) (b) maingemdm_${ARCH}_${version}.Abs (for the main program) ${ARCH} represents the OS of your machine (ie: IRIX64 for pollux, AIX for azur, Linux for your PC) ${version} represents the version of GEMDM ie: maingemntr_AIX_3.2.0.Abs, maingemdm_AIX_3.2.0.Abs (for azur), maingemntr_IRIX_3.2.0.Abs, maingemdm_IRIX_3.2.0.Abs, (for pollux), maingemntr_Linux_3.2.0.Abs, maingemdm_Linux_3.2.0.Abs, (for arxt22), Note that there are two configuration files read by the absolutes:
(b)gem_settings.nml file contain all the namelists to control the different schemes and parameters for the entry program (gemntr) and the main program (gemdm)
Running GEMDM INTERACTIVELY Interactive runs can only be done on either POLLUX or LINUX presently. Create a working directory (preferably on your home) and either create the absolutes or make soft links to existing absolutes in this directory. There are no absolutes provided in the $gem. They must be created or you can use absolutes created by someone else that would be:
(b) the correct GEMDM version ie: cd gem_320 ln -s /data/dormrb04/armnviv/tst1/maingemntr_IRIX64_3.2.0.Abs maingemntr_IRIX64_3.2.0.Abs ln -s /data/dormrb04/armnviv/tst1/maingemdm_IRIX64_3.2.0.Abs maingemdm_IRIX64_3.2.0.Abs Next, you must create 2 subdirectories at the working directory or make soft links if there is limited diskspace:
pollux 24% mkdir process pollux 25% mkdir output
pollux 27% cp $gem/run_configs/dbg1/gem_settings.nml . pollux 28% cp $gem/run_configs/dbg1/outcfg.out . pollux 29% ls gem_settings.nml maingemntr_IRIX64_3.2.0.Abs@ output/ maingemdm_IRIX64_3.2.0.Abs@ outcfg.out process/ Execute the entry program gemntr first by typing the following script (defined in $gem/scripts):
pollux 31% cd process pollux 32% ls bm20010920120000-00-00 bm20010920120000-01-01 labfl.bin bm20010920120000-00-01 cmclog mpi_nodes.cfg bm20010920120000-01-00 geophy.bin output_settings@ The above will use default climato, analysis and geophy files. The script runent contains simply the following line:
(Beware that this would apply to anytime you are running under the GEMDM v_{version}
The output of a run (Um_runmod.sh) will be found in the sub-directory "output"
in the form of
RPN std diese(#) grid files where each file represents one of the
processors.
An example if the RPN std # files are saved in another directory name other
than output such as output2, and, the run is Ptopo_npex=1, Ptopo_npey=2:
The script 'd2z' uses the program 'bemol2000' to reassemble the pieces together.
For visualization or handling of these
'#' or 'Z' grid files see in:
RPN Utilities for
RPN FSTD file manipulation/viewing Running GEMDM on BATCH Mode As mentioned in the section GEMDM Environment, one must ensure that the environment variable $gem exists and is the version intended. One was also make sure the Batch Setup has been done before attempting to submit any batch runs: (see Batch Mode Setup) In your working directory, create a sub-directory (ie:dbg2) and place 3 GEMDM configuration files (configexp.dot.cfg, gem_settings.nml and outcfg.out) into it. You can take a sample set from $gem/run_configs (ie: dbg1 is good)
pollux 37% mkdir dbg2 pollux 38% cp $gem/run_configs/dbg1/* dbg2 pollux 39% cd dbg2 pollux 40% ls configexp.dot.cfg gem_settings.nml outcfg.out pollux 41% vi configexp.dot.cfg
(ie:maingemntr_IRIX64_3.2.0.Abs,maingemdm_IRIX64_3.2.0.Abs) (2) You must indicate which machine the batch run will execute:
Now return to just above the directory dbg2 and submit the job to the machine by typing:
exp=hibou;
GEM_hibou_M_1232133.1(listing for gemdm)
GEM_hibou_1232133_FT_6_734642.1 (output file transfer to another machine)
c1f01p8m 8% ls gem_settings.nml outcfg.out maingemdm_AIX_3.2.0.Abs* output/ maingemntr_AIX_3.2.0.Abs* process/ c1f01p8m 9% Setup to create GEMDM absolutes/binaries
pollux 18% cd gem_320
Opening experiment 'base' press RETURN to confirm or give the name of the experiment to open Just hit return on the query and enter $gem/RCS for the 'RCSPATH'. For those who use the 4D-VAR, enter $gem/RCS $gem/RCS_4DVAR for the 'RCSPATH' Then hit Ctrl-X to end. (Note that this command creates a hidden file '.exper_cour and a RCS directory)
pollux 21% mkdir malibLinux pollux 22% mkdir malibAIX To avoid limited disk space problems: It is highly recommended to create soft links instead of creating the actual directories for malibIRIX64, malibLinux, malibAIX. They are directories to hold future object files created from recompiling modified routines (by you) from the GEMDM library. It is also recommended to create soft links for the GEM binaries as they are also written in the working directory. An example of a suggest setup of directories and binaries for the Azur (AIX) machine:
mkdir /fs/mrb/02/armn/armnviv/v3.2.0/malibAIX ln -s /fs/mrb/02/armn/armnviv/v3.2.0/malibAIX malibAIX ln -s /fs/mrb/02/armn/armnviv/v3.2.0/maingemntr_AIX_3.2.0.Abs maingemntr_AIX_3.2.0.Abs ln -s /fs/mrb/02/armn/armnviv/v3.2.0/maingemdm_AIX_3.2.0.Abs maingemdm_AIX_3.2.0.Abs Creating GEM absolutes(binaries) with no code modifications
Refer to the Setup to create binaries before continuing.
You can create both absolutes (executables) with the target "gem" of the Makefile that would be valid for the current platform with:
( in POLLUX, you would obtain maingemntrIRIX64_3.2.0.Abs, maingemdmIRIX64_3.2.0.Abs )
( in AZUR, you would obtain maingemntrAIX_3.2.0.Abs )
( in Linux, you would obtain maingemdmLinux_3.2.0.Abs )
Creating GEM absolutes(binaries) WITH code modifications
Refer to the Setup to create binaries before continuing.
To extract the routines for modification from the RCS, type the following command:
pollux 1% omd_exp rhs.ftn (see etagere utilities for 'omd_exp') extraction of version of module rhs.ftn from directory /usr/local/env/armnlib/modeles/GEMDM_shared/v_3.2.0/RCS
If you are modifying a comdeck:
pollux 6% vi rhsc.cdk
For further details in compilations and building
absolutes, see documentation on r.compile, r.build at
RPN utilities
for code compilation GEMDM Code Convention
The routines, functions and comdecks are named to group
towards related operations. Please see the naming and coding conventions
of routines and variables specified in this document:
code_stds_gemdm.html
GEMDM MACRO CODE An example of a processor topology of (2x1) would look like this: ie: Ptopo_npex=2, Ptopo_npey=1
Note that arrays with halos are formally shaped the following way:
Note: the macros can be found at $ARMNLIB/include/rpnmacros.h Macros can be advantageous in some sense. They provide less syntax or typo errors and they take less space. They are disadvantageous in another sense. They are not the common programming language which makes the code difficult to understand at first glance. A full expansion of the code can be found in the decks "*.f" GEM in LAM CONFIGURATION For those who want to try GEM in a Limited Area Modelling LAM configuration, here is an example of a LAM grid definition. Complete details of the namelist variables are described in $gem/doc/gem_settings.nml.txt For more information on LAM, refer to: lam seminar authors: V.Lee, M.Desgagné (March 2003)revision: V.Lee (Sept 2005) |