|
[Sponsors] |
Using the T array in posdat.f, sigsegv, debugger |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Guest
Posts: n/a
|
I have a transient model which uses several scalars (7 active, 15 passive). The active scalars use sorsca.f to change the concentrations, one of the passive scalars uses scalfn.f, but the rest require reading and changing the values at the end of the time step. To accomplish this, I have been using the T array in posdat.f. However, after a certain number of time steps (depending on the size of the time step and whether it is single or double precision, but around 30 steps), the solution fails with a segmentation fault ("Received signal sigsegv - exiting"). However, when I use the "-g -devtool='gdb'" options to debug, the segmentation fault disappears and the solution runs!? Does anyone have an idea why this might be, or what to change so that it will run without the debugger? I am at a loss for ideas, so anything would be helpful. Thanks so much!
|
|
![]() |
![]() |
![]() |
#2 |
Guest
Posts: n/a
|
It's probably memory corruption - you're writing beyond the range of an array somewhere, or you are using dynamic memory (i.e. a Cray pointer) which you have not allocated. Sometimes the corruption gets "moved" when you compile "-g", making it appear that the problem has been fixed.
If the run fails with "-g" (no -devtool) then you could try a memory checker like valgrind. Otherwise you will probably have to use print statements in your coding. Check that you are allocating memory, and check that array indices are always within bounds. |
|
![]() |
![]() |
![]() |
#3 |
Guest
Posts: n/a
|
I'm pretty sure you are right. The run still works when I only use the -g option and leave out -devtool. I'm actually not using any user defined arrays; the only array I use is the T array in posdat.f. I've checked all of my indices, etc., when I read from and write to the T array and there doesn't seem to be a problem there. I think it's just that I have so many scalars (22) and computational cells (45,000 for now, but that will be increasing significantly), that I'm using memory not allocated to the T array by Star-CD. Do you know how to allocate more memory to the T array, since it is a built-in Star-CD variable? Thanks so much!
|
|
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam 13 How can one run solver in debugger | atzaru | OpenFOAM | 7 | July 6, 2009 12:45 |
debugger with STAR CD V4 | Jaishree | Siemens | 1 | December 2, 2007 15:40 |
fortran debugger | John Deas | Main CFD Forum | 10 | April 4, 2007 04:30 |
Intel Fortran debugger with mpirun | agg | Main CFD Forum | 2 | March 21, 2007 18:43 |
Visual Fortran compiler and debugger on linux | CFD Student | Main CFD Forum | 3 | February 26, 2007 07:26 |