Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Computer hangs during allocating memory

skravoof
初学者
1,317 次查看
Dear all,
I have a weird problem. My project sometimes goes out of memory . When I use fortran powerstation i will endup with out of memory message. For the same code if I use Inter fortran compiler the whole computer hangs during memory allocation. Is there anyway I can stop the code excuction if its out of memory.
PS: I am using visual studio 2008 as well
Regards,
skravoof
0 项奖励
7 回复数
Les_Neilson
重要分销商 II
1,317 次查看
If you are using the Fortran "allocate" statement then use the error status to check for failure/insufficient memory. Then you will know which array "fails".
Some people like to allocate several arrays in one allocate statement which is ok but if you are doing this and your arrays are large then IMHO it is better to allocate one array at a time and check the status.

If you also have large arrays(not sized by allocate) then use /heap-arrays:0
See in VisualStudio Project -> Properties -> Fortran -> Optimization -> Heap Arrays

Les

0 项奖励
mecej4
名誉分销商 III
1,317 次查看
I am not yet convinced that the program ran out of memory (well, I have not seen any code yet!).

You wrote "For the same code if I use Inter fortran compiler the whole computer hangs during memory allocation". That is hard to believe. An ALLOCATE statement either succeeds or fails. I have never seen an ALLOCATE statement cause a computer to hang. On the other hand, if the status is not checked following a failed ALLOCATE, and the not-yet-properly-allocated memory is used, that can certainly cause the hang.

You can use the /traceback compiler option to locate the part of your program where a problem occurs. You can use the STAT= option of the ALLOCATE statement and examine the value of the status variable, as well.


0 项奖励
Antonio_R_3
初学者
1,317 次查看

I am new in the use of the coarray ifort facilities, for linux, and I have a problem similar to the one described before. The following is a summary of the code that fails.

.......................... (ifort code)

real(sp), allocatable  :: snr(:)[:]      

........................(ifort code)

allocate (snr(NumberBeams)

  • ,stat=stat)
    write(*,*) "snr ",stat
  • ..................................................

    And the program hangs, and  never executes the last sentence.  

    0 项奖励
    Bernard
    重要分销商 I
    1,317 次查看

    >>>For the same code if I use Inter fortran compiler the whole computer hangs during memory allocation. Is there anyway I can stop the code excuction if its out of memory.>>>

    Can you use process explorer or better VMmap to confirm out-of-memory scenario?

    0 项奖励
    SergeyKostrov
    重要分销商 II
    1,317 次查看
    >>...My project sometimes goes out of memory . When I use fortran powerstation i will endup with out of memory message... Please provide additional technical details of your system: How much physical memory is installed and settings for Virtual Memory ( see System applet in Control Panel ).
    0 项奖励
    Bernard
    重要分销商 I
    1,317 次查看

    @skravoof

    any updates on your problem?

    0 项奖励
    Lorri_M_Intel
    员工
    1,317 次查看

    Antonio R. wrote:

    I am new in the use of the coarray ifort facilities, for linux, and I have a problem similar to the one described before. The following is a summary of the code that fails.

    .......................... (ifort code)

    real(sp), allocatable  :: snr(:)[:]      

    ........................(ifort code)

    allocate (snr(NumberBeams)

  • ,stat=stat)
    write(*,*) "snr ",stat
  • ..................................................

    And the program hangs, and  never executes the last sentence.  

    Popping back to this one for a second ... please look at your code, and make sure that the allocate statement is happening on ALL images.   It is a requirement that all images perform the same allocate on a coarray object.  Also, the language requires that all images wait until everyone has completed the allocation before continuing.

      If you have code that only performs the allocation on some of the images, well, they are waiting patiently for the ones not participating.

                     --Lorri

    0 项奖励
    回复