gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: rhoronjeff@comcast.net December 03, 2022, 12:41:32 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Maximum Array Size
gfx
gfxgfx
 

Author Topic: Maximum Array Size  (Read 10933 times)

Gene

  • Jr. Member
  • **
  • Posts: 56
Maximum Array Size
« on: February 22, 2011, 09:18:10 PM »
What is maximum size for a 'single dimensioned array' (such as TEST(???))  (F77)

Also what is the largest INTEGER*4 value allowed??  (F77)

I'm having issues in WINDOWS XP working with an array of about 90,000 values in size; wondering if I should make it a multi-dimensioned array (such as TEST(???,???,???))

I'm wondering if its an array issue or an issue with too large of an integer for the array counter.

What is the maximum multi-dimensional array size permitted; or is this limited only by installed memory??
 
Thanks for information provided.

Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Maximum Array Size
« Reply #1 on: February 22, 2011, 10:42:26 PM »
Gene, when an array is too large for your accessible RAM (4GB max. - System requirements, etc., under XP), then Windows pages it to disk, which is slow. I now restrict myself to 1GB in memory. If I have to use a bigger array, then I set it up as a disk file and use my own (intelligent) disk buffering. This is much faster than Windows (not-so-intelligent) paging.

Gene

  • Jr. Member
  • **
  • Posts: 56
Re: Maximum Array Size
« Reply #2 on: February 23, 2011, 09:26:22 AM »
Thanks Mike.  This piece of code of interest is sphagetti code which has evolved since about 1985; and ported to DOS PC from mini-computer in the 1980's; and then to Windows; using various compilers over the ages.

I looked closely through it again, and found that I've already done (and forgotten about) what you suggested- repetitively reading and writing data to disk rather than storing and working with the large arrays.

I think the issue is due to 'large integer counters' which I'll have to program around.  Its do-able; just have to search it out.

Gene

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: Maximum Array Size
« Reply #3 on: February 23, 2011, 09:59:44 AM »
An INTEGER*4 array with 90,000 elements is relatively small; 360,000 bytes of memory. It alone would not cause any problems for a program. However, if you have many of them, you may exceed the Windows default stack size of 1 MB. There are two things you can do:

1. Increase the stack size with the -stack:n option where n is the required stack size.

2. Use the -s option which moves local storage, including arrays, from the stack to the heap.

If you can specify the version of the compiler you are using and nature of the problem you are encountering, I can give more specific information.

sturlamolden

  • Newbie
  • *
  • Posts: 10
Re: Maximum Array Size
« Reply #4 on: February 23, 2011, 04:49:47 PM »
Gene, when an array is too large for your accessible RAM (4GB max. - System requirements, etc., under XP), then Windows pages it to disk, which is slow. I now restrict myself to 1GB in memory. If I have to use a bigger array, then I set it up as a disk file and use my own (intelligent) disk buffering. This is much faster than Windows (not-so-intelligent) paging.

For Win32 it is actually only 2 GB (upper half of the address space is reserved for the OS).

Sturla

sturlamolden

  • Newbie
  • *
  • Posts: 10
Re: Maximum Array Size
« Reply #5 on: February 23, 2011, 04:53:17 PM »
What is maximum size for a 'single dimensioned array' (such as TEST(???))  (F77)

2**31 bytes for 32-bit, a lot more for 64-bit...

Also what is the largest INTEGER*4 value allowed??  (F77)

2**31 - 1






Gene

  • Jr. Member
  • **
  • Posts: 56
Re: Maximum Array Size
« Reply #6 on: February 24, 2011, 12:36:55 AM »
Thanks for all the advice and comments.

I have ABSOFT Version 7 for Windows.  Several arrays of 90,000 elements each are in named COMMON blocks; using INCLUDE statements contained in each subroutine.

The program works OK for up to about 60000 input data values.  Much more than that causes the program to stop with a Windows error pop-up appearing and saying that Windows has to stop the program.

I've tried redoing the code to avoid some counters getting above 60000 in value.   

I've tried changing Stack and Heap values in the TOOLS-OPTIONS settings.  No luck.


forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: Maximum Array Size
« Reply #7 on: February 24, 2011, 06:02:23 AM »
Variables in COMMON blocks are already allocated in the heap; they are not allocated on the stack. Unfortunately, Pro Fortran V7 is over 10 years old. It may be time to look at upgrading to a newer version that can take advantage of current acrhitectures.

Gene

  • Jr. Member
  • **
  • Posts: 56
Re: Maximum Array Size
« Reply #8 on: February 24, 2011, 09:48:47 AM »
Reckon using the ten year old software IS kind of like taking the Model T out for a spin on I-10; and expecting to keep up with traffic......

Thanks again for all the thoughts and advice.

Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Maximum Array Size
« Reply #9 on: February 24, 2011, 09:56:33 PM »
Gene, how about moving big arrays out of COMMON and allocating memory for them with malloc? Then access them with pointer variables. Keep the values of the pointers in COMMON.  This is how my 1GB arrays are handled.

Gene

  • Jr. Member
  • **
  • Posts: 56
Re: Maximum Array Size
« Reply #10 on: February 26, 2011, 10:36:18 AM »
Interesting issue.  I can process 61030 pieces of data OK; but on 61031 the program chokes.

I then get the standard MicroSoft pop-up; which says that the program has been stopped on an error; and it offers to report the problem to Microsoft.  I've looked through the log which has been generated and its all cryptic to me.

This happens on two different machines; each having different processors and memory installed; each running WIN-XP with SP3 installed.


Gene

  • Jr. Member
  • **
  • Posts: 56
Re: Maximum Array Size
« Reply #11 on: March 05, 2011, 10:37:56 AM »
Question to Mike- what Version of ABSOFT are you using with your large arrays and malloc??

I am using version 7; which is as previously stated over ten years old....

I think I understand the basics of Pointers; but have never actually worked with them.

Just curious.  Thanks.

Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Maximum Array Size
« Reply #12 on: March 06, 2011, 07:38:20 PM »
Gene, though I now use the current Absoft version, those arrays were set up in Absoft 6. The memory allocation code has not changed (except as forced by compiler differences). My main reason for upgrading from Absoft 6 was the INTEGER*8 variables. I found myself coding my own INTEGER*8 routines in Absoft 6 and then decided not to reinvent the wheel.

Under Windows, the Absoft MALLOC function calls the Windows LocalAlloc function: http://msdn.microsoft.com/en-us/library/aa366723%28v=vs.85%29.aspx

Gene

  • Jr. Member
  • **
  • Posts: 56
Re: Maximum Array Size
« Reply #13 on: March 06, 2011, 07:50:20 PM »
When this program stops at the 61,031  piece of data; I get the standard MicroSoft "pop-up" which says basically the program is being stopped; and would I like to report the problem to MicroSoft.

I also get a "report" to look at if desired but its totally cryptic to me.

No specific "error messages" are ever given; as to what exactly caused the machine to terminate the program.

Is there a way to determine exactly where the issue is and what is causing it???  I get no errors from the code's execution itself.  I don't think any array's dimension is being exceeded.  I first thought it to be related to arrays or to a large Integer counter; but must be some over-flow situation of some sort.

Is there an ABSOFT compile/link option which may help de-bug??

The same result happens on two different machines; each having XP but different processors and memory installed.


Thanks

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
Re: Maximum Array Size
« Reply #14 on: March 07, 2011, 08:27:01 AM »
Have you tried using the debugger to determine where in your code the fault is occurring? The V7.0 debugger should be robust enough to at least place you at the point of failure in your code when the fault occurs.

Absoft User Forum  |  Support  |  General  |  Maximum Array Size
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!