The E3SM model can be run within the E3SM Singularity container. This page describes how to install Singularity on your Linux laptop/workstation, build or download the E3SM container, and run the E3SM model within the container.
Note: the container is limited to the resources of the single node or workstation it runs on so keep your case sizes in mind.
If you have a Mac/Windows machine, use the Docker container
Install Singularity
Linux: Install Singularity as described at Singularity Installation.
Mac terminal: https://singularity.lbl.gov/install-mac
Mac desktop app: https://sylabs.io/singularity-desktop-macos/
Windows: https://singularity.lbl.gov/install-windows
Download the E3SM container
The latest version of the E3SM container can be downloaded from e3sm.sif.
Singularity on supported machines
...
Cooley (part of ALCF) https://www.alcf.anl.gov/support-center/cooley/singularity-cooley
Download the E3SM container
The latest version of the E3SM container can be downloaded from e3sm.sif.
Example: Run the container on Anvil
Log in to Blues at LCRC, reserve an Anvil node for an interactive job, and run a case:Assume you are in your home directory and have already cloned the code into a directory call E3SM
Also do mkdir -p $HOME/projects/e3sm/cesm-inputdata
(this directory is assumed to exist by the machine entry above. Input data will be downloaded here. (could get large, THE CONTAINER DOES NOT HAVE INPUT DATA)).
[lukasz@blueslogin4 ~]$ module load singularity
[lukasz@blueslogin4 ~]$ srun --pty -p acme-small -t 01:00:00 /bin/bash
(after hear you are on the interactive node)[lukasz@b566]$ singularity shell --hostname singularity e3sm.sif
(after here you are inside the container)Singularity> cd E3SM/cime/scripts/
Singularity> ./create_newcase --case singularity.A_WCYCL1850.ne4_oQU240.baseline --compset A_WCYCL1850 --res ne4_oQU240 --mach singularity
Singularity> cd singularity.A_WCYCL1850.ne4_oQU240.baseline/
Singularity> ./case.setup
Singularity> ./case.build
Singularity> ./case.submit
There is no batch system so ./case.submit launches an interactive job and you get to watch the output from mpirun and will have to wait until the model finishes. So instead launch it like this:
Singularity> ./case.submit >& case.out &
You can then cd to the rundir and look at the log files as they are made or do other things inside the container. If you exit the container, the job will not finish.
Advanced: Rebuilding the E3SM container
If you would like to make any changes to the container, you can build it from scratch. The E3SM Singularity definition file is available at e3sm.def. After editing the definition file, build a new container:
...
It may take up to an hour to create a new container.
Run the E3SM developer tests
Get a clone of the master branch with all submodules:
...
Advanced: Add singularity to older code.
You can run older code with singularity by adding the right machine config entries.
Add a corresponding machine
element to cime_config/machines/config_machines.xml:
...
Code Block | ||
---|---|---|
| ||
<compiler COMPILER="gnu" MACH="singularity"> <HDF5_PATH> $ENV{HDF5_PATH}</HDF5_PATH> <NETCDF_PATH> $(NETCDF_PATH)</NETCDF_PATH> <PNETCDF_PATH> $(PNETCDF_PATH)</PNETCDF_PATH> <ADD_SLIBS> $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -lblas -llapack</ADD_SLIBS> </compiler> |
At this point OR you can run create entries for the container
mkdir -p $HOME/projects/e3sm/cesm-inputdata
(this directory is assumed to exist by the machine entry above. Input data will be downloaded here. (could get large)).
singularity shell --hostname singularity e3sm.sif
Singularity> cd <E3SM_SRC_DIR>/cime/scripts
Singularity> ./create_test e3sm_developer
The developer test creates and runs 36 cases. To create a new case separately and run it, for example A_WCYCL1850 with ultra low resolution:
Singularity> ./create_newcase --case master.A_WCYCL1850.ne4_oQU240.baseline —-compset A_WCYCL1850 —-res ne4_oQU240
Singularity> cd master.A_WCYCL1850.ne4_oQU240.baseline
Singularity> ./case.setup
Singularity> ./case.build
Singularity> ./case.submit
in separate config files in the $HOME/.cime directory. See http://esmci.github.io/cime/versions/master/html/users_guide/cime-config.html#cime-user-config-directory
At this point you can run the container.
For more details on how to create a new case and run it, please refer to E3SM Quick Start