AuthorsG. Y. Paulsen, S. Clark, B. Nordmoen, S. Nenakhov, A. Andersson, X. Cai and H. P. Dahle
EditorsC. Rückemann and D. Vucinic
TitleAutomated Translation of MATLAB Code to C++ with Performance and Traceability
AfilliationScientific Computing
Project(s)Meeting Exascale Computing with Source-to-Source Compilers
StatusPublished
Publication TypeProceedings, refereed
Year of Publication2017
Conference NameThe Eleventh International Conference on Advanced Engineering Computing and Applications in Sciences (ADVCOMP 2017)
Pagination50-55
Date Published11/2017
PublisherInternational Academy, Research and Industry Association (IARIA)
ISBN Number978-1-61208-599-9
ISSN Number2308-4499
KeywordsC++, Code translation, Image processing, Matlab, Seismology
Abstract

In this paper, we discuss the implementation and performance of m2cpp: an automated translator from MATLAB code to its matching Armadillo counterpart in the C++ language. A non-invasive strategy has been adopted, meaning that the user of m2cpp does not insert annotations or additional code lines into the input serial MATLAB code. Instead, a combination of code analysis, automated preprocessing and a user-editable metainfo file ensures that m2cpp overcomes some specialties of the MATLAB language, such as implicit typing of variables and multiple return values from functions. Thread-based parallelisation, using either OpenMP or Intel's Threading Building Blocks (TBB) library, can also be carried out by m2cpp for designated for-loops. Such an automated and non-invasive strategy allows maintaining an independent MATLAB code base that is favoured by algorithm developers, while an updated translation into the easily readable C++ counterpart can be obtained at any time. Illustrating examples from seismic data processing are provided in this paper, with performance results obtained on multicore Sandy Bridge CPUs and Intel's Knights-Landing Xeon Phi processor.

URLhttp://www.thinkmind.org/index.php?view=article&articleid=advcomp_2017_4_30_20088
Citation Key25801

Contact person