Simulation and Machine Learning Integration (simlint@mlist.is.ed.ac.uk)
Containerised version of SiMLInt have been built for CPU (7.6 GB) and GPU (17.1 GB).
The CPU image can be used to run simulations with and without LC, and to produce ground-truth data. The GPU image can be used to train ML models.
Before you begin, make sure you have the following installed on your system:
For both versions:
For the GPU version:
To pull the Docker image:
docker pull ghcr.io/epcced/simlint:v1.0.0
or
docker pull ghcr.io/epcced/simlint-gpu:v1.0.0
Before running, the containerised-runs
folder must be writable by Docker:
chmod -R 777 $SIMLINT_HOME/files/containerised-runs
To run the SiMLInt Docker image follow these steps:
“Pure” BOUT++ Simulation: Run the following command:
cp $SIMLINT_HOME/files/6-simulation/BOUT.inp $SIMLINT_HOME/files/containerised-runs/data; \
cp $SIMLINT_HOME/files/containerised-runs/BOUT.restart.0.nc $SIMLINT_HOME/files/containerised-runs/data; \
docker run -v $SIMLINT_HOME/files/containerised-runs:/sim -u $(id -u):$(id -g) ghcr.io/epcced/simlint:latest mpirun -np 1 bout-hw nout=10
Ground-truth simulation:
cp $SIMLINT_HOME/files/6-simulation/BOUT.inp $SIMLINT_HOME/files/containerised-runs/data; \
cp $SIMLINT_HOME/files/containerised-runs/BOUT.restart.0.nc $SIMLINT_HOME/files/containerised-runs/data; \
docker run -v $SIMLINT_HOME/files/containerised-runs:/sim -u $(id -u):$(id -g) ghcr.io/epcced/simlint:latest mpirun -np 1 gt-hw nout=10
For these first two commands, the OpenMPI command mpirun -n 1
, which instructs BOUT++ to use one processor only due to the format of the example input data, can be instructed to use N processors mpirun -n N
, however appropriately decomposed input data must be provided.
Inference runs:
cp $SIMLINT_HOME/files/6-simulation/BOUT.inp $SIMLINT_HOME/files/containerised-runs/data && \
cp $SIMLINT_HOME/files/containerised-runs/BOUT.restart.0.nc $SIMLINT_HOME/files/containerised-runs/data && \
docker run -v $SIMLINT_HOME/files/containerised-runs:/sim -v $SIMLINT_HOME/files/models:/models \
-u $(id -u):$(id -g) ghcr.io/epcced/simlint:latest \
smartsim-hw.sh 6899 /models/model-hw-20240427-164026-vort.pb /models/model-hw-20240427-210530-dens.pb 10
That’s it! You have successfully built the SiMLInt Docker image and run it with a volume. Feel free to explore and modify the code inside the container as needed.