Are complex*16 variables static by default?
Janne Blomqvist
blomqvist.janne@gmail.com
Sat Jan 28 09:12:00 GMT 2017
On Sat, Jan 28, 2017 at 1:19 AM, Jerry DeLisle <jvdelisle@charter.net> wrote:
> On 01/27/2017 02:46 PM, Steffen Boerm wrote:
>>
>>
>> Hello,
>>
>> how are complex*16 variables handled by gfortran if "-frecursive" is
>> not specified?
AFAIK they are handled just like other primitive types.
>> Is it possible that they are stored as static variables?
Unless they have the SAVE attribute, no. There is the
-fmax-stack-var-size=n option that specifies the threshold where local
arrays are allocated in static memory instead of on the stack, but
the default limit is 32768 bytes which is of course far larger than a
complex*16 variable. Unless you're talking about arrays rather than
scalar values?
See also -fstack-arrays.
>> I am using LAPACK's zlarfg and zlarf functions within a C program, and
>> my code works just fine as long as OpenMP is disabled. When I enable
>> multi-threading, the code behaves erratically, and I am wondering
>> whether this might be due to the complex*16 constants "one" and "zero"
>> in zlarf or the complex*16 variable "temp" in zgerc.
>
>
> I am not the best person to answer this.
>
> I am doubtful LAPACK is thread safe. I think you need to force single thread
> through execution of those functions.
Since LAPACK 3.3, all routines are thread safe:
http://www.netlib.org/lapack/lapack-3.3.0.html
--
Janne Blomqvist
More information about the Fortran
mailing list