Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Full debugging ('nansC') - this configuration is intended for debugging only. As well as setting the lowest optimization, -O0, it also enables array bound checking and initialisation of variables with special values that will trigger 'not-a-number' exceptions useful for trapping variables used before initialized. This will cause the model to run very slowly and is normally only used for short runs for tracing bugs.

...

Config files and variables

The FCM software uses configuration files identified by the suffix '.cfg'. They can be found in the directory oifs/make/fcmcfg. The master configuration file for OpenIFS is in fcmcfg/oifs.cfg. It sets general configuration options for FCM, lets FCM know where the source code is and reads a single architecture and compiler specific configuration file. No compiler options are contained in the oifs.cfg file - these are always in the architecture specific configuration files.

...

changes the build type to the 'optimized' build. This means instead the file 'fcmcfg/x86_64-gnu-opt.cfg' will be included by fcmcfg/oifs.cfg instead of the file fcmcfg/x86_64-gnu-noopt.cfg.

Create your own config files

Suppose we wanted to run the model on MacOS X with the intel compiler and a optimized setting. We could set:

...

FCM would then read the file fcmcfg/oifs.cfg which would expect to find a file called: darwin-intel-opt.cfg. This file would need to be created by the user, we suggest copying one of the existing .

...

cfg files as a template and modifying it to suit your purpose.

Your own .cfg files do not need to be kept in the make/fcmcfg directory. You might like to create a directory, say, make/mycfg and store them in there. Use the -f option for the fcm make command to load the new files:

Code Block
% cd oifs/make
% mkdir mycfg
% ln -s fcmcfg/oifs.cfg mycfg/oifs.cfg           #  the oifs.cfg must exist in the same directory as your custom .cfg file.
% cp fcmcfg/x86_64-intel-opt.cfg mycfg/darwin-intel_v13-opt.cfg
(edit darwin-intel_v13-opt.cfg)
% export OIFS_ARCH=darwin
% export OIFS_COMP=intel_v13
% export OIFS_BUILD=opt
% fcm make -f mycfg/oifs.cfg

 

Change compiler options (global)

All the compiler flags and options are contained in the build specific files (e.g. x86_64-intel-opt.cfg). As above, a number of environment variables can be defined to override the default options set in these files. As a general rule, any variable with a {?} can be overriden by setting an environment variable.

...

  1. Set minimum required options.
    The only two compilation variables that need to be changed before building OpenIFS are the location of the grib_api installation and the location of the LAPACK and BLAS libraries.
    e.g.
           export OIFS_GRIB_API_DIR=/home/me/ecmwf/grib_api
           export OIFS_LAPACK_LIB="/opt/apps/lapack/current/LP64 -llapack -lblas"
           fcm make -f fcmcfg/oifs.cfg

    Would override the values of these variables in the FCM config files. In this example, FCM would use the x86_64-gnu-noopt.cfg build as this is the default specified in the oifs.cfg file (in the oifs/make/fcmcfg directory).

  2. Changing compiler and compiler options.
    In this example, the build type is changed and the choice of underlying fortran compiler is altered along with some compiler options:
           export OIFS_COMP=gnu
           export OIFS_BUILD=opt
           export OIFS_GRIB_DIR=/opt/local/ecmwf/grib_api_xe6
           export OIFS_LAPACK_LIB="-L/opt/apps/scal/lib -llapack -lblas"
           export OIFS_FC="mpif90 --fc=crayftn"
           export OIFS_FFLAGS="-g -O1 -m64 -convert big-endian"

    In this example, the compiler has been changed although FCM will still use the x86_64-gnu-opt.cfg configuration file. This might be because a user wants to temporarily try a different compiler. However, it's recommended that each compiler has its own set of .cfg files rather than alter it this way.

    Another example is where an optimized build is required but the optimization level is dropped to -O1 instead of -O2.

Changing options per file

The description above covers changing the compiler options globally, that is, for all files in the compilation. There may be instances when options for one or a few files need to be changed. For instance, in debugging where array bound checking is required for a handful of changed subroutines.

Recommendations

As described above, the build environment uses 3 types of build:

...