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

Windows gcc/gfortran usage

TimP
Honored Contributor III
768 Views

Apparently, the developers have enabled Advisor to work with gnu compilers even on Windows.  It took me weeks to get anywhere with it, as I didn't find any explanations.  Here is what I have done:

$ gfortran  -O3  -funroll-loops --param max-unroll-times=4 -ffast-math -march=native -g3 -gdwarf-2 -mno-fma -cpp -fopenmp maind.F loopdfv.F forttime.f90

Open a Windows cmd window and run advisor\advixe-vars.bat then set up gfortran environment e.g. by \cygwin64\cygwin.bat

run advixe-gui, setting OMP_NUM_THREADS and OMP_SCHEDULE in Advisor environment variables (as well as designating the .exe)

Now survey target Collect yields a Survey Report listing the hotspot source line locations (in either Fortran or C++ source).  Clicking on those locations enables view of assembly (but not source) code.

0 Kudos
4 Replies
TimP
Honored Contributor III
768 Views

I got an email from Intel developers asking for more detail to be posted here.

I got the -g3 -gdwarf-2 settings from past practice.  Evidently, it works well enough that Advisor captures correctly the source line numbers and asm code for the hot loops.  It confirms loop body code alignments for those situations where the compiler emits a (conditional) alignment directive.

This can be reproduced by installing gcc-gfortran from https://cygwin.com/setup-x86_64.exe and probably by any gfortran one might choose.  The point is to have the Advisor paths set up then set up the library paths for gfortran (e.g. by running \cygwin\cygwin.bat) before starting up advisor gui.

As gnu libgomp doesn't implement OMP_PLACES on Windows, I set OMP_NUM_THREADS between the number of cores and the number of HT logical processors.  I disable HT on the older CPU which supports that.

Earlier combinations of Advisor and gfortran worked by copying the gfortran support .dll s to the folder in the cmd prompt window; this (less desirable method) no longer works, for whatever reason, and accounted for some of my delay.  It's good that libiomp5 now is taken care of automatically when running an Intel compiler build.

0 Kudos
Jackson_M_Intel
Employee
768 Views

Thanks for the updated information. If I'm understanding correctly, the main issue is that for gfortran, Advisor is not able to resolve Survey information the lines of Fortran code in your application, is that correct? We can get to assembly, but not Fortran source. I will try and replicate your environment and issue, if that is the case.

0 Kudos
Jackson_M_Intel
Employee
768 Views

Additionally, can you attach the file maind.F loopdfv.F forttime.f90 here? If you cannot, we can create a private message where you should be able to attach them.

0 Kudos
TimP
Honored Contributor III
768 Views

Here are today's files.  There was an error in s232, and some others are updated to optimize for both gfortran and ifort.
 

0 Kudos
Reply