I'm updating old .f90 code to f2003 and in order to make thread-safe libraries. I've come across this old topic:
https://software.intel.com/en-us/forums/topic/270572
in listing a few guidelines for writing thread-safe code. One of the libraries I've updated uses very large arrays, which I've been able to get working when using the -heap_arrays compiler option. Otherwise I get a stack overflow error in the MAXVAL intrinsic function. But the above topic states to not use the -heap_arrays option for thread-safe code.
Is this true? I'm using Intel® Parallel Studio XE 2015 Update 4 Composer Edition for Fortran Windows* Integration for Microsoft Visual Studio* 2013, Version 15.0.0122.12
I know previous versions of IVF had memory leak problems with this option but have since been fixed.
Also, this particular library is being executed across multiple threads (2-8) 1000s of times and I do see a noticeable slow down when I get to the 1000+ run/thread. Is this due to the -heap arrays option for creating the library? or would this be attributable to a memory leak problem?