Question re: Matlab Coder, OpenMP, and compiling the code on a different machine than i was generated.

6 visualizzazioni (ultimi 30 giorni)
I have a loop I want to convert to Paralellized C code. My machne (Windows 10) has both Matlab Coder and the Parallel computingtoolbox, but I dont have Visual Studio (and thus it appears I am unable to compile the code with openMP enabled on Windows).
The machine I ultimately want to run this code on is a Linux Machine (which has gcc which apparently will compile MEX functions with OpenMP enabled), but I dont have Matlab coder or the parallel computing toolbox on that machine.
Can I generate the parallelized source code (C/C++) on my windows machine, move it to the linux box, and compile it there with mex/gcc to make an OpenMP enabled MEX function (even though I dont have the coder or parallel computing toolbox, it seems like once these things are implemented in C they *should be able to be compiled on any machine, but Im not sure and dont care to waste a bunch of time trying to figure it out by trial and error).
On that note, is there anything special I need to do to make the code compile as a mex function on the Linux machine (as opposed to a library or executable file)?
If this isnt possible, are there any other options for compiling with OpenMP in Windows? I have gcc installed on my windows machine (via WSL, but gcc is supposedly accessable via the command line), though Im not sure if the Windows version of Matlab would be willing/able to accept a Linux gcc compiler...
Windows: OS is windows 10 / Matlab version is 2017b.
Linux: Matlab version is 2017a or 2017b. I think the OS is some flavor of CentOS, but I'd have to check (let me know if this matters or not).
As a somewhat related side question: I have some very large vectorized sums in the code (of the form " sum(sum(sum(sum(W.*X)))) " ) that I would like to be vectorized (in additional to parallelized with OpenMP). Will Matlab coder automatically implement the appropiate AVX/SSE code to make this happen? The Windows / Linux boxes are running an Ivy Bridge i7 / Sandy Bridge Xeon, so no AVX 2 or AVX 512.
Thanks!

Risposte (0)

Categorie

Scopri di più su Code Generation in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by