Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
12 Views

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

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
Highlighted
12 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
Highlighted
Beginner
12 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
Highlighted
12 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
Highlighted
Beginner
12 Views

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

0 Kudos
Highlighted
12 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