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

will -heap-arrays flag be ignored if -openmp is used?

Qiang_X_
Beginner
349 Views

Will -heap-arrays flag be ignored if -openmp is used for compilation?

BTW, will -heap-array cause any issue with thread-safety?

 

Thanks, 

0 Kudos
5 Replies
Steven_L_Intel1
Employee
349 Views

No it won't be ignored. It should not cause thread safety issues. The pointer to the storage is per-thread and threads don't share the same heap-allocated temporary. (If there is a conflict, that's a bug we want to know about.)

0 Kudos
Qiang_X_
Beginner
349 Views

Hi Steve,

Thanks for your reply. But here is what I found from this doc.  

 

-openmp Interaction with –heap-arrays

• -openmp will cause the compiler use slightly different behavior for –heap-arrays

• Procedure local data with –heap-arrays and –openmp are STACK allocated (therefore, thread-safe) – must explicitly override with SAVE attribute to get on heap • Automatic arrays: descriptor allocated on stack, data allocated in heap (thus, also thread-safe).

• OpenMP puts a heavy load on stack, threadprivate variables need stack allocation

• Use stack-increasing methods – you will need much more stack than an non-OpenMP application 

So for automatic and temporary data, what is the actual behavior for Intel comipler  "intel/compiler-14.0.1/bin/ifort" 

Is it possible to have a test program to validate where the automatic and temporary data is allocated?

I'd like to test for -heap-array with and without -openmp?

Thanks,

Qiang 

0 Kudos
Steven_L_Intel1
Employee
349 Views

I don't know what the 14.0 compiler's behavior is and don't recommend using that unsupported version. Ideally you'd want to avoid anything that creates temporary array copies.

That presentation you found is a decade old.

0 Kudos
Qiang_X_
Beginner
349 Views

So the 14.0 compiler is not supported by Intel any more?   

0 Kudos
Steven_L_Intel1
Employee
349 Views

No. The current compiler is 16.0. We will accept bug reports on 15.0 but it is unlikely that there will be any more 15.0 updates. 14.0 is unsupported.

0 Kudos
Reply