View previous topic :: View next topic |
Author |
Message |
xian1633
Joined: 18 Nov 2008 Posts: 4
|
Posted: Wed Nov 26, 2008 2:42 pm Post subject: Mixed programming in FORTRAN with ANSI C |
|
|
Hi,
I wonder if any of you have met problems in mixed FORTRAN+C programming. Our SATURN software has always been coded in FORTAN with the Salford compiler and recently I have added a new algorithm implemneted in C. We mainly call C modules from inside SATURN, and occasionally call some FORTRAN functions inside C modules. We also utilise common arrays between FORTRAN and C. We are constrained to use the Salfod C compiler also, in consistent to Salford FORTRAN compiler (both the latest version).
We came across problems in model large transport networks -- the software works fine for small models but it will crash for large models in C's malloc (not enough memory). For example, from Windows Task Manger, it crashed when I used up around 1.35GB of RAM (just beyond my physical memory limit). I thought that the paging would help in virtual memory management and I would certainly be allowed to use more memories than the physical memory limit?
It seemed to me also that sometime when the runs crashed, the window system got stuck and error messages on win***.exe appearing?
I wonder if anyone has experienced the similar things before. Any comeents and advice would most be most appreciated.
Yanling Xiang
Atkins
UK |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8209 Location: Salford, UK
|
Posted: Wed Nov 26, 2008 3:03 pm Post subject: |
|
|
You may find it helpful to look at the Announcements section of this forum under "Beta: Extra memory available for larger machines". Also search in this forum for the 3GB switch in SLINK.
If you use the salflibc.dll mentioned in the Announcements then you should avoid using realloc for the time being.
This may allow you to go above 1.35GB but somewhere around 1.8GB in one chunk may be the limit. Try a simple test C program that just calls malloc for increasing large chunks. |
|
Back to top |
|
 |
xian1633
Joined: 18 Nov 2008 Posts: 4
|
Posted: Wed Nov 26, 2008 3:56 pm Post subject: Mixed programming in FORTRAN with ANSI C |
|
|
Dear paul,
Many thanks for the propmt reply -- we are investigating according the way you suggested and shall get back to you with our findings.
Yanling |
|
Back to top |
|
 |
|