Dear community. We got the license for ParallelStudio XE Composer Fortran for Windows, but it turned out that GNU FORTRAN is up to 4 times faster than Visual Fortran Compiler 184.108.40.206. We are using the same code but in Gfortran I only use -O3. I know that there has to be something that I am overlooking, because It has been demonstrated that Intel compilers are faster and more efficient than GNU compilers.
I have read the manuals but I have not found anything yet. I also found something similar on the web another user reporting the same issue. He needed to use different flags when compiling. However, I am user Visual Studio and all these compiling options are difficult to find.
I will greatly appreciate your contribution in this problem. !!!
It is not clear whether you are referring to the compilation taking 3x longer or the execution of your program.
If it is the program's execution that's longer then could you perhaps be building/executing the Debug configuration and not the Release configuration?
The compiler options are visible in a couple of places under the Visual Studio IDE.
- Project > Properties > Fortran > Command Line (the compiler options appear in the All Options pane)
- After you complete the build, View > Output and then use <CTRL>-left-click on the "Build Log Written to" link. The build log contains the complete compilation line.
Thanks Kevin, I was referring to the execution time. I read all the compiler options and in fact I do not know which of them are messing with the execution time. Is it is possible to erase all those options? and build the solution without options.?
Are you building a Debug configuration (no optimization, lots of run-time checks) or a Release configuration (optimization, no checks)? Or are you building from the command line, and if so, what options are you using?
My guess is that you are building a Debug configuration in Visual Studio. Change the Debug to Release, rebuild, and see what you get. There are options you can select that make things even faster.
I'm not aware of a method to reset all the compiler option settings for a particular build configuration. A method by which to reset the compiler options (for both the Debug and Release configurations) is to delete and re-create a particular platform configuration (i.e. Win32 or x64).
The Debug and the Release build configurations use certain and different default settings and unless you change those they would represent what I guess you are referring to as "without options".
Thank you very much. !!! In fact that was the problem I was building the solution using a Debug configuration. I tried to get the manual for VS but the information I found was to broad and dense. You also mentioned that there are options that I can select that make things even faster. Could you please provide me with the reference for those options to download and take a look at those???
Thank you very much !
The two most useful options are:
Fortran > Optimization > Optimization - set to "Maximize Speed plus Higher Level Optimizations (/O3)"
Fortran > Code Generation > Intel Processor-Specific Optimizations - set to "Same as host processor (/QxHost)". This is the last item in the list and will work on non-Intel processors (unlike the other choices for this property).
I recommend against going further unless you are still dissatisfied with performance and have run the program through a performance analyzer such as Intel VTune Amplifier XE.
Thank you very much Steve for the information. I greatly appreciate your help. My processor is a Intel Xeon (R) CPU E5-2637 v3 @ 3.50 GHz 3.50 GHz (2 processors).
Is there any relation between this type of processor and the options "Add Processors-Optimized Code Path".
I really want to know the purpose of all these options, but the manual does not explain that in details. ( at leat the one I found on the web page).
I found in the tutorial that Interprocedural Optimization = Multi-file (/Qipo) also improves the performance. As well as, setting Floating Point Model to fast. Like i said, I am really interested on learning about all these things. Can you provide me with technical information to learn about all these features? Thanks before hand
If you use the /QxHost option, the compiler will automatically pick the best /Qx setting for your processor. Don't use this, though, if you will be running the program on a different computer. If you'll be doing that, see this article for suggestions.
I don't suggest playing with /fp-model for now.
The "Add Processor-Optimized Code Path" tells the compiler to generate one or two optimized code paths as well as a "generic" path, where you select the microarchitectures for the optimized path. This is NOT something you should be looking at for now - it is most useful for applications that will be run on different processors where you don't want to give up optimizations for newer ones. Just leave this alone for now - it sometimes can make things worse.
The product documentation is pretty good. You can start here.
Thank you very much "Dr. Fortran", well disserved the nickname. I do appreciate the material you suggested me to read. Actually, I had read the product documentation you mentioned above, but I got lost catching up with all these features and options. I will take a second look to dive into the details.