GEOS-5 Software Engineering: Difference between revisions

Pchakrab (talk | contribs)
Pchakrab (talk | contribs)
Line 141: Line 141:


where <Tag Name> is the tag for the model to check out (e.g., Ganymed-2_0_UNSTABLE, Fortuna-2_5_p6) and <Module Name> is the module (e.g., Ganymed, Fortuna).
where <Tag Name> is the tag for the model to check out (e.g., Ganymed-2_0_UNSTABLE, Fortuna-2_5_p6) and <Module Name> is the module (e.g., Ganymed, Fortuna).
===== Build and install the model =====
Go into the src/ directory of your model. Following above:
$ cd Ganymed-2_0_UNSTABLE/GEOSagcm/src
Setup the environment by sourcing the <code>g5_modules</code> file:
$ source g5_modules
To build the model, you have one of two choices. First, you can use the parallel_build.csh script to submit a PBS job that compiles the model:
$ ./parallel_build.csh
or you can interactively build the model using:
$ gmake install
To capture the install log, we recommend tee'ing the output to a file:
$ gmake install |& tee make.install.log (on tcsh)
$ gmake install 2>&1 | tee make.install.log (on bash)
Note you can also build in parallel interactively with:
$ gmake --jobs=jN pinstall |& tee make.install.log (on tcsh)
where N is the number of parallel processes. For best performance, N should be, say, 2 less than the number of cores. So, on a Westmere node, use 10. For the sake of others, ''do this on an interactive node''.
By default, the Intel Fortran compiler (ifort) is used for the build process. One can specify a different compiler name (e.g. pgfortran) through the environment variable ESMA_FC as in
$ gmake install ESMA_FC=pgfortran |& tee make.install.log (on tcsh)
or
$ gmake ESMA_FC=pgfortran --jobs=N pinstall |& tee make.install.log (on tcsh)
===Monitor build process===
The build can be monitored using the utility gmh.pl in the directory Config. From the src directory
$ Config/gmh.pl -Av make.install.log
outputs the build status as
                          --------
                          Packages
                          --------
          >>>> Fatal Error          .... Ignored Error
  [ok]      Config
  [ok]      GMAO_Shared
  [ok]      |    GMAO_mpeu
  [ok]      |    |    mpi0
  [ok]      |    GMAO_pilgrim
  [ok]      |    GMAO_gfio
  [ok]      |    |    r4
  [ok]      |    |    r8
  [ok]      |    GMAO_perllib
  [ok]      |    MAPL_cfio
  [ok]      |    |    r4
  [ok]      |    |    r8
  [ok]      |    MAPL_Base
  [ok]      |    |    TeX
  [ok]      |    GEOS_Shared
  [ 1] .... .... Chem_Base
  [ok]      |    Chem_Shared
  [ok]      |    GMAO_etc
  [ok]      |    GMAO_hermes
  [ 2] .... .... GFDL_fms
  [ok]      |    GEOS_Util
  [ok]      |    |    post
                          -------
                          Summary
                          -------
IGNORED mpp_comm_sma.d mpp_transmit_sma.d Chem_AodMod.d (3 files in 2 packages)
All 22 packages compiled successfully.
In case of errors, gmh summarizes exactly where it happens by indicating the package where it occured. Caveat: it does not work in parallel (output is scrambled). So, if the parallel build fails, rerun it sequentially (it will go quickly and die in the same place) and run gmh on the output for a summary.


<!--
<!--