CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Fortran (https://www.cfd-online.com/Forums/main/7627-fortran.html)

chinthakindi June 3, 2004 08:40

Fortran
 
Hello friends, I am getting one problem with fortran. i,e In my simulation for the jet, there r total 4.2 million control volumes, my RAM is 1.5 GB, i tryed to run the same code with another computer of 2GB RAM, in this case also i could able to run only 4.2 million control volumes, if i increase the the no of control volumes, i am getting segmentation fault ,, may i know what is the reason behind this,(my main interest is i want to increase my CV by increasing RAM size, but it is not working out) Please help me .. thankyou for your attention.

Jarmo Monttinen June 3, 2004 11:05

Re: Fortran
 
Look for "stack size" in your compiler manual, this may be to blame. I recall seeing similar problems with Digital Visual Fortran years ago and believe that was the solution.

-- Jarmo

ag June 3, 2004 13:14

Re: Fortran
 
If you get an error when you increase the number of volumes then you probably have an array overflow - compile with -C and see if the program indicates where/if such an array boundary error is occurring.

Ananda Himansu June 3, 2004 18:04

Re: Fortran
 
I believe MS Windows on a 32-bit processor sets a limit of 2 GB of RAM per process, even though it can itself access 4 GB on a single machine. Also, keep in mind that MS Windows uses up a fair chunk of memory for itself. One way to use up to 4 GB of memory on a single machine may be to parallelize your code with OpenMP or MPI, and run two processes with each using 2 GB.

matej June 4, 2004 01:36

Re: Fortran
 
it is easy to look when the code is running how much memory it swallows. But I guess the problem is,as Jarmo wrote, in stack size. Your variables and arrays are stored in stacks of some size. if you working in unix, you can try to set its size to unlimited by $ulimit unlimited .

Olso check the array definition.compile with the compiler switch checking the array boundaries. (in absoft it is -C in others other...).

the other tools to track what is going on are gdb debugger with electric fence - handy piece of code filling up the memory with scrap, so it can show you the place, where your code is shooting out of its defined memory space. It's not all the fancy icons and clicking, but it works well. Another similar tracking tool is 'strace'. sorry- all of them unix ...

matej

chinthakindi June 4, 2004 15:28

Re: Fortran
 
Hi Friends; I am working on UNIX, the problem may be due to stack size as mentioned Jarmo Monttinen, Jarmo Monttinen, can i know where i will get the manual for that, after seeing the manual, how we can rectify this problem. still now i am not much aware of this manual, Please let me know more details about this. thankyou

Jarmo Monttinen June 4, 2004 19:51

Re: Fortran
 
Well.. I would just see if the Unix computer you are using has any built-in manuals. For example with Fortran compiler, type in
: man f77 and you should get the manual for that. The stack size is probably limited by the system, not the compiler. I can't remember how exactly I modified it, it was something along
: limit stacksize unlimited As I could not find manual pages for "limit" or "stacksize" myself I'm guessing that is not the right form. But if you try for example
: man setrlimit you will get some info again. If everything else fails, do a google-search for "modifying stacksize in Unix" or something like that.

I hope this helps, sorry if I do not have the answer you are looking for.

-- Jarmo

Nashat June 4, 2004 20:33

Re: Fortran
 
Under bash in your .bashrc file add the following line:

ulimit -s unlimited

Regards, Nashat


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