.. _platforms: Running on different platforms ====================================== HPC platforms ''''''''''''' Below is a list of platforms where NorESM2 has been installed, including platform specific intructions. ****: the name of the folder where the model code has been downloaded (cloned from git) The configurations files with the platform specific settings are found in :: /cime/config/cesm/machines/config_machines.xml /cime/config/cesm/machines/config_compilers.xml /cime/config/cesm/machines/config_batch.xml Usually there is no need to change these files. Fram @ Sigma2 ^^^^^^^^^^^^^ Configuration files for running NorESM2 on Fram are distributed in all branches of the noresm code. Input data is stored in /cluster/shared/noresm/inputdata/ Apply for membership in NorESM shared data storage (manager: mben@norceresearch.no) for access to the folder. The run and archive directories are stored in /cluster/work/users// Create a new case: :: ./create_newcase --case ../../../cases/ --mach fram --res --compset --project --user-mods-dir --run-unsupported Betzy @ Sigma2 ^^^^^^^^^^^^^^^ NorESM2 working on BETZY with CIME tag cime5.6.10_cesm2_1_rel_06-Nor_v1.0.4 Configuration files for running NorESM2 on Betzy are currently being put in all branches of the noresm code. Input data is stored in /cluster/shared/noresm/inputdata/ Apply for membership in NorESM shared data storage (manager: mben@norceresearch.no) for access to the folder. The run and archive directories are stored /cluster/work/users// NorESM requires at least Python3 for setup and building. A recommended set of modules is provided by :: module purge module load GCCcore/11.3.0 module load git/2.36.0-GCCcore-11.3.0-nodocs module load Python/3.10.4-GCCcore-11.3.0 Create a new case: :: ./create_newcase --case ../../../cases/ --mach betzy --res --compset --project --user-mods-dir --run-unsupported Setting number of nodes on Betzy --------------------------------- In fully coupled setup, for grid f19_tn14 and f09_tn14, various processors configurations are added and can be used by setting ``--pecount`` = S, L, M or X1 when creating a new case. For NorESM2-MM, using grid f09_tn14, ``--pecount`` will give the following number of nodes: :: S = 4 M = 9 L = 15 X1 = 17 and for NorESM2-LM, using grid f19_tn14, ``--pecount`` it will give the following number of nodes: :: S = 4 M = 8 X1 = 10 L does not exists for f19_tn14. E.g. creating a new case running on 4 nodes :: ./create_newcase –case ../../../cases/ --mach betzy –-res --compset --project --pecount= S --user-mods-dir --run-unsupported .. note:: Please note that these Betzy settings are included in tag noresm2.0.4 and subsequent tags Queue options on Fram and on Betzy ----------------------------------- On fram there are different queues for testing and development experiments (usually short runs on few nodes) and longer experiments. If you want to run simulations using different queue options than *normal*, in env_batch.xml: Add to the directives :: --qos=devel for the development queue and change (only on Fram) the node settings to: :: devel For the short (Fram) and preproc (Betzy) queue options, add :: --qos=short or directive> --qos=preproc for the development queue and change (only on Fram) the node settings to: :: short for the short/preproc queue. | For a detailed guide on how to set up, submit and choosing the right job see: | https://documentation.sigma2.no/jobs/submitting.html | https://documentation.sigma2.no/jobs/choosing_job_types.html | Nebula @ NSC ^^^^^^^^^^^^ Configuration files for running NorESM2 on Nebula are distributed in the release tags release-noresm2* and in the noresm2 origin/noresm2 branch. If Nebula configurations are missing in your copy of the model, the files can be found in the following folder on Nebula: :: /nobackup/forsk/noresm/nebula_config_noresm2/ Apply for membership in NorESM shared data storage (manager: adag@met.no) for access to the folder. Copy the files in the above folder to: :: cd /cime/config/cesm/machines/ cp /nobackup/forsk/noresm/nebula_config_noresm2/* . Input data is stored in ``/nobackup/forsk/noresm/inputdata/`` The run and archive directories are stored ``/nobackup/forsk//`` Before configuring and compiling the model, add ``export LMOD_QUIET=1`` to your .bashrc :: cd vi .bashrc Create a new case: :: ./create_newcase --case ../../../cases/ --mach nebula --res --compset --project --user-mods-dir --run-unsupported Tetralith @ NSC ^^^^^^^^^^^^^^^ Configuration files for running NorESM2 on Tetralith are distributed e.g. in the tag release-noresm2.0.7. If Tetralith configurations are missing in your copy of the model the files can be found in the following folder on Tetralith: :: /proj/cesm_input-data/tetralith_config_noresm2 Apply for membership in CESM climate model shared data storage (NAISS 2024/23-95) for access to the folder. Copy the files in the above folder to if configuration files are not distributed with the code: :: cd /cime/config/cesm/machines/ cp /proj/cesm_input-data/tetralith_config_noresm2/* . Input data is stored /proj/cesm_input-data/ Before configuring and compiling the model, clear your environment and load the following modules: :: module purge module load buildenv-intel/2023a-eb module load netCDF-HDF5/4.9.2-1.12.2-hpc1 module load Perl/5.38.0-hpc1-gcc-system Create a new case: :: ./create_newcase --case ../../../cases/ --mach triolith --res --compset --pecount M --ccsm_out Virtual Machine with Conda (@ https://www.nrec.no/ for example) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' This section describes how to install all the software environment (including compilers and libraries) needed to run CESM/NorESM on a Virtual Machine (like those available on the Norwegian Research and Education Cloud, the Google Cloud Platform, etc.), but a similar process allows to run the model(s) on a personal computer, laptop or desktop running **Centos7** (this distribution is convenient to use since it already contains most of the essential software packages). The objective here is not to compete against HPCs in terms of sheer computing power, but to satisfy the everyday needs of the vast majority of CESM/NorESM developpers in terms of model development, debugging or testing, as well as for training/teaching purposes. For this example we start with a completely empty machine with the Centos7 Linux Distribution, 16x Intel Core Processors (Haswell, no TSX), 128GB RAM, and a 100GiB volume (disk) attached on **/dev/sdb**. The name of the user is **centos** (if your user name is different you will have to use your *username* instead). The first step is to format the volume (if your disk is already formated and/or contains data, skip this step, but still create the **/opt/uio** folder since this is where the model(s) are configured to read/write). :: sudo mkfs.ext4 /dev/sdb then mount it at /opt/uio :: sudo mkdir /opt/uio sudo chown -R centos /opt/uio sudo chgrp -R centos /opt/uio sudo mount /dev/sdb /opt/uio cd /opt/uio and create the following folders: :: mkdir /opt/uio/inputdata mkdir /opt/uio/work mkdir /opt/uio/archive mkdir /opt/uio/archive/cases Now we can install a few packages which will be needed later (to get the model(s), etc.) and miniconda (accept the terms of the license and accept the default location **/home/centos/miniconda3**, then answer yes to the question *"Do you wish the installer to initialize Miniconda3 by running conda init"*, exit the virtual machine and re-login). :: sudo yum install wget git subversion csh -y wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash Miniconda3-latest-Linux-x86_64.sh exit You will notice the next time you login the Virtual Machine that the prompt starts with *(base)* which indicates that you are in the base conda environment (since you accepted it during the miniconda install). We recommend to create a new **esm** conda environment before adding the **bioconda** and **conda-forge** channels (in this order) and installing cesm :: conda create -n esm conda activate esm conda config --add channels bioconda conda config --add channels conda-forge conda install cesm=2.1.3 The prompt should start with *(esm)* indicating that the esm conda environment has been activated, and every time you login you will have to type **conda activate esm** to be able to run the model(s). This will have installed CESM2.1.3 as well as all the necessary compilers and libraries (HDF5, NetCDF, MKL, etc.) and their dependencies, and the very same environment can be used with NorESM. In order to run the model(s) you still need configuration files (namely *config*, *config_machines.xml* and *config_compilers.xml*). These will eventually come with NorESM, but for the sake of convenience we provide hereafter an example of such files which have to be located in a **.cime** folder in your home directory (simply copy & past the content of the following cell to generate the files automatically and be carefull not to add any odd characters or lines since CESM/NorESM are extremely picky about it). Notice that you only need to do this once, since both CESM and NorESM will use these configurations, and that the name of the machine created is **espresso**. :: cd /home/centos mkdir .cime cd .cime cat >> config << EOF [main] CIME_MODEL=cesm EOF cat >> config_machines.xml << EOF Virtual Machine with 16 VCPUs and 128GiB memory OS is Centos7, Conda CESM environment UNSET LINUX UNSET gnu mpich UNSET /opt/uio/work /opt/uio/inputdata UNSET /opt/uio/archive/$CASE UNSET UNSET 16 none noresmCommunity 16 16 FALSE mpiexec -np \$TOTALPES 64M -1 EOF cat >> config_compilers.xml << EOF mpifort x86_64-conda_cos6-linux-gnu-ar x86_64-conda_cos6-linux-gnu-gfortran x86_64-conda_cos6-linux-gnu-cc x86_64-conda_cos6-linux-gnu-c++ mpifort mpicc mpicxx /home/centos/miniconda3/envs/esm -O2 -fdefault-real-8 -finit-local-zero -L\$(NETCDF_PATH)/lib -lnetcdff -lnetcdf -ldl -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lomp -lpthread -lm EOF To create a new CESM case F2000climo at resolution f19_g17 and run it for **1 day**, and because (for CESM only) *create_newcase* has been added to the *PATH*, simply type (from anywhere on the machine): :: create_newcase --case /opt/uio/archive/cases/conda_CESM213_F2000climo_f19_g17 --compset F2000climo --res f19_g17 --machine espresso --run-unsupported cd /opt/uio/archive/cases/conda_CESM213_F2000climo_f19_g17 NUMNODES=-1 ./xmlchange --file env_mach_pes.xml --id NTASKS --val ${NUMNODES} ./xmlchange --file env_mach_pes.xml --id NTASKS_ESP --val 1 ./xmlchange --file env_mach_pes.xml --id ROOTPE --val 0 ./xmlchange STOP_N=1 ./xmlchange STOP_OPTION=ndays ./case.setup ./case.build ./case.submit Hopefully this should create the case, configure it, compile it (for this particular machine the compilation time is less then 3 minutes) and run it (starting with the download of the necessary input files the first time you run it). For NorESM, first clone the github repository, here in /opt/uio/**noresm2**, as follows (be careful: you have to be in the **(base)** conda environment for that): :: cd /opt/uio git clone -b noresm2 https://github.com/NorESMhub/NorESM.git noresm2 cd noresm2/ sed -i.bak "s/'checkout'/'checkout', '--trust-server-cert'/" ./manage_externals/manic/repository_svn.py ./manage_externals/checkout_externals -v To create a "similar" NorESM case NF2000climo at resolution f19_tn14 and also run it for **1 day**, and after having activated the **(esm)** environment (if you are not already in it), do: :: cd /opt/uio/noresm2/cime/scripts ./create_newcase --case /opt/uio/archive/cases/conda_NorESM_NF2000climo_f19_tn14 --compset NF2000climo --res f19_tn14 --machine espresso --run-unsupported cd /opt/uio/archive/cases/conda_NorESM_NF2000climo_f19_tn14 NUMNODES=-1 ./xmlchange --file env_mach_pes.xml --id NTASKS --val ${NUMNODES} ./xmlchange --file env_mach_pes.xml --id NTASKS_ESP --val 1 ./xmlchange --file env_mach_pes.xml --id ROOTPE --val 0 ./xmlchange STOP_N=1 ./xmlchange STOP_OPTION=ndays ./case.setup ./case.build ./case.submit On our machine the compilation takes less then 3 minutes, and if everything went well the input files should download automatically before the run starts. Note: AeroTab is supposed to be a folder, if a file has been created instead simply add a "trailing slash" (/) at line 1946 in ``components/cam/bld/namelist_files/namelist_defaults_cam.xml`` (which has to be written as: noresm-only/atm/cam/camoslo/AeroTab_8jun17/) and resubmit. Adding a new platform ''''''''''''''''''''' Edit the following files: :: config_batch.xml config_compilers.xml config_machines.xml located in :: /cime/config/cesm/machines/ config_batch.xml ^^^^^^^^^^^^^^^^ Add a batch_system entry in this file for your platform with appropriate settings. See examples below. Machine example with SLURM batch system on Fram: :: sbatch --ntasks={{ total_tasks }} --export=ALL --switches=1 normal On Tetralith: :: sbatch default development Machine example with PBS batch system :: -A nn2345k -l select={{ num_nodes }}:ncpus={{ MAX_TASKS_PER_NODE }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }} workq config_compilers.xml ^^^^^^^^^^^^^^^^^^^^ Add a compiler entry in this file for your platform with appropriate settings. See examples below. On Fram: :: -D$(OS) -xCORE-AVX2 -no-fma $(EBROOTNETCDFMINFORTRAN) $(EBROOTPNETCDF) $(MPI_ROOT) mpi -O2 -r8 -init=zero,arrays mpiicc mpiicpc mpiifort lustre -mkl=sequential -lnetcdff -lnetcdf On Tetralith: :: mpiicc mpiicpc mpiifort $ENV{PNETCDF_DIR} $ENV{NETCDF_DIR} -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -xHost -fPIC -mcmodel=large -O0 -xAVX -r8 -xHost -fPIC -mcmodel=large -mkl config_machines.xml ^^^^^^^^^^^^^^^^^^^ Add a machine entry in this file for your platform with appropriate settings. See examples below. On Fram: :: Lenovo NeXtScale M5, 32-way nodes, dual 16-core Xeon E5-2683@2.10GHz, 64 GiB per node, os is Linux, batch system is SLURM LINUX intel impi /cluster/work/users/$USER/noresm /cluster/shared/noresm/inputdata UNSET /cluster/work/users/$USER/archive/$CASE /projects/NS2345K/noresm/cases login.nird.sigma2.no UNSET UNSET 8 slurm noresmCommunity 32 32 TRUE mpirun /cluster/software/lmod/lmod/init/perl /cluster/software/lmod/lmod/init/env_modules_python.py /cluster/software/lmod/lmod/init/csh /cluster/software/lmod/lmod/init/sh /cluster/software/lmod/lmod/libexec/lmod perl /cluster/software/lmod/lmod/libexec/lmod python module module --force StdEnv intel/2018a netCDF-Fortran/4.4.4-intel-2018a-HDF5-1.8.19 PnetCDF/1.8.1-intel-2018a CMake/3.9.1 64M lustre on -1 On Tetralith: :: Tetralith Linux Cluster (NSC, Sweden), 32 pes/node, batch system SLURM LINUX intel impi snic2019-1-2 bolinc /proj/$CHARGE_ACCOUNT/users/$ENV{USER}/noresm2 /proj/cesm_input-data/inputdata/ /proj/cesm_input-data/inputdata/atm/datm7 $CIME_OUTPUT_ROOT/cesm_archive/$CASE $CIME_OUTPUT_ROOT/cesm_baselines /$CIME_OUTPUT_ROOT/cesm_tools/cprnc/cprnc 4 slurm snic 32 32 TRUE mpprun