Building UM executables: draft strategy

This post will contain a strategy for building current (UM13.X) UM executables on Gadi. Roughly, the goal is to be able to use Spack to build all relevant UM13.X executables from source code controlled by private GitHub repositories. Milestones towards this goal will be described below.

The current situation

Currently, UM executables are usually built on Gadi starting from a Rose/Cylc suite or a Rose-Stem test from a UM source directory. Rose is used to select configuration options, and FCM is the main tool used to build the executables, using toolchains and libraries that are configured via environment variables. These environment variables are usually defined by environment modules. An FCM configuration file in the suite or test (e.g. app/fcm_make_um/file/fcm-make.cfg) uses the FCM include command to include an FCM configuration from the UM source code, such as fcm-make/nci-x86-ifort/um-atmos-safe.cfg. This file usually includes a file such as fcm-make/inc/um-atmos-common.cfg, which is the main FCM configuration file used to build the requested UM executables.

For example, the ACCESS-Regional Nesting Suite software inventory contains a description of the FCM configuration that is used to build the um-atmos.exe and um-recon.exe executables for the u-dg768 regional nesting suite.

In the case of um-atmos.exe and um-recon.exe, the FCM build defined by fcm-make/inc/um-atmos-common.cfg uses components from six separate Subversion source code repositories, configured via FCM keywords as MOSRS mirror repositories. These are: fcm:casim.xm, fcm:jules.xm, fcm:shumlib.xm, fcm:socrates.xm, fcm:ukca.xm, and fcm:um.xm. These six components are not used to build separate libraries but are instead treated as a single source code base. THE FCM build also uses diff locations, one for casim and three for um. These diff locations point to different branches in the casim and um repositories respectively.

The FCM build also uses the eccodes, eccodes_f90, gcom, netcdf, and netcdff libraries. The eccodes/2.8.0 and gcom/7.7_ompi.4.0.2 modules from /g/data/access, and the netcdf/4.7.1 module from /apps define the environment variables that FCM and the Fortran compiler need in order to use these libraries.

The overall strategy

The main idea would be to perform the following two steps in parallel — if possible.

  • Create Spack packages for um-atmos.exe, um-recon.exe, and relevant related UM executables.
  • Migrate the casim, jules, shumlib, socrates, ukca, um and relevant related MOSRS Subversion repositories to GitHub Git repositories.

Spack packages

The overall strategy implies that initially the Spack packages would use the existing FCM keywords and MOSRS Subversion mirror repositories. A single Spack package currently cannot use multiple Subversion repositories, so the FCM extract steps performed in the case of the build of um-atmos.exe and um-recon.exe would have to be retained. The steps towards creating Spack package definitions that build from GitHub repositories would then be something like:

  1. Configure each Spack package definition to build using current FCM configurations with fixed set of configuration options obtained from (e.g.) suite Rose configuration files. This would include config_root_path and the revisions and diff locations of components. Each Spack package definition would configure libraries similarly to the way that the um7 Spack package currently does it.
  2. Change some relevant FCM configuration options into variants within each Spack package definition.
  3. Move the FCM extract and diff steps into each Spack package definition, and somehow support multiple Subversion repositories (?)
  4. When a set of consolidated Git branches is available via GitHub, change each Spack package definition so that it uses a single GitHub URL.

The question mark after step 3 indicates that is not clear how this step would be done, if at all.

GitHub repositories

ACCESS-NRI already has two active projects working on UM sources.

  1. The ACCESS-AM3 project includes updating CABLE within the UM. This project currently targets UM13.1. The project includes three private repositories:
  2. The ACCESS-CM3 project includes adding the NUOPC coupler to the UM. This project currently targets UM13.0. The project includes a MOSRS UM Trac ticket and two UM branches:

To be completed.

Please note that this is a draft document for discussion only at this stage.