CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   how to deal with the problem'stack overflow'? (http://www.cfd-online.com/Forums/main/3333-how-deal-problemstack-overflow.html)

Tom April 6, 2001 00:58

how to deal with the problem'stack overflow'?
 
because of too much variabes and need enough nodes to simulation the fluid,when I run my CFD code,the machine tell my 'stack overflow',the Fortran 5.0 is used,how to deal with this problem?

thanks

Frank April 6, 2001 08:52

Re: how to deal with the problem'stack overflow'?
 
I once heard of such a problem. Maybe it has something to do, if you pass all variables via the parameter list.

I think if one uses common blocks instead of passing the variables via the parameter list, it could cure the problem.

That is what I remember someone told me once, who encountered the same problem when running big jobs.

This is just a remark (I did not experience or try it by myself)

Frank

mouse April 6, 2001 11:17

Re: how to deal with the problem'stack overflow'?
 

kalyan April 6, 2001 12:52

Re: how to deal with the problem'stack overflow'?
 
You can use the limit command to see what the default maximum stacksize is. Try this.

Type "limit" on prompt. My machine produces something like this on the screen.

cputime unlimited

filesize unlimited

datasize unlimited

stacksize 65536 kbytes

coredumpsize unlimited

memoryuse 1048576 kbytes

descriptors 200

vmemoryuse unlimited

threads 1024

So the stacksize is limited to 65536 kbytes. You can increase it all the way upto the memoryuse (1048576 kbytes in this case). When you type

"limit stacksize 524288", the stacksize increases to 0.5MEGS. If you need more, set it to a higher number.

Adrin Gharakhani April 6, 2001 14:20

Re: how to deal with the problem'stack overflow'?
 
This of course assumes that you have a unix(based) operating system!

Adrin Gharakhani

John C. Chien April 6, 2001 14:44

Re: how to deal with the problem'stack overflow'?
 
(1). Type "stack overflow fortran" into a websearch engine, and you should get a lot of answers. (2). Here is one answer. Please learn how to do Internet Search on your own. (3). This is just one example. It might not be your problem. In general, when you run out of local memory space (local variables) you get overflow message.

Stack Overflow Messages Symptom: A message like "forrtl: severe: Program Exception - stack overflow" when trying to run the Numerical Recipes demonstration programs xsort, xselect, and others. Solution: This occurs in some versions of DIGITAL Visual Fortran, the successor compiler to Microsoft Fortran PowerStation. The solution is to add "/link /stack:8000000" AFTER everything else on the compiler command line (after all .obj files, not just options), or make the equivalent stack size change in the IDDE settings. You might not need this big a value, but we know that this one works.

--------------------------------------------------------------------------------

Jongtae Kim April 7, 2001 02:40

Re: how to deal with the problem'stack overflow'?
 
I think you use digital visual Fortran. Chien's writing is correct to increase stack size. Another way is just use editbin at DOS command like

dir> editbit /stack:1000000 test.exe

The stack size is in byte unit. If 1MB of stack is not enough, increase more until you can run your application. As you can imagine, test.exe is the name of excutable file.

peter liang April 12, 2001 09:02

Re: how to deal with the problem'stack overflow'?
 
I met this kind of question before, I used C in unix. I sloved this problem use linked-list stack. I am not sure about fortran. Sorry :>


All times are GMT -4. The time now is 20:34.