Silverfrost Forums

Welcome to our forums

Mixed programming in FORTRAN with ANSI C

26 Nov 2008 1:42 #4043

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

26 Nov 2008 2:03 #4044

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.

26 Nov 2008 2:56 #4045

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

Please login to reply.