CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Segmentation Fault

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2005, 14:42
Default Segmentation Fault
  #1
Victor
Guest
 
Posts: n/a
I have a large (FORTRAN) CFD code compiling with G77. The OS of my machine is Linux-SuSE. The machine has 2GB memory. I get this error message (Segmentation Fault) when I increase the dimensions of the matrices.

1. Is that because of the compiler (g77) which is not able to use the full capacity of 2 GB memory,

2. OR, Linux causes sort of problem so the compiler cannot use the full memory,

3. OR, there is no problem with g77 and linux, but the memory (2GB) is not enough? If this is the case, how can I increase the memory, due to the linux limitation (2GB)?

If the problem could be a combination of two or all of these items, how can I track the problem to resolve this issue?

Appreciate any helpful idea.

Victor

  Reply With Quote

Old   April 4, 2005, 15:06
Default Re: Segmentation Fault
  #2
cfd dude
Guest
 
Posts: n/a
I might actually place bets on option 4, your code is accessing an invalid index in one of your arrays (i.e., the array index is zero or greater than the specified dimensions).

Try compiling with the options to check array bounds to verify this is or isn't the case.
  Reply With Quote

Old   April 4, 2005, 15:18
Default Re: Segmentation Fault
  #3
cfd dude
Guest
 
Posts: n/a
Actually, reading your post again, what sorts of matrix dimensions are we talking about? You can do a quick hand calculation to estimate the memory needed (4*N*N for integers or single precision reals, e.g.).

If N is big enough it may be that your code does exceed the available memory.
  Reply With Quote

Old   April 5, 2005, 07:01
Default Re: Segmentation Fault
  #4
Steve
Guest
 
Posts: n/a
If your matrices are not statically allocated you will run into memory problems. If this is the case, SAVE them in the subroutine that's declaring them.

Alternatively, use the gdb debugger to trap the seg fault in a debug compile version.
  Reply With Quote

Old   April 5, 2005, 08:37
Default Re: Segmentation Fault - Q: MEMORY
  #5
Al
Guest
 
Posts: n/a
Guys,

I found this dicussion interesting. I am new in CFD programing, how can I estimate the capacity of the memory (RAM) in MB or GB, needed for a program which has several matrices? For instance, for an array like AA(1000,1000,1000,1000), how much memory (RAM is needed), if AA is: 1. single-, or 2. double-precision? If the answer goes long, would you please give some references (preferably online)? I took a look at some FORTRAN books already, but couldn't find anything useful on this.

Thanks. Al
  Reply With Quote

Old   April 5, 2005, 09:09
Default Re: Segmentation Fault - Q: MEMORY
  #6
Márcio Ricardo
Guest
 
Posts: n/a
If (1000,1000,1000,1000) is the dimension of your array, you will need 1000X1000X1000X1000*sizeof(double) to allocate it. That is, 10e12*8bytes at least. For such size of arrays some sparse storage scheme to save memory is needed.
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Paraview - Segmentation fault grjmell ParaView 5 January 9, 2024 14:14
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 22:59
Debugging a segmentation fault? hansel OpenFOAM Bugs 3 July 31, 2010 14:13
ParaView segmentation fault only for multiphase gwierink OpenFOAM 9 March 25, 2010 08:23
KIVA and Segmentation Fault Felix Main CFD Forum 2 January 18, 2006 02:24


All times are GMT -4. The time now is 23:05.