Compiling METROMS on Olivia#
Author: Thorbjørn Østenby Moe
Note
This file explains the steps taken to compile METROMS on Olivia. I am by no means an expert on this, so please verify the steps. Some of the troubles I had are likely due to my lack of experience. However, the final configuration I reached seems to work.
This file is mainly for my own reference, but feel free to use it if you find it useful.
Note 1: This can also be interpreted as differences between other clusters and Olivia, but my reference is to Fram.
Note 2: Something with the Open MPI packages seems to be more sensitive on Olivia than previously on Fram, especially when mixing loaded packages (perhaps NRIS/GPU, NRIS/CPU, & NRIS/Login), but there may be other incompatibilities instead/in addition.
Compilation#
Make sure that
cluster/home/$USER/metroms_ideal/static_libs/roms-3.8.tar.gzexists and that you have a directory incluster/home/$USER/metroms_ideal/apps/with a header file.Navigate to
cluster/home/$USER/metroms_ideal/apps.Type:
source myenv.bash olivia
Type:
source modules.sh
Type:
./sbuild_roms_NoCice_roms38.sh Path/to/header_fileDebug or find your new compilation (preferably in
$work).
1. myenv file (myenv.bash)#
Make sure that the host option is set to Olivia:
if [ "$METROMS_MYHOST" == "olivia" ]; then
Change work path to reflect new structure on Olivia:
export METROMS_TMPDIR=/cluster/work/projects/nn9608k/metroms_ideal_run
(This is a recurring theme.)
2. modules file (modules.sh)#
Make sure that the host option is set to Olivia:
if [ "$METROMS_MYHOST" == "olivia" ]; then
Load specific modules and compatible versions:
module load NRIS/CPU module load intel/2023b module load intel-compilers/2023.2.1 module load netCDF-Fortran/4.6.1-iimpi-2023b
Notes:
The NRIS/CPU module was essential to get the right
netCDF.modfile.Older Intel packages ensure compatibility with the ROMS compilation.
3. build file (sbuild_roms_NoCice_roms38.sh)#
The MPI and MPI_F90 options should be on.
Make sure the host option is set to Olivia:
if [ "$METROMS_MYHOST" == "olivia" ]; then
FORT settings:
export FORT=ifort export I_MPI_F90=ifort
Compiler flags added on advice from NIRD/Sigma2:
export MY_CPP_FLAGS="-march=core-avx2 -mtune=core-avx2" export MY_CFLAGS="-march=core-avx2 -mtune=core-avx2" export MY_FFLAGS="-march=core-avx2 -mtune=core-avx2"
(Necessary for Intel compilers on AMD architecture.)
4. The compilation#
Common issues encountered:
Header file problems: Compiler searched for
Path/to/header_file/.hinstead ofPath/to/header_file.h. Fixed by creating the.hdirectory.Module problems:
netcdf.modnot found. Fixed by loadingNRIS/CPU.Compiler problems:
mod_kinds.f90incompatible with newer Intel. Older Intel packages resolved this.Flag problems: Olivia uses AMD CPUs; special flags required (
-march=core-avx2 -mtune=core-avx2).Extra files problems: Some files failed due to undefined variables. Adding empty dummy files in
common/modified_src/helped temporarily.Magical fix: Copying and renaming the
.hdirectory finally allowed compilation to succeed.
5. Post compilation#
Missing romsM file: Turn off debug in build file, turn on
USE_large.Paths in
ocean.inoutdated: Update all paths for input files.Model runs on test case but not full model: Must specify nodes and tasks per node on Olivia.
6. run script (runon_olivia.sh)#
Standard memory per CPU: 2GB
#SBATCH --mem-per-cpu=2GSpecify nodes and tasks:
#SBATCH --ntasks=256 #SBATCH --nodes=4 #SBATCH --ntasks-per-node=64
Work directory by project:
workdir=/cluster/work/projects/nn9608k/metroms_ideal_run/$runname/$runid
Source Olivia environment:
source ~/metroms_ideal/apps/myenv.bash olivia
Additional previously loaded packages are likely unnecessary.