Skip to content

Using HPE SmartSim with CESM

jedwards4b edited this page Jul 19, 2021 · 10 revisions

Currently the CESM interface to SmartSim is on a branch and the SmartSim interface only works on casper.

First you need to install the SmartSim tool, you should only need to do this once, from a casper login:

  1. module purge
  2. module load python/3.7.9 gnu/9.1.0 ncarenv ncarcompilers cmake
  3. ncar_pylib -c 20201220 /glade/work/$USER/casper_npl_clone
  4. ncar_pylib casper_npl_clone
  5. pip install --no-cache-dir smartsim
  6. smart --device cpu (this step requires gnu make >- 4.0, my build is in /glade/work/jedwards/make-4.3/bin)

Then you need the SmartRedis library

  1. pip install --no-cache-dir smartredis
  2. git clone git@github.com:jedwards4b/SmartRedis.git SmartRedis
  3. pip install --no-cache-dir cmake
  4. cd SmartRedis
  5. make lib LIBRARY_PATH=pwd/install/lib
  6. export REDIS_HOME=pwd

After you have completed the above steps once you just need to repeat step 4 each time you login.

  1. git clone https://github.com/jedwards4b/cesm -b jedwards/smartsim cesm2_3.smartsim
  2. cd cesm2_3.smartsim/cime/scripts
  3. create the case **you must specify the nuopc interface with --driver=nuopc **
  4. cd casedir
  5. ./xmlchange USE_SMARTSIM=TRUE

The call to initialize smartredis is in components/cmeps/driver/cime/esmApp.F90 and the client variable is sr_client the client is available in any component by adding the line use esm_utils_mod, only: sr_client

Once you have completed the build step and you are ready to submit a job:

  1. export CESM_ROOT=/path/to/src/cesm2_3.smartsim
  2. $CESM_ROOT/cime/tools/smartsim/launch.py (--help for options)
  3. This will start the database and your case or cases.