Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28517 Discussions

why dose the efficiency decrease when many allocatable arrays are declared in modules?


I wrote two different codes doing the same thing. In the older version, I only declared some variables but no arrays in modules. I used openmp to  parallelize it. In this case, the code works well and is successfully accelerated. However, the new version code cannot be accelerated. In this version, I declared some allocatable arrays, which are only assigned before I run any parallelized codes, in modules.  In the new version, the performance is lower then the single thread case after parallelized. Should I avoid to use allocatable arrays in module? Or, there are some thing should be set such as environment variables.

0 Kudos
1 Reply
Honored Contributor III

Something else is going on. Please use VTune on both versions of the code and look for the overhead (and lack of threading).

Jim Dempsey

0 Kudos