Re: GFortran - OpenMP problem with Windows XP memory
- From: "Anony" <no-email@xxxxxxxxxxxx>
- Date: Thu, 15 May 2008 00:11:45 GMT
"Cirilo S. Bresolin" <cirilo.bresolin@xxxxxxxxx> wrote in message
news:95999025-2b18-4172-8783-b33e60e92a2e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi!
I spend some time today studying the problem, but I didn't understand
if the problem is with gfortran or OpenMP or neither.
As suggested by Anony, using:
<code> double precision, save :: a(n,n), b(n,n)
c:\gfortran file.f95 -fopenmp</code>
worked well up to n=11169.
I assume you have 32-bit gfortran (because 64-bit gfortran for windows works
and also supports openMP, but has optimization problems. Possibly, not so
many people use 64-bit gfortran for windows presently). When n=11169, the
memory space for a(n,n) & b(n,n), double precision, requires about 2GB. That
almost reaches the limit of 32-bit memory address. The 32-bit memory address
put a limit here. For n --> bigger, you need 64-bit OS and 64-bit compiler.
....................................
that, as -fmax-stack-var-size, overwrites the -frecursive flag imposed
by -fopenmp flag.
A little confuse here. -fmax-stack-var-size does not overwrite -frecursive,
but set a stack size.
and Gfortran.info, as previusly previusly by Steven G. Kargl
<cite>`-fopenmp' implies `-frecursive', i.e., all local arrays will
be
allocated on the stack. When porting existing code to OpenMP, this
may lead to surprising results, especially to segmentation faults
if the stacksize is limited. </cite>
It may be better for you to pay attention on which variables are private and
which variables are shared. OpenMP manual focus on "private" and "shared"
variables. It is really unnecessary for you to pay attention which "local
variable" is on the stack. What you need to deal with is "private" and
"shared" veriables, not stack.
How to allocate a memory space for a variable is compiler's job. Compiler
should do that for you. In my personal opinion, gfortran fails to properly
allocate memory for variables. You can play the magic word "save" or set a
sufficient stack size, which is totally up to you.
.
- Follow-Ups:
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Tobias Burnus
- Re: GFortran - OpenMP problem with Windows XP memory
- References:
- GFortran - OpenMP problem with Windows XP memory
- From: Cirilo S. Bresolin
- Re: GFortran - OpenMP problem with Windows XP memory
- From: glen herrmannsfeldt
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Anony
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Steven G. Kargl
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Anony
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Steven G. Kargl
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Anony
- Re: GFortran - OpenMP problem with Windows XP memory
- From: Cirilo S. Bresolin
- GFortran - OpenMP problem with Windows XP memory
- Prev by Date: Re: GFortran - OpenMP problem with Windows XP memory
- Next by Date: Re: Sorting arrays
- Previous by thread: Re: GFortran - OpenMP problem with Windows XP memory
- Next by thread: Re: GFortran - OpenMP problem with Windows XP memory
- Index(es):
Relevant Pages
|
|