* Fortran: Large static arrays = unal trap + core
@ 1999-03-09 16:10 Matt Nelson
1999-03-10 11:53 ` Harvey J. Stein
0 siblings, 1 reply; 6+ messages in thread
From: Matt Nelson @ 1999-03-09 16:10 UTC (permalink / raw)
To: axp-list
everybody around here uses Fortran (egcs/g77). i have some users that
need very large arrays, i.e., several hundreds of megabytes. here's how
they set it up (don't ask... there is an evolutionary reason for this
convoluted way to do it...):
- declare some dummy arrays: real dummy1(60000000) (three of em)
- save an I*8 pointer to the array: pointer=%loc(dummy1(1))
- pass the pointer to subroutines that do the meat of the work via
%val(pointer)
here's the problem. sometimes the code works fine, and other times it
core dumps immediately when executed, triggering an unaligned trap message
in /var/log/messages.
system: LX164, 512M + 512M swap, Red Hat 5.2 + 2.2.1 kernel
does anybody have any idea what's going on?
-matt
-----------------------------------------------------------------------------
Matthew Nelson
Dynamics Technology, Inc.
21311 Hawthorne Blvd., Suite 300, Torrance, CA 90503-5610
Voice: (310) 543-5433 FAX: (310) 543-2117 Email: mnelson@dynatec.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fortran: Large static arrays = unal trap + core
1999-03-09 16:10 Fortran: Large static arrays = unal trap + core Matt Nelson
@ 1999-03-10 11:53 ` Harvey J. Stein
1999-03-10 15:05 ` Matt Nelson
0 siblings, 1 reply; 6+ messages in thread
From: Harvey J. Stein @ 1999-03-10 11:53 UTC (permalink / raw)
To: axp-list; +Cc: hjstein
Matt Nelson <mnelson@dynatec.com> writes:
> everybody around here uses Fortran (egcs/g77). i have some users that
> need very large arrays, i.e., several hundreds of megabytes. here's how
> they set it up (don't ask... there is an evolutionary reason for this
> convoluted way to do it...):
>
> - declare some dummy arrays: real dummy1(60000000) (three of em)
> - save an I*8 pointer to the array: pointer=%loc(dummy1(1))
> - pass the pointer to subroutines that do the meat of the work via
> %val(pointer)
>
> here's the problem. sometimes the code works fine, and other times it
> core dumps immediately when executed, triggering an unaligned trap message
> in /var/log/messages.
>
> system: LX164, 512M + 512M swap, Red Hat 5.2 + 2.2.1 kernel
>
> does anybody have any idea what's going on?
The unaligned traps are a little weird, but can it be that the other
processes are sucking up enough memory that the program is running out
of memory? I've found core dumping immediately to often indicate
using too much memory.
--
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fortran: Large static arrays = unal trap + core
1999-03-10 11:53 ` Harvey J. Stein
@ 1999-03-10 15:05 ` Matt Nelson
1999-03-10 15:14 ` Greg Lindahl
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Matt Nelson @ 1999-03-10 15:05 UTC (permalink / raw)
To: axp-list; +Cc: hjstein
On 10 Mar 1999, Harvey J. Stein wrote:
> Matt Nelson <mnelson@dynatec.com> writes:
> > everybody around here uses Fortran (egcs/g77). i have some users that
> > need very large arrays, i.e., several hundreds of megabytes. here's how
> > they set it up (don't ask... there is an evolutionary reason for this
> > convoluted way to do it...):
> >
> > - declare some dummy arrays: real dummy1(60000000) (three of em)
> > - save an I*8 pointer to the array: pointer=%loc(dummy1(1))
> > - pass the pointer to subroutines that do the meat of the work via
> > %val(pointer)
> >
> > here's the problem. sometimes the code works fine, and other times it
> > core dumps immediately when executed, triggering an unaligned trap message
> > in /var/log/messages.
> >
> > system: LX164, 512M + 512M swap, Red Hat 5.2 + 2.2.1 kernel
> >
> > does anybody have any idea what's going on?
>
> The unaligned traps are a little weird, but can it be that the other
> processes are sucking up enough memory that the program is running out
> of memory? I've found core dumping immediately to often indicate
> using too much memory.
well, the thing is asking for something like 750M of memory on a 1G
system (physical+swap). it is the only active user job when it core
dumps.
could the memory get too fragmented to allow for declaration of such a
large array? (i don't know the mm internals, so i'm clueless on this
point).
-matt
-----------------------------------------------------------------------------
Matthew Nelson
Dynamics Technology, Inc.
21311 Hawthorne Blvd., Suite 300, Torrance, CA 90503-5610
Voice: (310) 543-5433 FAX: (310) 543-2117 Email: mnelson@dynatec.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fortran: Large static arrays = unal trap + core
1999-03-10 15:05 ` Matt Nelson
@ 1999-03-10 15:14 ` Greg Lindahl
1999-03-10 15:44 ` Phillip Ezolt
1999-03-10 17:29 ` Wes Bauske
2 siblings, 0 replies; 6+ messages in thread
From: Greg Lindahl @ 1999-03-10 15:14 UTC (permalink / raw)
To: axp-list
> > > - declare some dummy arrays: real dummy1(60000000) (three of em)
> > > - save an I*8 pointer to the array: pointer=%loc(dummy1(1))
> > > - pass the pointer to subroutines that do the meat of the work via
> > > %val(pointer)
You should print a debugging statement right after you declare those
arrays (i.e. at program start, if they are in the main program); that
will tell you if you ran out of memory and immediately dumped core.
Then you should print the I*8 value of pointer. You can see if it is
misaligned or not.
There may also be a weirdness in the way %val() interacts with
subroutine arguments on Alpha g77. Hm.
> could the memory get too fragmented to allow for declaration of such a
> large array?
I don't think Linux has this "feature".
-- g
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fortran: Large static arrays = unal trap + core
1999-03-10 15:05 ` Matt Nelson
1999-03-10 15:14 ` Greg Lindahl
@ 1999-03-10 15:44 ` Phillip Ezolt
1999-03-10 17:29 ` Wes Bauske
2 siblings, 0 replies; 6+ messages in thread
From: Phillip Ezolt @ 1999-03-10 15:44 UTC (permalink / raw)
To: axp-list
On Wed, 10 Mar 1999, Matt Nelson wrote:
> well, the thing is asking for something like 750M of memory on a 1G
> system (physical+swap). it is the only active user job when it core
> dumps.
>
> could the memory get too fragmented to allow for declaration of such a
> large array? (i don't know the mm internals, so i'm clueless on this
> point).
>
> -matt
I don't think that that is the problem. When you ask for 750 MB of memory,
you are asking for 750MB of contiguous VIRTUAL memory, not physical memory.
The virtual memory can have pages from any position in physical memory. They
need not be contiguous. It might be some kind of stack limitation.
However, the fact that it works sometimes and not others is very suspicious.
--Phil
Digital/Compaq: High Performance Servers/Benchmark Performance Engineering
Phillip.Ezolt@compaq.com ezolt@perf.zko.dec.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fortran: Large static arrays = unal trap + core
1999-03-10 15:05 ` Matt Nelson
1999-03-10 15:14 ` Greg Lindahl
1999-03-10 15:44 ` Phillip Ezolt
@ 1999-03-10 17:29 ` Wes Bauske
2 siblings, 0 replies; 6+ messages in thread
From: Wes Bauske @ 1999-03-10 17:29 UTC (permalink / raw)
To: axp-list
Matt Nelson wrote:
>
> On 10 Mar 1999, Harvey J. Stein wrote:
> > Matt Nelson <mnelson@dynatec.com> writes:
> > > everybody around here uses Fortran (egcs/g77). i have some users that
> > > need very large arrays, i.e., several hundreds of megabytes. here's how
> > > they set it up (don't ask... there is an evolutionary reason for this
> > > convoluted way to do it...):
> > >
> > > - declare some dummy arrays: real dummy1(60000000) (three of em)
> > > - save an I*8 pointer to the array: pointer=%loc(dummy1(1))
> > > - pass the pointer to subroutines that do the meat of the work via
> > > %val(pointer)
> > >
> > > here's the problem. sometimes the code works fine, and other times it
> > > core dumps immediately when executed, triggering an unaligned trap message
> > > in /var/log/messages.
> > >
> > > system: LX164, 512M + 512M swap, Red Hat 5.2 + 2.2.1 kernel
> > >
> > > does anybody have any idea what's going on?
> >
> > The unaligned traps are a little weird, but can it be that the other
> > processes are sucking up enough memory that the program is running out
> > of memory? I've found core dumping immediately to often indicate
> > using too much memory.
>
> well, the thing is asking for something like 750M of memory on a 1G
> system (physical+swap). it is the only active user job when it core
> dumps.
>
How about writing a 20 line C program as your main and
convert your FORTRAN main to a subroutine with those dummy
arrays as args. That way you make the allocate dynamic.
Only issue is you have to add a '_' to the end of the FORTRAN
name when you call it from C.
This gives you a bit of room to look at what's really failing.
Wes
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1999-03-10 17:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-09 16:10 Fortran: Large static arrays = unal trap + core Matt Nelson
1999-03-10 11:53 ` Harvey J. Stein
1999-03-10 15:05 ` Matt Nelson
1999-03-10 15:14 ` Greg Lindahl
1999-03-10 15:44 ` Phillip Ezolt
1999-03-10 17:29 ` Wes Bauske
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox