- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to profile my code using gprof and compile using the -pg command but when I run the executable no gmon.out is produced. My code contains a few modules and links to the Math Kernel Library(blas) if that is necessary to know.
I compile my code using:
ifort -module ../mod -pg [all my files.f90] -mkl -lmkl_blas95_lp64
I've also tried doing it piecemeal by creating the object and .mod files then linking to see if that would make a difference but nothing.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try using -p instead. -pg is deprecated and it's possible it's being ignored, but you should get a message if that's the case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you would need to link the static MKL libraries if you wish their timings to appear in the profile. You still will not get full gprof information (call counting), as the libraries weren't built for profiling. If you have module procedures, those would need to be built with profiling options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the replies but neither option worked. I used -p and -static-intel but I'm still not getting any output produced after I run the executable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be able to generate gmon.out even if it is not capturing MKL timings. However, you will need to follow the MKL link advisor to get static linked MKL. http://software.intel.com/sites/products/mkl/MKL_Link_Line_Advisor%2B%2B.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm still not getting a gmon.out. I'm on Mac 10.8.4. I've also tried this with g++ and ifort with a different program but no gmon.out is produced. I've searchd on the internet and think it might be a problem with Mountain Lion unless anyone else has been able to do it. I've decided to try out Instruments and see if I can get time in each routine that way unless I can find a way to work gprof.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried a small experiment on Linux (not MacOS).
I used the canonical hello-world program written in both C and Fortran, used the -pg switch, and the C program created the gmon.out, but the Fortran one did not.
At first glance, I didn't see anything obviously different in the setup between the two compilers, so we'll need to look under the hood.
--Lorri
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page