@misc{14907, keywords = {Code translation, Matlab, C++, Seismology, Image processing}, author = {Geir Paulsen and Stuart Clark and Bj{\o}rn Nordmoen and Sergey Nenakhov and Aron Andersson and Xing Cai and Hans Dahle}, editor = {Claus-Peter R{\"u}ckemann and D. Vucinic}, title = {Automated Translation of MATLAB Code to C++ with Performance and Traceability}, 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{\textquoteright}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{\textquoteright}s Knights-Landing Xeon Phi processor.}, year = {2017}, journal = {The Eleventh International Conference on Advanced Engineering Computing and Applications in Sciences (ADVCOMP 2017)}, pages = {50-55}, month = {11/2017}, publisher = {International Academy, Research and Industry Association (IARIA)}, issn = {2308-4499}, isbn = {978-1-61208-599-9}, url = {http://www.thinkmind.org/index.php?view=article\&articleid=advcomp_2017_4_30_20088}, }