Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

passing large array to subroutines and speed-up

diedro
Beginner
124 Views

Dear all,

I have a question about code speed due to different strategy in passing array to subroutines.

Recently, I have rewritten an old code where only small arrays are passed to subroutines. In my new version, I usually pass all the array with modules.

Unfortunately, I have noticed that my new version of the code is very very much slower than the initial version. I am wondering if this is due to the new way in passing the arrays to subroutine or if the problem is related to something else.

Really, Really

Thanks

0 Kudos
2 Replies
Steve_Lionel
Black Belt Retired Employee
124 Views

Something else, probably. Obviously you changed more than just how arrays were passed in. You've now made them global module variables and taken them out of the argument list? In that case there is no "passing" at all.

The usual advice is to do performance analysis using a tool such as Intel Vtune Amplifier XE and see where the program is spending most of its time. In most cases it's not where you think.

diedro
Beginner
124 Views

Dear Steve,

I will check with the Intel Vtune Amplifier XE.

Thanks a lot for the suggestion.

Reply