Abstract
MATLAB is a popular dynamic array-based language commonly used by students, scientists and engineers who appreciate the interactive development style, the rich set of array operators, the extensive builtin library, and the fact that they do not have to declare static types. Even though these users like to program in MATLAB, their computations are often very compute-intensive and are better suited for emerging high performance computing systems. This paper reports on MIX10, a source-to-source compiler that automatically translates MATLAB programs to X10, a language designed for "Performance and Productivity at Scale"; thus, helping scientific programmers make better use of high performance computing systems.
There is a large semantic gap between the array-based dynamically-typed nature of MATLAB and the object-oriented, statically-typed, and high-level array abstractions of X10. This paper addresses the major challenges that must be overcome to produce sequential X10 code that is competitive with state-of-the-art static compilers for MATLAB which target more conventional imperative languages such as C and Fortran. Given that efficient basis, the paper then provides a translation for the MATLAB parfor construct that leverages the powerful concurrency constructs in X10.
The MIX10 compiler has been implemented using the McLab compiler tools, is open source, and is available both for compiler researchers and end-user MATLAB programmers. We have used the implementation to perform many empirical measurements on a set of 17 MATLAB benchmarks. We show that our best MIX10-generated code is significantly faster than the de facto Mathworks' MATLAB system, and that our results are competitive with state-of-the-art static compilers that target C and Fortran. We also show the importance of finding the correct approach to representing the arrays in the generated X10 code, and the necessity of an IntegerOkay' analysis that determines which double variables can be safely represented as integers. Finally, we show that our X10-based handling of the MATLAB parfor greatly outperforms the de facto MATLAB implementation.
Supplemental Material
Available for Download
This is the artifact accompanying the paper titled "MiX10: Compiling MATLAB to X10 for High performance". It contains the following files and directories: 1. artifact_guide.pdf, 2. MiX10.jar, 3. library, 4. examples, 5. output, 6. languages
- GNU Octave. http://www.gnu.org/software/octave/index.html.Google Scholar
- J. Bezanson, S. Karpinski, V. B. Shah, and A. Edelman. Julia: A Fast Dynamic Language for Technical Computing. CoRR, abs/1209.5145, 2012.Google Scholar
- J. Doherty. McSAF: An Extensible Static Analysis Framework for the MATLAB Language. Master's thesis, McGill University, December 2011.Google Scholar
- J. Doherty and L. Hendren. McSAF: A static analysis framework for MATLAB. In Proceedings of ECOOP 2012, pages 132--155, 2012. Google Scholar
Digital Library
- J. Doherty, L. Hendren, and S. Radpour. Kind analysis for MATLAB. In In Proceedings of OOPSLA 2011, pages 99--118, 2011. Google Scholar
Digital Library
- A. Dubrau and L. Hendren. Taming MATLAB. In Proceedings of OOPSLA 2012, pages 503--522, 2012. Google Scholar
Digital Library
- IBM. X10 programming language. http://x10-lang.org, Feb. 2012.Google Scholar
- IBM. APGAS programming in X10 2.4, 2013. http://x10-lang.org/documentation/tutorials/apgas-programming-in-x10-24.html.Google Scholar
- IBM. An introduction to X10, 2013. http://x10.sourceforge.net/documentation/intro/latest/html/node4.html.Google Scholar
- INRIA. Scilab, 2009. http://www.scilab.org/platform/.Google Scholar
- V. Kumar and L. Hendren. First steps to compiling Matlab to X10. In Proceedings of the third ACM SIGPLAN X10 Workshop, X10 '13, pages 2--11, New York, NY, USA, 2013. ACM. Google Scholar
Digital Library
- J. Li. McFor: A MATLAB to FORTRAN 95 Compiler. Master's thesis, McGill University, August 2009.Google Scholar
- X. Li and L. Hendren. Mc2for: A tool for automatically translating matlab to fortran 95. In In Proceedings of CSMR-WCRE 2014, pages 234--243, 2014.Google Scholar
Cross Ref
- MathWorks. MATLAB Coder. http://www.mathworks.com/products/matlab-coder/.Google Scholar
- Mathworks. Reduction variables. http://www.mathworks.com/help/distcomp/advanced-topics.html#bq_of7_-3.Google Scholar
- MathWorks. Parallel computing toolbox, 2013. http://www.mathworks.com/products/parallel-computing/.Google Scholar
- A. Prasad, J. Anantpur, and R. Govindarajan. Automatic compilation of MATLAB programs for synergistic execution on heterogeneous processors. In Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation, PLDI '11, pages 152--163, New York, NY, USA, 2011. ACM. Google Scholar
Digital Library
- M. J. Quinn, A. Malishevsky, N. Seelam, and Y. Zhao. Preliminary Results from a Parallel MATLAB Compiler. In Proceedings of Int. Parallel Processing Symp., IPPS, pages 81--87, 1998. Google Scholar
Digital Library
- L. D. Rose and D. Padua. Techniques for the translation of MATLAB programs into Fortran 90. ACM Trans. Program. Lang. Syst., 21(2):286--323, 1999. Google Scholar
Digital Library
- Scipy.org. Numpy. http://www.numpy.org/.Google Scholar
- T. Soh. Design and implementation of a DSL based on Ruby for parallel programming. Technical report, The University of Tokyo, Jan. 2011.Google Scholar
- H. Wei, H. Tan, X. Liu, and J. Yu. StreamX10: a stream programming framework on X10. In Proceedings of the 2012 ACM SIGPLAN X10 Workshop, X10 '12, pages 1:1--1:6, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
Index Terms
MIX10: compiling MATLAB to X10 for high performance
Recommendations
MIX10: compiling MATLAB to X10 for high performance
OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & ApplicationsMATLAB is a popular dynamic array-based language commonly used by students, scientists and engineers who appreciate the interactive development style, the rich set of array operators, the extensive builtin library, and the fact that they do not have to ...
First steps to compiling Matlab to X10
X10 '13: Proceedings of the third ACM SIGPLAN X10 WorkshopMatlab is a popular dynamic array-based language commonly used by students, scientists and engineers, who appreciate the interactive development style, the rich set of array operators, the extensive builtin library, and the fact that they do not have to ...
Automatic generation of parallel C code for stencil applications written in MATLAB
ARRAY 2016: Proceedings of the 3rd ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array ProgrammingHigh-level programming languages such as MATLAB are widely used in scientific domains to implement prototypes based on mathematical models. These prototypes are finally often re-implemented in low-level languages to reach execution times required for ...







Comments