For Programmers: Free Programming Magazines  


Home > Archive > Fortran > September 2005 > Malloc in PGI Fortran 90









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Malloc in PGI Fortran 90
niteshkpatil@rediffmail.com

2005-09-30, 3:57 am

Hello,

I am using malloc() function in PGI Fortran90 to allocate memory. I am
using Linux 64 bit machine. The memory available on this machine is
4GB.

Using the malloc() function, I can allocate memory only upto 2100000000
bytes. But sometimes i need to allocate more than this, for example
3000000000 bytes. But,i am unable to allocate such memory.

I also tried this on HP-UX 64 bit machine which has 4GB memory. On this
machine i can allocate memory using malloc() upto 4GB. But this
malloc() is from HP-UX Fortran.

To summarise:
malloc(3000000000) on HP-UX64 (HP-UX Fortran90) works
malloc(3000000000) on LINUX64 (PGI Fortran90) does not work.

So, is there any limitation on usage of malloc() function on LINUX 64
bit machine.
Or, is there any problem with the malloc() in PGI Fortran90.

Note: I am using AMD64 Athlon processor on Linux.

Please can anybody help me on this issue.

Thanks and Regards in advance.

Janne Blomqvist

2005-09-30, 3:57 am

niteshkpatil@rediffmail.com wrote:
> Hello,
>
> I am using malloc() function in PGI Fortran90 to allocate memory. I am
> using Linux 64 bit machine. The memory available on this machine is
> 4GB.
>
> Using the malloc() function, I can allocate memory only upto 2100000000
> bytes. But sometimes i need to allocate more than this, for example
> 3000000000 bytes. But,i am unable to allocate such memory.
>
> I also tried this on HP-UX 64 bit machine which has 4GB memory. On this
> machine i can allocate memory using malloc() upto 4GB. But this
> malloc() is from HP-UX Fortran.
>
> To summarise:
> malloc(3000000000) on HP-UX64 (HP-UX Fortran90) works
> malloc(3000000000) on LINUX64 (PGI Fortran90) does not work.
>
> So, is there any limitation on usage of malloc() function on LINUX 64
> bit machine.
> Or, is there any problem with the malloc() in PGI Fortran90.


Well, let me take a wild guess: The argument to malloc() on PGI is a 4
byte signed integer?

> Please can anybody help me on this issue.


IIRC PGI has some command line switch to make default integers 8
bytes, "-i8" or something like that. Try it and see if it helps.


--
Janne Blomqvist
niteshkpatil@rediffmail.com

2005-09-30, 3:57 am

Hello,

I am using the "-i8" option while compiling. But still it fails.

Sorry...i didn't provide this information earlier.

I even tried "-mcmodel=medium", but it still didn;t work.

Could there be any other option i should use ??

Thanks,

Paul Van Delst

2005-09-30, 6:59 pm

niteshkpatil@rediffmail.com wrote:
> Hello,
>
> I am using the "-i8" option while compiling. But still it fails.
>
> Sorry...i didn't provide this information earlier.
>
> I even tried "-mcmodel=medium", but it still didn;t work.
>
> Could there be any other option i should use ??


Do you have the 64-bit version of PGI installed. I think the default Linux installation is
the 32-bit version (nothing to do with your OS being 64-bit). BTW, what version of
pgf90/95 do you have installed?

Otherwise, why not use the ALLOCATE statement? That has the advantage of being Standard
f90/95. If that also fails, you can check the STAT result to perhaps get some more info.

cheers,

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com