Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

arrays declarations

Status
Not open for further replies.

karineklund

Programmer
Dec 8, 2005
2
SE
Hello!

I am desperate to get some help with this problem that I have spent weeks on now.
In my code I declare a number of quite large arrays. To be specific 9 double precision arrays of (12500,300). On many computers that I have tried this on, this compiles but does not run. More exactly: 5 declared arrays works fine, 6 or more compiles but does not run.

The declaration looks like this:

DOUBLE PRECISION TOTFL
DOUBLE PRECISION PPFL, FSPFL, SSPFL, RSPFL
DOUBLE PRECISION PEFL, FSEFL, SSEFL, RSEFL
C
C **** MY commons
COMMON/FLT/TOTFL(NVOX,ECH)
COMMON/FLP/PPFL(NVOX,ECH),FSPFL(NVOX,ECH),SSPFL(NVOX,ECH)
1 ,RSPFL(NVOX,ECH)
COMMON/FLE/PEFL(NVOX,ECH),FSEFL(NVOX,ECH),SSEFL(NVOX,ECH)
1 ,RSEFL(NVOX,ECH)

I don't even use the arrays for anything (I will, but for debugging I don't) so it is only declarations that I include or not that affects if the code runs or not. I use the g77 compiler on windowsXP, but I have also tried on a Linux machine with the same result. The most frustrating part is that when I run on a computer on a grid that I have access to, it works, with all arrays declared! I have also tried the g95 compiler with the same results. CAn someone please give me a hint to what is wrong!!!

With hope,
Karin
 
That comes up to 270Mb just for the arrays. Try increasing your swap space.
 
So it is a memory problem then? The reasom that it works at the grid is that there is more memory available? The solution is perhaps trying to avoid having so many arrays? Rather write straight to a file?
/Karin
 
I'm just guessing it is a memory problem.

It is the time versus space problem - if you have everything in memory it is faster but if your machine doesn't have enough swap space, the program doesn't even load. If you write stuff to disk it slower but you will arrive at your destination.

You could have a cache buffer solution where you keep part in memory and only use the disk when the part you're looking for isn't in memory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top