skip to main content
research-article

MIX10: compiling MATLAB to X10 for high performance

Published:15 October 2014Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

References

  1. GNU Octave. http://www.gnu.org/software/octave/index.html.Google ScholarGoogle Scholar
  2. J. Bezanson, S. Karpinski, V. B. Shah, and A. Edelman. Julia: A Fast Dynamic Language for Technical Computing. CoRR, abs/1209.5145, 2012.Google ScholarGoogle Scholar
  3. J. Doherty. McSAF: An Extensible Static Analysis Framework for the MATLAB Language. Master's thesis, McGill University, December 2011.Google ScholarGoogle Scholar
  4. J. Doherty and L. Hendren. McSAF: A static analysis framework for MATLAB. In Proceedings of ECOOP 2012, pages 132--155, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Doherty, L. Hendren, and S. Radpour. Kind analysis for MATLAB. In In Proceedings of OOPSLA 2011, pages 99--118, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Dubrau and L. Hendren. Taming MATLAB. In Proceedings of OOPSLA 2012, pages 503--522, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. IBM. X10 programming language. http://x10-lang.org, Feb. 2012.Google ScholarGoogle Scholar
  8. IBM. APGAS programming in X10 2.4, 2013. http://x10-lang.org/documentation/tutorials/apgas-programming-in-x10-24.html.Google ScholarGoogle Scholar
  9. IBM. An introduction to X10, 2013. http://x10.sourceforge.net/documentation/intro/latest/html/node4.html.Google ScholarGoogle Scholar
  10. INRIA. Scilab, 2009. http://www.scilab.org/platform/.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Li. McFor: A MATLAB to FORTRAN 95 Compiler. Master's thesis, McGill University, August 2009.Google ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. MathWorks. MATLAB Coder. http://www.mathworks.com/products/matlab-coder/.Google ScholarGoogle Scholar
  15. Mathworks. Reduction variables. http://www.mathworks.com/help/distcomp/advanced-topics.html#bq_of7_-3.Google ScholarGoogle Scholar
  16. MathWorks. Parallel computing toolbox, 2013. http://www.mathworks.com/products/parallel-computing/.Google ScholarGoogle Scholar
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. Scipy.org. Numpy. http://www.numpy.org/.Google ScholarGoogle Scholar
  21. T. Soh. Design and implementation of a DSL based on Ruby for parallel programming. Technical report, The University of Tokyo, Jan. 2011.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. MIX10: compiling MATLAB to X10 for high performance

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 49, Issue 10
      OOPSLA '14
      October 2014
      907 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2714064
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications
        October 2014
        946 pages
        ISBN:9781450325851
        DOI:10.1145/2660193

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 15 October 2014

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!