This project customizes the SODECL project originally developed by Lefteris Avramidis to the needs of the UKCA community.
The UKCA community is part of NCAS (National Center of Atomspheric Science) : [[https://ncas.ac.uk/]]
SODECL is a library of ordinary differential equation (ODE) and stochastic differential equation (SDE) solvers in OpenCL. Using SODECL the user can calculate the integration orbits of a ODE or SDE system for a large number of different parameter values.
The original project focused on biological research (see publication in their documentation). This project focuses more on simulation of aerosols an chemicals in the atmosphere, which is the focus of the UKCA community.
Much of the following prerequisites are copied from the original project.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To get the code you will need git. To install git on Ubuntu use the following commands in a terminal
sudo apt update
sudo apt install git
To clone the repository from github use the following command in a terminal
git clone https://github.com/RSE-Cambridge/sodecl-ukca/
You will need pybind11, to clone the repository in the sodecl folder use the following commands in a terminal
cd sodecl
git submodule update --init
You will need lsb-core, to install it you the following command in a terminal
sudo apt install lsb-core
To generate the makefile for compiling SODECL you will need cmake. To install cmake on Ubuntu use the following command in a terminal
sudo apt install cmake
To use the Python wrapper a number of module must be installed. To install these modules use the following commands in a terminal
sudo apt install python3-numpy
sudo pip3 install numpy
sudo pip3 install matplotlib
You will need an OpenCL Runtime.
For Intel Core and Intel Xeon Processors to run SODECL on an Intel CPU. The runtime can be downloaded from https://software.intel.com/en-us/articles/opencl-drivers#latest_CPU_runtime. In the folder with the downloaded tgz file use the following commands in a terminal
tar -zxvf l_opencl_p_18.1.0.014.tgz
cd l_opencl_p_18.1.0.014
sudo ./install_GUI.sh
You will need to install the OpenCL library. To do that use the following commands in a terminal
sudo apt install ocl-icd-opencl-dev
For AMD, you need the AMD Accelerated Parallel Processing (APP) runtime. It contains OpenCL runtime and OCL-ICD drivers
A step by step series of examples that tell you have to get a development env running
To generate the makefiles use the following commands in a terminal in the sodecl folders
mkdir build
cd build
cmake ..
To build SODECL use the following command
make
Currently, one UKCA mini-app has been ported to use SODECL. It simulates the development of 8 different chemicals, and prints their development over 5 days.
To run the example using the Python wrapper use the following commands in a terminal the build directory
cd examples
python3 ukca_ie.py
If the run was successful the output will be similar to the following
# orbits: 1000; #equations per orbit: 8; runtime: 0.10827 sec.
# orbits: 10000; #equations per orbit: 8; runtime: 0.463016 sec.
# orbits: 100000; #equations per orbit: 8; runtime: 5.64368 sec.
Using the following command in a terminal in the pythonwrapper directory the log generated by the SODECL run can be viewed
more sodecllog.txt
The output for a successful run should be similar to the following. The log file includes the OpenCL platforms and devices available in the system. Also, it includes the build options for the OpenCL kernel and the runtime.
Compute results runtime: 0.0690873 sec.
Simulation execution time: 0.5892870426177979 seconds.
The platform name is NVIDIA CUDA
The platform version is OpenCL 1.2 CUDA 11.2.136
The device name is GeForce GTX 1080
The platform name is Portable Computing Language
The platform version is OpenCL 1.2 pocl 1.6, Release, LLVM 11.0.0, RELOC, SLEEF, DISTRO, POCL_DEBUG
The device name is pthread-Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Selected platform name: NVIDIA CUDA
Selected device name: GeForce GTX 1080
Selected device OpenCL version: OpenCL 1.2 CUDA
kernels/ie.cl
Build options string: -I.
The local group size is: 0
# orbits: 100000; #equations per orbit: 8; runtime: 5.64368 sec.
While a number of solvers are implemented in the original work, for UKCA we have only experimented with Implicit Euler.
This project is licensed under the MIT License - see the LICENSE file for details
To cite SODECL please cite the URL and the DOI of the release version you used. The DOI of the latest release is at the badge at the top of this README.md file.
The original SODECL repository can be found here: [[https://github.com/RSE-Cambridge/sodecl]]
- The initial work on this library was done as part of a PhD work presented in the publication Avramidis, Eleftherios, and Ozgur E. Akman. "Optimisation of an exemplar oculomotor model using multi-objective genetic algorithms executed on a GPU-CPU combination." BMC systems Biology 11.1 (2017): 40. DOI: 10.1186/s12918-017-0416-2