- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
{
return TRUE;
}
If I call this function in my Fortran program, and use
ifort testlarge.f entestf.f reg.lib
The generated testlarge.exe can only allocate 161M-element array, occupying only 1.288 GB!
Do you know why there is a discount of the memory usage?
Please note that this test is done in a Pentium 4 machine with 1 GB or 2 GB memory.
Message Edited by jingz on 07-25-2005 09:07 AM
- Marcas:
- Intel® Fortran Compiler
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
complex
A(248000000) ! Does this mean(+ fudge)?and call GetId later, itworks.
However, I need to dinamically allocate the array. If I use
complex A(:) allocatable :: A...
allocate
(A(170000000))call
GetIdItdeos NOT work.
I need to allocate the array dynamically in my program. Why is dynamic allocation even worse?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
real bigarray(*)
pointer (p_bigarray, bigarray)
p_bigarray = malloc (number_of_elements*4)
This will use C's malloc (indirectly) and you should not get the pool fragmentation. Maybe. You can now refer to bigarray normally, though you don't get bounds checking.
I will comment that pushing the 2GB limit can cause unpredictable results - your program may work on some systems and not others, or work one day and not another. It all depends on what else is loaded into your address space by Windows.
You may also want to experiment with the order in which you do the allocations, which may make a difference.
Or consider using the Win32 API VirtualAlloc for both C and Fortran.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
real(8), allocatable :: dummy(:)
program YourProgramName
! in beginning of program before any other calls
! e.g. first execuitable line in main
allocate(dummy(248000000+256))
call InitializeProgram ! Including Getting Array Size
... ! other startup but pre-allocation code
! Now allocate big honk'n array to BigHonknSize
deallocate(dummy) ! free up humoungous memory block
allocate(A(BigHonknSize))
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado

- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora