SiMLInt

Logo

Simulation and Machine Learning Integration (simlint@mlist.is.ed.ac.uk)

View the Project on GitHub EPCCed/SiMLInt

Running SiMLInt LC Simulation (Inference)

Running a simulation with LC using the SiMLInt framework requires SmartSim, BOUT++ (with modified hw.cxx) and TensorFlow. To install these, follow the example installation. Now the SmartRedis Client is included to send/receive data from the SmartRedis database, request ML model runs and add the inferred error correction to BOUT++ internal variables for vorticity and density.

module load intel-20.4/mpi
module load intel-20.4/compilers
module load fftw/3.3.10-intel20.4-impi20.4
module load netcdf-parallel/4.9.2-intel20-impi20
module load cmake

cd $SIMLINT_HOME/HW-error-correction

cmake . -B build -Dbout++_DIR=$WORK/BOUT-dev/build -DCMAKE_CXX_FLAGS=-std=c++17 -DCMAKE_BUILD_TYPE=Release
cmake --build build --target hasegawa-wakatani

Modify the job submission file submit-hw.sh to reference the model files produced in the model training phase (step 5), for example:

model_vort=${WORK}/models/model-hw-20240427-164026-vort.pb
model_n=${WORK}/models/model-hw-20240427-210530-dens.pb

The file name includes the timestamp when the model was trained and will be different in your example run.

To run a simulation:

cd $SIMLINT_HOME/6-simulation
sbatch submit-hw.sh --account $ACCOUNT

The output should differ slightly from a “pure” BOUT++ Hasegawa-Wakatani in that information about the SmartRedis database is given, and extra lines are produced during simulation to give timing information on communication with the database.

To visualise the result of this, or any other BOUT++ simulations, see the Jupyter Notebook, Visualise.ipynb. See Cirrus Docs for notes on running Jupyter Lab on Cirrus.

< Back