- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Before I go too far down this path, I would like to assure myself there isn't a better way. I am using intel Fortran 17.1 on windows 7 and RH6 Linux. I find significant benefit in times using internal procedures. I need to use the same routines in multiple routines in multiple source files. I have put the low level routines in a source file which I then INCLUDE after the CONTAINS statement for all the high level routines where I want these low level routines to be available as internal routines. I did try the inline attribute. It seems the low level routine has to be in the same file and cannot be a module procedure in another file. I think that I am getting a better speedup with internal routines than inlining (if it is happening). This approach seems to work. If there is a cleaner way, I'd love to hear about it. thanks scott
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suggest trying -ipo (/Qipo on Windows) - this is the whole-program interprocedural optimization feature. Add this option to every ifort command, and you should be able to use a module procedure and get benefits.
Using INCLUDE works, but causes code bloat and may miss some cross-source optimization opportunities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's not necessary that those libraries be compiled with -ipo unless you would like them to be included in the optimization. The unresolved module procedure references are more a concern for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It sounds to me that having your common routines in modules would be more effecient but maybe I am misunderstanding the original post. Using include to "cut and paste" the same code in many places does indeed seem like code bloat as you are compiling the same code many times instead of once.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page