Borrar filtros
Borrar filtros

mex setup for openMP using Intel parallel_studio_xe?

2 visualizaciones (últimos 30 días)
Michael Brown
Michael Brown el 19 de Nov. de 2017
Editada: Walter Roberson el 21 de Nov. de 2017
I have successfully used openMP in FORTRAN code compiled previously as mex files under gfortran (having edited the mex.sh file appropriately). I have now updated to the latest versions of matlab and Intel parallel_studio_xe. I can compile and execute mex files. However, the openMP parallelization is not happening. Can anyone tell me the required modifications of the mex setup that will provide the correct compiler and linker options?

Respuestas (1)

James Tursa
James Tursa el 20 de Nov. de 2017
How do you currently do the compile? Have you added the appropriate OpenMP directive to the mex compiler options? E.g., see this link for the directive (looks like it is /qopenmp or /Qopenmp):
  3 comentarios
James Tursa
James Tursa el 21 de Nov. de 2017
Does it need to be -qopenmp instead of -openmp?
Is there a COMPFLAGS line in your setup files?
Michael Brown
Michael Brown el 21 de Nov. de 2017
Editada: Walter Roberson el 21 de Nov. de 2017
Thanks for responding. (1) I don't know whether -qopenmp or -openmp is correct. I could try both if I solved point (2) below.
(2) I am creating the mex file within matlab after running the "mex -setup FORTRAN" command. This correctly sets all the environments so that the mex command then builds a functioning mex code (without the openmp optimization. In earlier versions of matlab, I just went into the matlab app package and hand edited the mexopts.sh file to change compiler flags. I've done that now in R2017b but the changes are not showing up when I "mex" a file - ie. the FFLAGS still show the default list. Therefore, the mex setup script must be reading from a different source file in setting up the environment. As soon as I know where to go to edit a file, I can try to modify with different versions (-openmp vs -qopenmp).

Iniciar sesión para comentar.

Categorías

Más información sobre Execution Speed en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by