* Compiler options to limit swap space
@ 1999-05-18 4:00 sponk
1999-05-18 4:00 ` sponk
1999-05-18 4:00 ` Serguei Patchkovskii
0 siblings, 2 replies; 7+ messages in thread
From: sponk @ 1999-05-18 4:00 UTC (permalink / raw)
I have some FORTRAN code that seems to be
particularly greedy about reserving my swap space
.. but then doesn't use the reserved space hardly
at all. This means that I can only run a couple
processes at a time, which is extrememly annoying.
For example, currently with 2 calculations
running, swapon -s gives:
Swap partition /dev/foo (default swap):
Allocated space: 48801 pages (384 MB)
In-use space: 8372 pages ( 17%)
Free space: 40429 pages ( 82%)
Total swap allocation:
Allocated space: 48801 pages (384 MB)
Reserved space: 39402 pages ( 80%)
In-use space: 8372 pages ( 17%)
Available space: 9398 pages ( 19%)
It seems that there must be something about the
compiler options I am using that makes my
executables suck up so much swap space ... I have
read through the man pages and I can't find any
mention of this issue. I would appreciate any
help you can over on this. Thanks,
Dave Moore
Chemistry Dept.
UNC Chapel Hill
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Compiler options to limit swap space
1999-05-18 4:00 Compiler options to limit swap space sponk
@ 1999-05-18 4:00 ` sponk
1999-05-18 4:00 ` Serguei Patchkovskii
1 sibling, 0 replies; 7+ messages in thread
From: sponk @ 1999-05-18 4:00 UTC (permalink / raw)
I apologize for the duplicate posts of this message ... I have requested
that they be removed from the list. They occured because it was my
first time using Dejanews to post messages. It will certainly NOT
happen again.
Dave Moore
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Compiler options to limit swap space
1999-05-18 4:00 Compiler options to limit swap space sponk
1999-05-18 4:00 ` sponk
@ 1999-05-18 4:00 ` Serguei Patchkovskii
1999-05-20 4:00 ` dtmoore
1 sibling, 1 reply; 7+ messages in thread
From: Serguei Patchkovskii @ 1999-05-18 4:00 UTC (permalink / raw)
sponk@my-dejanews.com wrote:
: I have some FORTRAN code that seems to be
: particularly greedy about reserving my swap space
: .. but then doesn't use the reserved space hardly
: at all. This means that I can only run a couple
: processes at a time, which is extrememly annoying.
Basically, you have a choice of two options:
1. Switch to the lazy swap allocation mode. Simply remove
/sbin/swapdefault, and reboot. The danger here is that
if you run out of swap in the lazy mode, you can count
on a spectacular system crash.
2. Go over your Fortran code, and replace large statically
dimentioned arrays with dynamically allocated arrays
using as much space as needed. Depending on the internal
sofistication of the program you use, this may be either
extremely simple or a royal pain in the neck. YMMV.
2a. Sorry, there is no magic compiler switch which can do
this for you. May be if Compaq implements the rumoured
DWIM instruction...
/Serge.P
--
home page: http://www.cobalt.chem.ucalgary.ca/ps/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Compiler options to limit swap space
1999-05-18 4:00 ` Serguei Patchkovskii
@ 1999-05-20 4:00 ` dtmoore
1999-05-20 4:00 ` Serguei Patchkovskii
1999-05-21 4:00 ` Jeffrey J. Potoff
0 siblings, 2 replies; 7+ messages in thread
From: dtmoore @ 1999-05-20 4:00 UTC (permalink / raw)
Thanks for the information ... I suspected that might be the case with
the static arrays. Unfortunately I am dealing with some very complex
third party code so it will be VERY difficult to make global
modifications ... I may have to resort to that however because the
sys-op on my machine is leery of going to lazy-mode ... he would be the
one to have to clean up after a big crash.
I was thinking that maybe this problem can be partially circumvented by
dynamically linking some of the subroutines that contatin large, local
static arrays. That way the system won't see the entire memory image
when the process starts ... of course, I suppose this could lead to
run-time crashes if the loader can't grab the required swap space when
it follows the dynamic link. I would appreciate any comments or
suggestions about this idea. Thanks,
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Compiler options to limit swap space
1999-05-20 4:00 ` dtmoore
@ 1999-05-20 4:00 ` Serguei Patchkovskii
1999-05-21 4:00 ` Jeffrey J. Potoff
1 sibling, 0 replies; 7+ messages in thread
From: Serguei Patchkovskii @ 1999-05-20 4:00 UTC (permalink / raw)
dtmoore (sponk@my-dejanews.com) wrote:
: I was thinking that maybe this problem can be partially circumvented by
: dynamically linking some of the subroutines that contatin large, local
: static arrays. That way the system won't see the entire memory image
: when the process starts ... of course, I suppose this could lead to
: run-time crashes if the loader can't grab the required swap space when
: it follows the dynamic link. I would appreciate any comments or
: suggestions about this idea. Thanks,
*IF* (and this a big if indeed) your application is written rigorously
to the letter of the Fortran Standard, and does not expect arrays which
are not SAVE'd to be initialized to any particlular value or survive
after leaving the scope where they are defined, you may getg some relief
by using the -automatic compiler option. This will place data local to
subroutines/functions onto stack, allowing the space to reused to some
extent. This will not work with the COMMON blocks, however.
You probably can get some relief by splitting your apllication into
several dynamic libraries and requesting delayed loading. However,
unless you are prepared to manage these libraries by hand (which
probably would be prohibitively messy unless you have a well-partitioned
application with a few well-defined interfaces between the partitions)
with explicit calls to dlopen/dlclose/dlsym you will not be able to
re-use memory for separate libraries.
Regards,
/Serge.P
--
home page: http://www.cobalt.chem.ucalgary.ca/ps/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Compiler options to limit swap space
1999-05-20 4:00 ` dtmoore
1999-05-20 4:00 ` Serguei Patchkovskii
@ 1999-05-21 4:00 ` Jeffrey J. Potoff
1 sibling, 0 replies; 7+ messages in thread
From: Jeffrey J. Potoff @ 1999-05-21 4:00 UTC (permalink / raw)
dtmoore wrote:
>
> Thanks for the information ... I suspected that might be the case with
> the static arrays. Unfortunately I am dealing with some very complex
> third party code so it will be VERY difficult to make global
> modifications ... I may have to resort to that however because the
> sys-op on my machine is leery of going to lazy-mode ... he would be the
> one to have to clean up after a big crash.
>
> I was thinking that maybe this problem can be partially circumvented by
> dynamically linking some of the subroutines that contatin large, local
> static arrays. That way the system won't see the entire memory image
> when the process starts ... of course, I suppose this could lead to
> run-time crashes if the loader can't grab the required swap space when
> it follows the dynamic link. I would appreciate any comments or
> suggestions about this idea. Thanks,
In that case, I would suggest that the easiest solution is to buy another
4.5-9gb SCSI disk and set up additional swap.
Jeff
^ permalink raw reply [flat|nested] 7+ messages in thread
* Compiler options to limit swap space
@ 1999-05-18 4:00 sponk
0 siblings, 0 replies; 7+ messages in thread
From: sponk @ 1999-05-18 4:00 UTC (permalink / raw)
I have some FORTRAN code that seems to be
particularly greedy about reserving my swap space
.. but then doesn't use the reserved space hardly
at all. This means that I can only run a couple
processes at a time, which is extrememly annoying.
For example, currently with 2 calculations
running, swapon -s gives:
Swap partition /dev/foo (default swap):
Allocated space: 48801 pages (384 MB)
In-use space: 8372 pages ( 17%)
Free space: 40429 pages ( 82%)
Total swap allocation:
Allocated space: 48801 pages (384 MB)
Reserved space: 39402 pages ( 80%)
In-use space: 8372 pages ( 17%)
Available space: 9398 pages ( 19%)
It seems that there must be something about the
compiler options I am using that makes my
executables suck up so much swap space ... I have
read through the man pages and I can't find any
mention of this issue. I would appreciate any
help you can over on this. Thanks,
Dave Moore
Chemistry Dept.
UNC Chapel Hill
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1999-05-21 4:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-05-18 4:00 Compiler options to limit swap space sponk
1999-05-18 4:00 ` sponk
1999-05-18 4:00 ` Serguei Patchkovskii
1999-05-20 4:00 ` dtmoore
1999-05-20 4:00 ` Serguei Patchkovskii
1999-05-21 4:00 ` Jeffrey J. Potoff
-- strict thread matches above, loose matches on Subject: below --
1999-05-18 4:00 sponk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox