Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4999 Discussions

Help! How to use Intel Vtune to profile a MEX DLL in Matlab?

losemind
Beginner
458 Views
Help! How to use Intel Vtune to profile a MEX DLL in Matlab?

Hi all,

I am using Intel Vtune to profile a mex dll in Matlab:

but I got the following error after I set up the Vtune side and when I tried to launch the dll inside Matlab:

----------

??? Invalid MEX-file 'C:MyProjects ry2.dll': Invalid access to memory location.

----------

I believe this is a side-effect after Intel VTune instrumented my try2.dll. This didn't not happen before I set up the Intel VTune, i.e., try2.dll was running all successfully previously.

What can I do now? There must be some experts here who had played with Intel Vtune along with Matlab mex dll.

Thanks a lot!

0 Kudos
2 Replies
losemind
Beginner
458 Views
My environment is:

Windows XP, MSVisual Studio 2003.Net, Intel VTune 9.0 upgrade 3, Matlab 2007a
0 Kudos
CTOptimizer
Beginner
458 Views

I regularly do this, but most recently I have been using "calllib" in MATLAB to call a generic Windows DLL with my code in it. To profile, I create a VTune project with "no executable to launch".

I then start profiling (hit F5), switch to MATLAB and exercise the DLL, and then stop profiling (sh-F5). This will properly profile all modules in the system. You could then drill down into your "try2.dll" in the module list. This should give you basic timing info.(make sure all the debug info is generated for the mex file so you can view source. i.e. -g flag in MATLAB, or usual "debug build" in Visual Studio).

How are you generating the MEX file anyway? With Visual Studio, or with MATLAB's "mex" command?

I haven't yet figured out how to get more detailed profiling as many types of VTune events require multiple runs, which likely doesn't work for a project with "no executable".

At least that is a start...

Good Luck.

0 Kudos
Reply