COLD: Boosting your Workflow and Performances with Scilab – ScilabTEC 2015
By Béatrice Creusillet, Silkan
ScilabTEC 2015 - Silkan from Scilab on Vimeo.
Scilab is a powerful computing environment used to design high level engineering and scientific applications. A typical development workflow usually involves a prototyping phase, dedicated to designing the algorithms, and a releasing phase, devoted to deploying the application on the target platform. This last step often requires rewriting the application in a lower level language, either for performance or scaling reasons, or because Scilab is not available on the target hardware (in the case of embedded devices for instance). COLD means to spare you the releasing step, by bringing the performance/scalability directly from inside the Scilab developing environment, or by building reusable libraries or stand-alone executables in a push-button way.
COLD is a tool set consisting in a compiler and a run-time library. Its core component is its Scilab to high-performance C++ compiler, which already supports a large subset of Scilab language basics and functions. It produces statically typed, optimized and, when relevant, parallel C++11 code, relying on COLD run-time and 3rd party optimized libraries (like the Intel MKL). COLD provides the necessary APIs for the Scilab user to require the compilation of selected scripts without leaving his Scilab environment : within tenths of seconds, the resulting code is available for storage and use by the current Scilab model.
One of the strength of COLD lies in its type-inference engine. In high-level dynamic languages such as Scilab, the type of variables is determined on the fly. On the contrary, COLD precisely identifies the closest mathematical type (e.g. integer), data structure (e.g. array) and shape (dimension and size) of each variable, to optimize data storage and accesses, and avoid costly run-time checks, which is key to achieve good performances. A DSeL integrated as pragmas in Scilab is also provided to allow the user to drive the type-inference mechanism, by enforcing specific types or specifying particular mathematical properties of data. This DSeL offers the possibility to produce libraries with user-defined interfaces, allowing an automatic integration of the compiled code in user applications.
During the presentation, we will demonstrate how COLD can help achieving high performance execution of Scilab scripts, with reference to examples from various domains, including some industrial cases addressed in the SIMILAN, RICHELIEU and MECASIF collaborative projects. Future work will primarily focus on extending COLD current capabilities of parallel code generation for shared memory devices, and leveraging data-parallelism to generate OpenCL/Cuda code for GPU.
Co-signed paper by Béatrice Creusillet, Philippe Ravier, Thomas Izard – SILKAN